summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedricbosdo@openoffice.org>2011-03-17 17:39:42 +0100
committerCédric Bosdonnat <cedricbosdo@openoffice.org>2011-03-19 17:57:19 +0100
commitb69f4871cafd0ad44f1ee2e813df84c318f2a945 (patch)
tree9374972f5a09b9d1becb6fd35d2967961f239ce5 /xmloff
parent6695b26980f9b089c32308cd8fd51706bf8c34f1 (diff)
Fixed line style in footnote format GUI and saved it to ODF
Diffstat (limited to 'xmloff')
-rwxr-xr-xxmloff/inc/xmloff/PageMasterStyleMap.hxx1
-rwxr-xr-xxmloff/inc/xmloff/xmltoken.hxx1
-rwxr-xr-xxmloff/source/core/xmltoken.cxx1
-rwxr-xr-xxmloff/source/style/PageMasterStyleMap.cxx1
-rwxr-xr-xxmloff/source/style/XMLFootnoteSeparatorExport.cxx22
-rwxr-xr-xxmloff/source/style/XMLFootnoteSeparatorImport.cxx23
6 files changed, 49 insertions, 0 deletions
diff --git a/xmloff/inc/xmloff/PageMasterStyleMap.hxx b/xmloff/inc/xmloff/PageMasterStyleMap.hxx
index b6d32aff0aad..84685a780fdb 100755
--- a/xmloff/inc/xmloff/PageMasterStyleMap.hxx
+++ b/xmloff/inc/xmloff/PageMasterStyleMap.hxx
@@ -148,6 +148,7 @@
#define CTF_PM_FTN_LINE_ADJUST (XML_PM_CTF_START + 0x0064)
#define CTF_PM_FTN_LINE_DISTANCE (XML_PM_CTF_START + 0x0065)
#define CTF_PM_FTN_DISTANCE (XML_PM_CTF_START + 0x0066)
+#define CTF_PM_FTN_LINE_STYLE (XML_PM_CTF_START + 0x0067)
extern const XMLPropertyMapEntry aXMLPageMasterStyleMap[];
extern const XMLPropertyMapEntry aXMLPageMasterHeaderImportStyleMap[];
diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx
index e15da983fd6d..64f5a44960e1 100755
--- a/xmloff/inc/xmloff/xmltoken.hxx
+++ b/xmloff/inc/xmloff/xmltoken.hxx
@@ -1075,6 +1075,7 @@ namespace xmloff { namespace token {
XML_LINE_NUMBER,
XML_LINE_SKEW,
XML_LINE_SPACING,
+ XML_LINE_STYLE,
XML_LINEAR,
XML_LINENUMBERING_CONFIGURATION,
XML_LINENUMBERING_SEPARATOR,
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 9f273b713cb4..9e2b9abf0139 100755
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -1082,6 +1082,7 @@ namespace xmloff { namespace token {
TOKEN( "line-number", XML_LINE_NUMBER ),
TOKEN( "line-skew", XML_LINE_SKEW ),
TOKEN( "line-spacing", XML_LINE_SPACING ),
+ TOKEN( "line-style", XML_LINE_STYLE ),
TOKEN( "linear", XML_LINEAR ),
TOKEN( "linenumbering-configuration", XML_LINENUMBERING_CONFIGURATION ),
TOKEN( "linenumbering-separator", XML_LINENUMBERING_SEPARATOR ),
diff --git a/xmloff/source/style/PageMasterStyleMap.cxx b/xmloff/source/style/PageMasterStyleMap.cxx
index a593744fd4ae..79624cfc6285 100755
--- a/xmloff/source/style/PageMasterStyleMap.cxx
+++ b/xmloff/source/style/PageMasterStyleMap.cxx
@@ -124,6 +124,7 @@ const XMLPropertyMapEntry aXMLPageMasterStyleMap[] =
PLMAP( "FootnoteLineRelativeWidth", XML_NAMESPACE_STYLE, XML__EMPTY, XML_TYPE_PERCENT8|MID_FLAG_SPECIAL_ITEM, CTF_PM_FTN_LINE_WIDTH ),
PLMAP( "FootnoteLineTextDistance", XML_NAMESPACE_STYLE, XML__EMPTY, XML_TYPE_MEASURE|MID_FLAG_SPECIAL_ITEM, CTF_PM_FTN_LINE_DISTANCE ),
PLMAP( "FootnoteLineWeight", XML_NAMESPACE_STYLE, XML_FOOTNOTE_SEP, XML_TYPE_MEASURE16|MID_FLAG_ELEMENT_ITEM, CTF_PM_FTN_LINE_WEIGTH ),
+ PLMAP( "FootnoteLineStyle", XML_NAMESPACE_STYLE, XML_EMPTY, XML_TYPE_STRING|MID_FLAG_ELEMENT_ITEM, CTF_PM_FTN_LINE_STYLE ),
// header
HFMAP( "HeaderHeight", XML_NAMESPACE_SVG, XML_HEIGHT, XML_TYPE_MEASURE, CTF_PM_HEADERHEIGHT ),
diff --git a/xmloff/source/style/XMLFootnoteSeparatorExport.cxx b/xmloff/source/style/XMLFootnoteSeparatorExport.cxx
index ae775a96d9f7..a7f5e0c1bf3a 100755
--- a/xmloff/source/style/XMLFootnoteSeparatorExport.cxx
+++ b/xmloff/source/style/XMLFootnoteSeparatorExport.cxx
@@ -74,6 +74,7 @@ void XMLFootnoteSeparatorExport::exportXML(
sal_Int8 nLineRelWidth = 0;
sal_Int32 nLineTextDistance = 0;
sal_Int16 nLineWeight = 0;
+ sal_Int8 nLineStyle = 0;
// find indices into property map and get values
sal_uInt32 nCount = pProperties->size();
@@ -106,6 +107,9 @@ void XMLFootnoteSeparatorExport::exportXML(
"received wrong property state index" );
rState.maValue >>= nLineWeight;
break;
+ case CTF_PM_FTN_LINE_STYLE:
+ rState.maValue >>= nLineStyle;
+ break;
}
}
@@ -135,6 +139,22 @@ void XMLFootnoteSeparatorExport::exportXML(
sBuf.makeStringAndClear());
}
+ // line style
+ static const SvXMLEnumMapEntry aXML_LineStyle_Enum[] =
+ {
+ { XML_NONE, 0 },
+ { XML_SOLID, 1 },
+ { XML_DOTTED, 2 },
+ { XML_DASH, 3 },
+ { XML_TOKEN_INVALID, 0 }
+ };
+ if (rExport.GetMM100UnitConverter().convertEnum(
+ sBuf, nLineStyle, aXML_LineStyle_Enum ) )
+ {
+ rExport.AddAttribute(XML_NAMESPACE_STYLE, XML_LINE_STYLE,
+ sBuf.makeStringAndClear());
+ }
+
// adjustment
static const SvXMLEnumMapEntry aXML_HorizontalAdjust_Enum[] =
{
@@ -161,6 +181,8 @@ void XMLFootnoteSeparatorExport::exportXML(
rExport.AddAttribute(XML_NAMESPACE_STYLE, XML_COLOR,
sBuf.makeStringAndClear());
+ // line-style
+
SvXMLElementExport aElem(rExport, XML_NAMESPACE_STYLE,
XML_FOOTNOTE_SEP, sal_True, sal_True);
}
diff --git a/xmloff/source/style/XMLFootnoteSeparatorImport.cxx b/xmloff/source/style/XMLFootnoteSeparatorImport.cxx
index 9a6cb47228fd..4c579c78bed5 100755
--- a/xmloff/source/style/XMLFootnoteSeparatorImport.cxx
+++ b/xmloff/source/style/XMLFootnoteSeparatorImport.cxx
@@ -92,6 +92,7 @@ void XMLFootnoteSeparatorImport::StartElement(
sal_Int16 eLineAdjust = text::HorizontalAdjust_LEFT; // enum text::HorizontalAdjust
sal_Int32 nLineTextDistance = 0;
sal_Int32 nLineDistance = 0;
+ sal_Int8 nLineStyle = 0;
// iterate over xattribute list and fill values
sal_Int16 nLength = xAttrList->getLength();
@@ -152,6 +153,23 @@ void XMLFootnoteSeparatorImport::StartElement(
if (SvXMLUnitConverter::convertColor(aColor, sAttrValue))
nLineColor = (sal_Int32)aColor.GetColor();
}
+ else if (IsXMLToken( sLocalName, XML_LINE_STYLE ))
+ {
+ sal_uInt16 nTmpU;
+ static const SvXMLEnumMapEntry aXML_LineStyle_Enum[] =
+ {
+ { XML_NONE, 0 },
+ { XML_SOLID, 1 },
+ { XML_DOTTED, 2 },
+ { XML_DASH, 3 },
+ { XML_TOKEN_INVALID, 0 }
+ };
+
+ if (SvXMLUnitConverter::convertEnum(
+ nTmpU, sAttrValue, aXML_LineStyle_Enum))
+ nLineStyle = (sal_Int8)nTmpU;
+
+ }
}
}
@@ -169,6 +187,11 @@ void XMLFootnoteSeparatorImport::StartElement(
XMLPropertyState aLineColor( nIndex, aAny );
rProperties.push_back(aLineColor);
+ aAny <<= nLineStyle;
+ nIndex = rMapper->FindEntryIndex(CTF_PM_FTN_LINE_STYLE);
+ XMLPropertyState aLineStyle( nIndex, aAny );
+ rProperties.push_back(aLineStyle);
+
aAny <<= nLineDistance;
nIndex = rMapper->FindEntryIndex(CTF_PM_FTN_DISTANCE);
XMLPropertyState aLineDistance( nIndex, aAny );