diff options
author | Michael Stahl <mst@openoffice.org> | 2011-10-11 14:19:09 +0200 |
---|---|---|
committer | Michael Stahl <mst@openoffice.org> | 2011-10-11 17:57:01 +0200 |
commit | 8666469d7b0f450ec1448f80eda3c591f8d8d318 (patch) | |
tree | ae63c5f07df7d3c2d45ea03e47f147661f280923 /xmloff/source/text/txtparae.cxx | |
parent | ae3e2f170045a1525f67e9f3e9b7e03d94f2b56b (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/text/txtparae.cxx')
-rw-r--r-- | xmloff/source/text/txtparae.cxx | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index b728f33ec87f..14501ae9f498 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -2542,7 +2542,8 @@ sal_Int32 XMLTextParagraphExport::addTextFrameAttributes( { sal_Int32 nPos = 0; rPropSet->getPropertyValue( sHoriOrientPosition ) >>= nPos; - GetExport().GetMM100UnitConverter().convertMeasure( sValue, nPos ); + GetExport().GetMM100UnitConverter().convertMeasureToXML( + sValue, nPos ); GetExport().AddAttribute( XML_NAMESPACE_SVG, XML_X, sValue.makeStringAndClear() ); } @@ -2559,7 +2560,8 @@ sal_Int32 XMLTextParagraphExport::addTextFrameAttributes( { sal_Int32 nPos = 0; rPropSet->getPropertyValue( sVertOrientPosition ) >>= nPos; - GetExport().GetMM100UnitConverter().convertMeasure( sValue, nPos ); + GetExport().GetMM100UnitConverter().convertMeasureToXML( + sValue, nPos ); GetExport().AddAttribute( XML_NAMESPACE_SVG, XML_Y, sValue.makeStringAndClear() ); } @@ -2584,7 +2586,7 @@ sal_Int32 XMLTextParagraphExport::addTextFrameAttributes( { rPropSet->getPropertyValue( sWidth ) >>= nWidth; } - GetExport().GetMM100UnitConverter().convertMeasure( sValue, nWidth ); + GetExport().GetMM100UnitConverter().convertMeasureToXML(sValue, nWidth); if( SizeType::FIX != nWidthType ) GetExport().AddAttribute( XML_NAMESPACE_FO, XML_MIN_WIDTH, sValue.makeStringAndClear() ); @@ -2637,7 +2639,7 @@ sal_Int32 XMLTextParagraphExport::addTextFrameAttributes( { rPropSet->getPropertyValue( sHeight ) >>= nHeight; } - GetExport().GetMM100UnitConverter().convertMeasure( sValue, + GetExport().GetMM100UnitConverter().convertMeasureToXML( sValue, nHeight ); if( SizeType::FIX != nSizeType && 0==nRelHeight && !bSyncHeight && pMinHeightValue ) @@ -2890,17 +2892,27 @@ void XMLTextParagraphExport::exportContour( // svg: width OUStringBuffer aStringBuffer( 10 ); if( bPixel ) - GetExport().GetMM100UnitConverter().convertMeasurePx(aStringBuffer, aSize.Width); + { + ::sax::Converter::convertMeasurePx(aStringBuffer, aSize.Width); + } else - GetExport().GetMM100UnitConverter().convertMeasure(aStringBuffer, aSize.Width); + { + GetExport().GetMM100UnitConverter().convertMeasureToXML( + aStringBuffer, aSize.Width); + } GetExport().AddAttribute( XML_NAMESPACE_SVG, XML_WIDTH, aStringBuffer.makeStringAndClear() ); // svg: height if( bPixel ) - GetExport().GetMM100UnitConverter().convertMeasurePx(aStringBuffer, aSize.Height); + { + ::sax::Converter::convertMeasurePx(aStringBuffer, aSize.Height); + } else - GetExport().GetMM100UnitConverter().convertMeasure(aStringBuffer, aSize.Height); + { + GetExport().GetMM100UnitConverter().convertMeasureToXML( + aStringBuffer, aSize.Height); + } GetExport().AddAttribute( XML_NAMESPACE_SVG, XML_HEIGHT, aStringBuffer.makeStringAndClear() ); |