summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-05-16 10:45:40 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-05-16 10:47:58 -0400
commitfcf5b5c081ded93b12dd888236d0a860b7693ed1 (patch)
tree84d48f77681a3cd9f71cefa243c27bd63afac96b
parent5c0b8937f4f41ed1e4a01151bc96113f65c2770c (diff)
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. Change-Id: I88cb0f3702a6afc14544ecbce8f200b5422fd78f
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx39
1 files changed, 36 insertions, 3 deletions
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 737a8813b77f..d61496e32e4a 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -1171,6 +1171,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;
@@ -1182,6 +1186,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);
@@ -1193,10 +1198,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: