[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source

Kohei Yoshida kohei.yoshida at collabora.com
Fri May 16 08:32:45 PDT 2014


 sc/source/filter/xml/xmlexprt.cxx |   39 +++++++++++++++++++++++++++++++++++---
 1 file changed, 36 insertions(+), 3 deletions(-)

New commits:
commit e373ca05c6d332d139d5a7553faf15d1d0c8cdeb
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Fri May 16 10:45:40 2014 -0400

    fdo#75056: Overline attribute needs special treatment as well.
    
    Also fix the export of underline types as well.  It was always saved
    as a single line.
    
    (cherry picked from commit fcf5b5c081ded93b12dd888236d0a860b7693ed1)
    
    Change-Id: I88cb0f3702a6afc14544ecbce8f200b5422fd78f
    Signed-off-by: Fridrich Strba <fridrich at documentfoundation.org>

diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index f7c6787..885b5bc 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -1164,6 +1164,10 @@ const SvxFieldData* toXMLPropertyStates(
                 if (nIndexWidth == -1 || nIndexWidth > nEntryCount)
                     break;
 
+                sal_Int32 nIndexType = xMapper->GetEntryIndex(XML_NAMESPACE_STYLE, "text-underline-type", 0);
+                if (nIndexType == -1 || nIndexType > nEntryCount)
+                    break;
+
                 sal_Int32 nIndexColor = xMapper->FindEntryIndex("CharUnderlineColor", XML_NAMESPACE_STYLE, "text-underline-color");
                 if (nIndexColor == -1 || nIndexColor > nEntryCount)
                     break;
@@ -1175,6 +1179,7 @@ const SvxFieldData* toXMLPropertyStates(
                 const SvxUnderlineItem* pUL = static_cast<const SvxUnderlineItem*>(p);
                 pUL->QueryValue(aAny, MID_TL_STYLE);
                 rPropStates.push_back(XMLPropertyState(nIndexStyle, aAny));
+                rPropStates.push_back(XMLPropertyState(nIndexType,  aAny));
                 rPropStates.push_back(XMLPropertyState(nIndexWidth, aAny));
 
                 pUL->QueryValue(aAny, MID_TL_COLOR);
@@ -1186,10 +1191,38 @@ const SvxFieldData* toXMLPropertyStates(
             break;
             case EE_CHAR_OVERLINE:
             {
-                if (!static_cast<const SvxOverlineItem*>(p)->QueryValue(aAny, pEntry->mnFlag))
-                    continue;
+                // Same with overline.  Do just as we do with underline attributes.
+                sal_Int32 nIndexStyle = xMapper->GetEntryIndex(XML_NAMESPACE_STYLE, "text-overline-style", 0);
+                if (nIndexStyle == -1 || nIndexStyle > nEntryCount)
+                    break;
 
-                rPropStates.push_back(XMLPropertyState(nIndex, aAny));
+                sal_Int32 nIndexWidth = xMapper->GetEntryIndex(XML_NAMESPACE_STYLE, "text-overline-width", 0);
+                if (nIndexWidth == -1 || nIndexWidth > nEntryCount)
+                    break;
+
+                sal_Int32 nIndexType = xMapper->GetEntryIndex(XML_NAMESPACE_STYLE, "text-overline-type", 0);
+                if (nIndexType == -1 || nIndexType > nEntryCount)
+                    break;
+
+                sal_Int32 nIndexColor = xMapper->FindEntryIndex("CharOverlineColor", XML_NAMESPACE_STYLE, "text-overline-color");
+                if (nIndexColor == -1 || nIndexColor > nEntryCount)
+                    break;
+
+                sal_Int32 nIndexHasColor = xMapper->FindEntryIndex("CharOverlineHasColor", XML_NAMESPACE_STYLE, "text-overline-color");
+                if (nIndexHasColor == -1 || nIndexHasColor > nEntryCount)
+                    break;
+
+                const SvxOverlineItem* pOL = static_cast<const SvxOverlineItem*>(p);
+                pOL->QueryValue(aAny, MID_TL_STYLE);
+                rPropStates.push_back(XMLPropertyState(nIndexStyle, aAny));
+                rPropStates.push_back(XMLPropertyState(nIndexType,  aAny));
+                rPropStates.push_back(XMLPropertyState(nIndexWidth, aAny));
+
+                pOL->QueryValue(aAny, MID_TL_COLOR);
+                rPropStates.push_back(XMLPropertyState(nIndexColor, aAny));
+
+                pOL->QueryValue(aAny, MID_TL_HASCOLOR);
+                rPropStates.push_back(XMLPropertyState(nIndexHasColor, aAny));
             }
             break;
             case EE_CHAR_COLOR:


More information about the Libreoffice-commits mailing list