summaryrefslogtreecommitdiff
path: root/xmloff/source/style/xmlnume.cxx
diff options
context:
space:
mode:
authorMichael Stahl <mst@openoffice.org>2011-10-11 14:19:09 +0200
committerMichael Stahl <mst@openoffice.org>2011-10-11 17:57:01 +0200
commit8666469d7b0f450ec1448f80eda3c591f8d8d318 (patch)
treeae63c5f07df7d3c2d45ea03e47f147661f280923 /xmloff/source/style/xmlnume.cxx
parentae3e2f170045a1525f67e9f3e9b7e03d94f2b56b (diff)
#i108468#: clean up xmluconv code duplication, measured approach:
modify sax::Converter::convertMeasure to use sal_Int64 instead of BigInt: should be sufficient, since the largest number is SAL_INT32_MAX * 10^7. remove duplicate methods from SvXMLUnitConverter: convertMeasurePx, convertMeasure (static variants) remove entirely duplicative class SvXMLExportHelper: GetConversionFactor, GetUnitFromString, AddLength change SvXMLUnitConverter interface from MapUnit to css::util::MeasureUnit. change SvXMLExport constructor params from MapUnit to css::util::MeasureUnit. rename some methods to turn compiler into merge conflict detector :)
Diffstat (limited to 'xmloff/source/style/xmlnume.cxx')
-rw-r--r--xmloff/source/style/xmlnume.cxx24
1 files changed, 16 insertions, 8 deletions
diff --git a/xmloff/source/style/xmlnume.cxx b/xmloff/source/style/xmlnume.cxx
index 115c813712fd..58145c4d1378 100644
--- a/xmloff/source/style/xmlnume.cxx
+++ b/xmloff/source/style/xmlnume.cxx
@@ -399,19 +399,22 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel,
nMinLabelWidth = -nMinLabelWidth;
if( nSpaceBefore != 0 )
{
- GetExport().GetMM100UnitConverter().convertMeasure( sBuffer, nSpaceBefore );
+ GetExport().GetMM100UnitConverter().convertMeasureToXML(
+ sBuffer, nSpaceBefore );
GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_SPACE_BEFORE,
sBuffer.makeStringAndClear() );
}
if( nMinLabelWidth != 0 )
{
- GetExport().GetMM100UnitConverter().convertMeasure( sBuffer, nMinLabelWidth );
+ GetExport().GetMM100UnitConverter().convertMeasureToXML(
+ sBuffer, nMinLabelWidth );
GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_MIN_LABEL_WIDTH,
sBuffer.makeStringAndClear() );
}
if( nMinLabelDist > 0 )
{
- GetExport().GetMM100UnitConverter().convertMeasure( sBuffer, nMinLabelDist );
+ GetExport().GetMM100UnitConverter().convertMeasureToXML(
+ sBuffer, nMinLabelDist );
GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_MIN_LABEL_DISTANCE,
sBuffer.makeStringAndClear() );
}
@@ -488,14 +491,16 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel,
if( nImageWidth > 0 )
{
- GetExport().GetMM100UnitConverter().convertMeasure( sBuffer, nImageWidth );
+ GetExport().GetMM100UnitConverter().convertMeasureToXML(
+ sBuffer, nImageWidth );
GetExport().AddAttribute( XML_NAMESPACE_FO, XML_WIDTH,
sBuffer.makeStringAndClear() );
}
if( nImageHeight > 0 )
{
- GetExport().GetMM100UnitConverter().convertMeasure( sBuffer, nImageHeight );
+ GetExport().GetMM100UnitConverter().convertMeasureToXML(
+ sBuffer, nImageHeight );
GetExport().AddAttribute( XML_NAMESPACE_FO, XML_HEIGHT,
sBuffer.makeStringAndClear() );
}
@@ -526,7 +531,8 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel,
if ( eLabelFollowedBy == LabelFollow::LISTTAB &&
nListtabStopPosition > 0 )
{
- GetExport().GetMM100UnitConverter().convertMeasure( sBuffer, nListtabStopPosition );
+ GetExport().GetMM100UnitConverter().convertMeasureToXML(
+ sBuffer, nListtabStopPosition );
GetExport().AddAttribute( XML_NAMESPACE_TEXT,
XML_LIST_TAB_STOP_POSITION,
sBuffer.makeStringAndClear() );
@@ -534,7 +540,8 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel,
if ( nFirstLineIndent != 0 )
{
- GetExport().GetMM100UnitConverter().convertMeasure( sBuffer, nFirstLineIndent );
+ GetExport().GetMM100UnitConverter().convertMeasureToXML(
+ sBuffer, nFirstLineIndent );
GetExport().AddAttribute( XML_NAMESPACE_FO,
XML_TEXT_INDENT,
sBuffer.makeStringAndClear() );
@@ -542,7 +549,8 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel,
if ( nIndentAt != 0 )
{
- GetExport().GetMM100UnitConverter().convertMeasure( sBuffer, nIndentAt );
+ GetExport().GetMM100UnitConverter().convertMeasureToXML(
+ sBuffer, nIndentAt );
GetExport().AddAttribute( XML_NAMESPACE_FO,
XML_MARGIN_LEFT,
sBuffer.makeStringAndClear() );