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 /reportdesign | |
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 'reportdesign')
-rw-r--r-- | reportdesign/source/filter/xml/xmlExport.cxx | 7 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlfilter.cxx | 5 |
2 files changed, 7 insertions, 5 deletions
diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx index 6bace826d7a6..cbebd7aae313 100644 --- a/reportdesign/source/filter/xml/xmlExport.cxx +++ b/reportdesign/source/filter/xml/xmlExport.cxx @@ -48,6 +48,7 @@ #include <sax/tools/converter.hxx> #include <com/sun/star/awt/ImagePosition.hpp> #include <com/sun/star/util/NumberFormat.hpp> +#include <com/sun/star/util/MeasureUnit.hpp> #include <com/sun/star/style/ParagraphAdjust.hpp> #include <com/sun/star/awt/TextAlign.hpp> #include <com/sun/star/report/GroupOn.hpp> @@ -225,12 +226,12 @@ void lcl_adjustColumnSpanOverRows(ORptExport::TSectionsGrid& _rGrid) } // ----------------------------------------------------------------------------- ORptExport::ORptExport(const Reference< XMultiServiceFactory >& _rxMSF,sal_uInt16 nExportFlag) -: SvXMLExport( _rxMSF,MAP_100TH_MM,XML_REPORT, EXPORT_OASIS) +: SvXMLExport( util::MeasureUnit::MM_100TH, _rxMSF, XML_REPORT, EXPORT_OASIS) ,m_bAllreadyFilled(sal_False) { setExportFlags( EXPORT_OASIS | nExportFlag); - GetMM100UnitConverter().setCoreMeasureUnit(MAP_100TH_MM); - GetMM100UnitConverter().setXMLMeasureUnit(MAP_CM); + GetMM100UnitConverter().SetCoreMeasureUnit(MAP_100TH_MM); + GetMM100UnitConverter().SetXMLMeasureUnit(MAP_CM); // (getExportFlags() & EXPORT_CONTENT) != 0 ? : XML_N_OOO _GetNamespaceMap().Add( GetXMLToken(XML_NP_OFFICE), GetXMLToken(XML_N_OFFICE ), XML_NAMESPACE_OFFICE ); diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx index bcf6289ca558..ee31100a5227 100644 --- a/reportdesign/source/filter/xml/xmlfilter.cxx +++ b/reportdesign/source/filter/xml/xmlfilter.cxx @@ -30,6 +30,7 @@ #include <com/sun/star/embed/ElementModes.hpp> #include <com/sun/star/beans/NamedValue.hpp> #include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp> +#include <com/sun/star/util/MeasureUnit.hpp> #include "xmlfilter.hxx" #include "xmlGroup.hxx" #include "xmlReport.hxx" @@ -391,8 +392,8 @@ ORptFilter::ORptFilter( const uno::Reference< XMultiServiceFactory >& _rxMSF,sal :SvXMLImport(_rxMSF,nImportFlags) { DBG_CTOR(rpt_ORptFilter,NULL); - GetMM100UnitConverter().setCoreMeasureUnit(MAP_100TH_MM); - GetMM100UnitConverter().setXMLMeasureUnit(MAP_CM); + GetMM100UnitConverter().SetCoreMeasureUnit(util::MeasureUnit::MM_100TH); + GetMM100UnitConverter().SetXMLMeasureUnit(util::MeasureUnit::CM); GetNamespaceMap().Add( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__rpt) ), GetXMLToken(XML_N_RPT), XML_NAMESPACE_REPORT ); |