summaryrefslogtreecommitdiff
path: root/oox/source
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 /oox/source
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 'oox/source')
-rw-r--r--oox/source/xls/pagesettings.cxx16
1 files changed, 10 insertions, 6 deletions
diff --git a/oox/source/xls/pagesettings.cxx b/oox/source/xls/pagesettings.cxx
index 9082c7342af6..c3cd279baed8 100644
--- a/oox/source/xls/pagesettings.cxx
+++ b/oox/source/xls/pagesettings.cxx
@@ -49,14 +49,14 @@
#include "oox/xls/excelhandlers.hxx"
#include "oox/xls/stylesbuffer.hxx"
#include "oox/xls/unitconverter.hxx"
-#include "tools/mapunit.hxx"
-#include "xmloff/xmluconv.hxx"
+#include <sax/tools/converter.hxx>
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star;
using namespace ::com::sun::star::awt;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
@@ -192,9 +192,11 @@ void PageSettings::importPageSetup( const Relations& rRelations, const Attribute
maModel.maBinSettPath = rRelations.getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) );
maModel.mnPaperSize = rAttribs.getInteger( XML_paperSize, 1 );
aStr = rAttribs.getString ( XML_paperWidth, OUString() );
- SvXMLUnitConverter::convertMeasure( maModel.mnPaperWidth, aStr, MAP_100TH_MM );
+ ::sax::Converter::convertMeasure(
+ maModel.mnPaperWidth, aStr, util::MeasureUnit::MM_100TH);
aStr = rAttribs.getString ( XML_paperHeight, OUString() );
- SvXMLUnitConverter::convertMeasure( maModel.mnPaperHeight, aStr, MAP_100TH_MM );
+ ::sax::Converter::convertMeasure(
+ maModel.mnPaperHeight, aStr, util::MeasureUnit::MM_100TH );
maModel.mnCopies = rAttribs.getInteger( XML_copies, 1 );
maModel.mnScale = rAttribs.getInteger( XML_scale, 100 );
maModel.mnFirstPage = rAttribs.getInteger( XML_firstPageNumber, 1 );
@@ -218,9 +220,11 @@ void PageSettings::importChartPageSetup( const Relations& rRelations, const Attr
maModel.maBinSettPath = rRelations.getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) );
maModel.mnPaperSize = rAttribs.getInteger( XML_paperSize, 1 );
aStr = rAttribs.getString ( XML_paperWidth, OUString() );
- SvXMLUnitConverter::convertMeasure( maModel.mnPaperWidth, aStr, MAP_100TH_MM );
+ ::sax::Converter::convertMeasure(
+ maModel.mnPaperWidth, aStr, util::MeasureUnit::MM_100TH );
aStr = rAttribs.getString ( XML_paperHeight, OUString() );
- SvXMLUnitConverter::convertMeasure( maModel.mnPaperHeight, aStr, MAP_100TH_MM );
+ ::sax::Converter::convertMeasure(
+ maModel.mnPaperHeight, aStr, util::MeasureUnit::MM_100TH );
maModel.mnCopies = rAttribs.getInteger( XML_copies, 1 );
maModel.mnFirstPage = rAttribs.getInteger( XML_firstPageNumber, 1 );
maModel.mnHorPrintRes = rAttribs.getInteger( XML_horizontalDpi, 600 );