[Libreoffice-commits] .: 7 commits - configure.in cppunit/makefile.mk dbaccess/Library_dba.mk dbaccess/Library_dbaxml.mk dbaccess/source editeng/source filter/Library_svgfilter.mk filter/Library_xsltfilter.mk filter/source linguistic/source mysqlcppconn/mysql_config.pmk oox/source reportdesign/Library_rptxml.mk reportdesign/source sax/inc sax/source sc/CppunitTest_sc_filters_test.mk sc/CppunitTest_sc_ucalc.mk sc/Library_sc.mk sc/source solenv/gbuild solenv/inc starmath/source svx/Library_svxcore.mk svx/source sw/CppunitTest_sw_swdoc_test.mk sw/Library_sw.mk sw/source xmloff/Library_xo.mk xmloff/Library_xof.mk xmloff/inc xmloff/prj xmloff/source xmlsecurity/Library_xmlsecurity.mk xmlsecurity/source
Michael Stahl
mst at kemper.freedesktop.org
Tue Oct 11 08:57:59 PDT 2011
configure.in | 16
cppunit/makefile.mk | 9
dbaccess/Library_dba.mk | 1
dbaccess/Library_dbaxml.mk | 1
dbaccess/source/core/recovery/settingsimport.cxx | 14
dbaccess/source/filter/xml/xmlDataSourceSetting.cxx | 11
dbaccess/source/filter/xml/xmlExport.cxx | 16
dbaccess/source/filter/xml/xmlfilter.cxx | 5
editeng/source/misc/SvXMLAutoCorrectExport.cxx | 7
filter/Library_svgfilter.mk | 1
filter/Library_xsltfilter.mk | 1
filter/source/svg/svgexport.cxx | 9
filter/source/svg/svgreader.cxx | 4
filter/source/svg/svgwriter.cxx | 6
filter/source/svg/svgwriter.hxx | 1
filter/source/xsltfilter/OleHandler.cxx | 16
filter/source/xsltfilter/OleHandler.hxx | 1
linguistic/source/convdicxml.hxx | 4
mysqlcppconn/mysql_config.pmk | 6
oox/source/xls/pagesettings.cxx | 16
reportdesign/Library_rptxml.mk | 1
reportdesign/source/filter/xml/xmlControlProperty.cxx | 15
reportdesign/source/filter/xml/xmlExport.cxx | 10
reportdesign/source/filter/xml/xmlfilter.cxx | 5
sax/inc/sax/tools/converter.hxx | 23
sax/source/tools/converter.cxx | 365 ++
sc/CppunitTest_sc_filters_test.mk | 1
sc/CppunitTest_sc_ucalc.mk | 1
sc/Library_sc.mk | 1
sc/source/filter/xml/XMLCalculationSettingsContext.cxx | 10
sc/source/filter/xml/XMLCellRangeSourceContext.cxx | 10
sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx | 54
sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx | 4
sc/source/filter/xml/XMLConverter.cxx | 4
sc/source/filter/xml/XMLDDELinksContext.cxx | 16
sc/source/filter/xml/XMLDetectiveContext.cxx | 5
sc/source/filter/xml/XMLExportDDELinks.cxx | 8
sc/source/filter/xml/XMLExportDataPilot.cxx | 11
sc/source/filter/xml/XMLExportDatabaseRanges.cxx | 9
sc/source/filter/xml/XMLTableShapeImportHelper.cxx | 8
sc/source/filter/xml/XMLTableSourceContext.cxx | 4
sc/source/filter/xml/XMLTrackedChangesContext.cxx | 52
sc/source/filter/xml/xmlbodyi.cxx | 5
sc/source/filter/xml/xmlcelli.cxx | 7
sc/source/filter/xml/xmldpimp.cxx | 10
sc/source/filter/xml/xmldrani.cxx | 6
sc/source/filter/xml/xmlexprt.cxx | 62
sc/source/filter/xml/xmlexternaltabi.cxx | 7
sc/source/filter/xml/xmlimprt.cxx | 4
sc/source/filter/xml/xmlsceni.cxx | 7
sc/source/filter/xml/xmlstyle.cxx | 12
sc/source/filter/xml/xmlsubti.cxx | 4
sc/source/ui/view/prevwsh.cxx | 5
sc/source/ui/view/viewdata.cxx | 6
solenv/gbuild/platform/unxgcc.mk | 7
solenv/inc/unxgcc.mk | 5
starmath/source/mathmlexport.cxx | 16
starmath/source/mathmlimport.cxx | 11
svx/Library_svxcore.mk | 1
svx/source/xml/xmlxtexp.cxx | 5
svx/source/xml/xmlxtimp.cxx | 9
sw/CppunitTest_sw_swdoc_test.mk | 1
sw/Library_sw.mk | 1
sw/source/core/swg/SwXMLBlockExport.cxx | 5
sw/source/filter/xml/xmlexp.cxx | 19
sw/source/filter/xml/xmlexpit.cxx | 100
sw/source/filter/xml/xmlimpit.cxx | 52
sw/source/filter/xml/xmliteme.cxx | 7
sw/source/filter/xml/xmlitemi.cxx | 5
sw/source/filter/xml/xmlithlp.cxx | 6
sw/source/filter/xml/xmltble.cxx | 3
sw/source/filter/xml/xmltbli.cxx | 17
sw/source/ui/uiview/view.cxx | 4
xmloff/Library_xo.mk | 2
xmloff/Library_xof.mk | 1
xmloff/inc/xmlehelp.hxx | 53
xmloff/inc/xmloff/VisAreaContext.hxx | 4
xmloff/inc/xmloff/shapeimport.hxx | 6
xmloff/inc/xmloff/xmlexp.hxx | 11
xmloff/inc/xmloff/xmlnumfi.hxx | 2
xmloff/inc/xmloff/xmluconv.hxx | 252 -
xmloff/prj/build.lst | 2
xmloff/source/chart/PropertyMaps.cxx | 27
xmloff/source/chart/SchXMLAxisContext.cxx | 6
xmloff/source/chart/SchXMLCalculationSettingsContext.cxx | 6
xmloff/source/chart/SchXMLChartContext.cxx | 12
xmloff/source/chart/SchXMLExport.cxx | 36
xmloff/source/chart/SchXMLLegendContext.cxx | 12
xmloff/source/chart/SchXMLPlotAreaContext.cxx | 24
xmloff/source/chart/SchXMLTableContext.cxx | 5
xmloff/source/chart/XMLAxisPositionPropertyHdl.cxx | 18
xmloff/source/chart/XMLErrorIndicatorPropertyHdl.cxx | 16
xmloff/source/core/DocumentSettingsContext.cxx | 16
xmloff/source/core/SettingsExportHelper.cxx | 16
xmloff/source/core/XMLBase64Export.cxx | 9
xmloff/source/core/XMLBase64ImportContext.cxx | 12
xmloff/source/core/xmlehelp.cxx | 501 ---
xmloff/source/core/xmlexp.cxx | 28
xmloff/source/core/xmlimp.cxx | 13
xmloff/source/core/xmluconv.cxx | 1546 ----------
xmloff/source/draw/XMLImageMapContext.cxx | 14
xmloff/source/draw/XMLImageMapExport.cxx | 24
xmloff/source/draw/animationexport.cxx | 30
xmloff/source/draw/animationimport.cxx | 23
xmloff/source/draw/animexp.cxx | 14
xmloff/source/draw/animimp.cxx | 11
xmloff/source/draw/eventimp.cxx | 7
xmloff/source/draw/propimp0.cxx | 29
xmloff/source/draw/sdpropls.cxx | 10
xmloff/source/draw/sdxmlexp.cxx | 53
xmloff/source/draw/shapeexport.cxx | 6
xmloff/source/draw/shapeexport2.cxx | 77
xmloff/source/draw/shapeexport3.cxx | 29
xmloff/source/draw/shapeexport4.cxx | 56
xmloff/source/draw/xexptran.cxx | 12
xmloff/source/draw/ximp3dscene.cxx | 25
xmloff/source/draw/ximpcustomshape.cxx | 36
xmloff/source/draw/ximppage.cxx | 18
xmloff/source/draw/ximpshap.cxx | 100
xmloff/source/draw/ximpshow.cxx | 10
xmloff/source/draw/ximpstyl.cxx | 30
xmloff/source/forms/controlpropertyhdl.cxx | 29
xmloff/source/forms/elementexport.cxx | 16
xmloff/source/forms/elementimport.cxx | 69
xmloff/source/forms/formattributes.cxx | 10
xmloff/source/forms/handler/vcl_date_handler.cxx | 11
xmloff/source/forms/handler/vcl_time_handler.cxx | 30
xmloff/source/forms/officeforms.cxx | 20
xmloff/source/forms/propertyexport.cxx | 17
xmloff/source/forms/propertyimport.cxx | 31
xmloff/source/meta/MetaExportComponent.cxx | 3
xmloff/source/meta/xmlmetae.cxx | 21
xmloff/source/meta/xmlversion.cxx | 3
xmloff/source/style/DashStyle.cxx | 34
xmloff/source/style/DrawAspectHdl.cxx | 15
xmloff/source/style/GradientStyle.cxx | 50
xmloff/source/style/HatchStyle.cxx | 22
xmloff/source/style/PageMasterPropHdl.cxx | 8
xmloff/source/style/TransGradientStyle.cxx | 30
xmloff/source/style/VisAreaContext.cxx | 18
xmloff/source/style/XMLBackgroundImageContext.cxx | 11
xmloff/source/style/XMLBackgroundImageExport.cxx | 6
xmloff/source/style/XMLBitmapRepeatOffsetPropertyHandler.cxx | 5
xmloff/source/style/XMLClipPropertyHandler.cxx | 10
xmloff/source/style/XMLFillBitmapSizePropertyHandler.cxx | 16
xmloff/source/style/XMLFootnoteSeparatorExport.cxx | 17
xmloff/source/style/XMLFootnoteSeparatorImport.cxx | 26
xmloff/source/style/XMLPercentOrMeasurePropertyHandler.cxx | 21
xmloff/source/style/XMLRectangleMembersHandler.cxx | 4
xmloff/source/style/backhdl.cxx | 3
xmloff/source/style/bordrhdl.cxx | 30
xmloff/source/style/chrhghdl.cxx | 28
xmloff/source/style/durationhdl.cxx | 15
xmloff/source/style/escphdl.cxx | 16
xmloff/source/style/fonthdl.cxx | 5
xmloff/source/style/kernihdl.cxx | 6
xmloff/source/style/lspachdl.cxx | 18
xmloff/source/style/numehelp.cxx | 5
xmloff/source/style/shadwhdl.cxx | 16
xmloff/source/style/weighhdl.cxx | 9
xmloff/source/style/xmlbahdl.cxx | 104
xmloff/source/style/xmlnume.cxx | 33
xmloff/source/style/xmlnumfe.cxx | 7
xmloff/source/style/xmlnumfi.cxx | 42
xmloff/source/style/xmlnumi.cxx | 37
xmloff/source/style/xmltabe.cxx | 2
xmloff/source/style/xmltabi.cxx | 6
xmloff/source/text/XMLAutoTextEventExport.cxx | 7
xmloff/source/text/XMLCalculationSettingsContext.cxx | 8
xmloff/source/text/XMLChangedRegionImportContext.cxx | 10
xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx | 9
xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx | 23
xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx | 13
xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx | 11
xmloff/source/text/XMLIndexMarkExport.cxx | 4
xmloff/source/text/XMLIndexObjectSourceContext.cxx | 26
xmloff/source/text/XMLIndexSourceBaseContext.cxx | 6
xmloff/source/text/XMLIndexTOCContext.cxx | 7
xmloff/source/text/XMLIndexTOCSourceContext.cxx | 16
xmloff/source/text/XMLIndexTOCStylesContext.cxx | 4
xmloff/source/text/XMLIndexTabStopEntryContext.cxx | 10
xmloff/source/text/XMLIndexTableSourceContext.cxx | 10
xmloff/source/text/XMLIndexUserSourceContext.cxx | 18
xmloff/source/text/XMLLineNumberingExport.cxx | 8
xmloff/source/text/XMLLineNumberingImportContext.cxx | 15
xmloff/source/text/XMLLineNumberingSeparatorImportContext.cxx | 6
xmloff/source/text/XMLRedlineExport.cxx | 7
xmloff/source/text/XMLSectionExport.cxx | 11
xmloff/source/text/XMLSectionFootnoteConfigExport.cxx | 3
xmloff/source/text/XMLSectionFootnoteConfigImport.cxx | 3
xmloff/source/text/XMLSectionImportContext.cxx | 12
xmloff/source/text/XMLSectionSourceDDEImportContext.cxx | 6
xmloff/source/text/XMLTextColumnsContext.cxx | 24
xmloff/source/text/XMLTextColumnsExport.cxx | 20
xmloff/source/text/XMLTextFrameContext.cxx | 65
xmloff/source/text/XMLTextFrameHyperlinkContext.cxx | 9
xmloff/source/text/XMLTextShapeImportHelper.cxx | 7
xmloff/source/text/XMLTrackedChangesImportContext.cxx | 6
xmloff/source/text/txtdrope.cxx | 7
xmloff/source/text/txtdropi.cxx | 14
xmloff/source/text/txtflde.cxx | 10
xmloff/source/text/txtfldi.cxx | 65
xmloff/source/text/txtftne.cxx | 3
xmloff/source/text/txtparae.cxx | 45
xmloff/source/text/txtparai.cxx | 18
xmloff/source/text/txtprhdl.cxx | 16
xmloff/source/text/txtstyli.cxx | 4
xmloff/source/text/txtvfldi.cxx | 18
xmloff/source/transform/OOo2Oasis.cxx | 4
xmloff/source/transform/Oasis2OOo.cxx | 6
xmloff/source/transform/StyleOASISTContext.cxx | 18
xmloff/source/transform/StyleOOoTContext.cxx | 19
xmloff/source/transform/TransformerBase.cxx | 48
xmloff/source/xforms/SchemaRestrictionContext.cxx | 25
xmloff/source/xforms/XFormsSubmissionContext.cxx | 7
xmloff/source/xforms/xformsexport.cxx | 24
xmlsecurity/Library_xmlsecurity.mk | 1
xmlsecurity/source/component/documentdigitalsignatures.cxx | 4
xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 5
219 files changed, 2537 insertions(+), 3564 deletions(-)
New commits:
commit d3d533c9e45b6badf202a12f0ed266d0168aa636
Author: Michael Stahl <mst at openoffice.org>
Date: Tue Oct 11 14:19:11 2011 +0200
mysqlcppconn: work around weird gcc issue
diff --git a/mysqlcppconn/mysql_config.pmk b/mysqlcppconn/mysql_config.pmk
index eb316e0..9c9c76a 100644
--- a/mysqlcppconn/mysql_config.pmk
+++ b/mysqlcppconn/mysql_config.pmk
@@ -47,3 +47,9 @@ CFLAGS+=-DCPPDBC_WIN32 -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS
CFLAGS+=-I$(PRJINC) -I$(PRJINC)$/cppconn $(MYSQL_INC) -DCPPCONN_LIB_BUILD
+# workaround for gcc bug (4.6.1 20110908):
+# it complains about std::basic string operator= overloading ambiguity
+.IF "$(COM)"=="GCC"
+CFLAGSCXX+=-std=c++98
+.ENDIF # "$(COM)"=="GCC"
+
commit 30e1eaabc4917641943a8fa2befca208d857a14a
Author: Michael Stahl <mst at openoffice.org>
Date: Tue Oct 11 14:19:10 2011 +0200
#i108468#: clean up xmluconv: add a pImpl to SvXMLUnitConverter
diff --git a/xmloff/inc/xmloff/xmluconv.hxx b/xmloff/inc/xmloff/xmluconv.hxx
index 9fc5364..a5064fd 100644
--- a/xmloff/inc/xmloff/xmluconv.hxx
+++ b/xmloff/inc/xmloff/xmluconv.hxx
@@ -33,6 +33,7 @@
#include "xmloff/dllapi.h"
#include "sal/types.h"
+#include <memory>
#include <limits.h>
#include <tools/solar.h>
#include <xmloff/xmlement.hxx>
@@ -58,7 +59,6 @@ class OUStringBuffer;
namespace com { namespace sun { namespace star {
namespace util { struct DateTime; }
namespace text { class XNumberingTypeInfo; }
- namespace i18n { class XCharacterClassification; }
}}}
namespace basegfx
@@ -92,17 +92,8 @@ public:
class XMLOFF_DLLPUBLIC SvXMLUnitConverter
{
private:
- sal_Int16 meCoreMeasureUnit;
- sal_Int16 meXMLMeasureUnit;
- com::sun::star::util::Date aNullDate;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::text::XNumberingTypeInfo > xNumTypeInfo;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::i18n::XCharacterClassification > xCharClass;
- // #110680#
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxServiceFactory;
-
- SAL_DLLPRIVATE void createNumTypeInfo() const;
+ struct Impl;
+ ::std::auto_ptr<Impl> m_pImpl;
public:
/** constructs a SvXMLUnitConverter. The core measure unit is the
@@ -119,10 +110,10 @@ public:
static sal_Int16 GetMeasureUnit(sal_Int16 const nFieldUnit);
/** sets the default unit for numerical measures */
- inline void SetCoreMeasureUnit( sal_Int16 const eCoreMeasureUnit );
+ void SetCoreMeasureUnit( sal_Int16 const eCoreMeasureUnit );
/** gets the default unit for numerical measures */
- inline sal_Int16 GetCoreMeasureUnit() const;
+ sal_Int16 GetCoreMeasureUnit() const;
/** sets the default unit for textual measures */
void SetXMLMeasureUnit( sal_Int16 const eXMLMeasureUnit );
@@ -132,12 +123,7 @@ public:
/** gets XNumberingTypeInfo */
const ::com::sun::star::uno::Reference<
- ::com::sun::star::text::XNumberingTypeInfo >& getNumTypeInfo() const
- {
- if( !xNumTypeInfo.is() )
- createNumTypeInfo();
- return xNumTypeInfo;
- }
+ ::com::sun::star::text::XNumberingTypeInfo >& getNumTypeInfo() const;
/** convert string to measure with meCoreMeasureUnit,
using optional min and max values*/
@@ -201,16 +187,16 @@ public:
const com::sun::star::uno::Reference <com::sun::star::frame::XModel>& xModel);
/** Set the Null Date of the UnitConverter */
- void setNullDate ( const com::sun::star::util::Date& aTempNullDate ) { aNullDate = aTempNullDate; }
+ void setNullDate ( const com::sun::star::util::Date& aTempNullDate );
/** convert double to ISO Date Time String */
void convertDateTime( ::rtl::OUStringBuffer& rBuffer,
const double& fDateTime,
- sal_Bool bAddTimeIf0AM=sal_False) { convertDateTime(rBuffer, fDateTime, aNullDate, bAddTimeIf0AM); }
+ bool const bAddTimeIf0AM = false);
/** convert ISO Date Time String to double */
- sal_Bool convertDateTime( double& fDateTime,
- const ::rtl::OUString& rString) { return convertDateTime(fDateTime, rString, aNullDate); }
+ bool convertDateTime(double& fDateTime,
+ const ::rtl::OUString& rString);
/// these 2 functions use tools Date, so they're not yet moved to sax
@@ -264,28 +250,6 @@ public:
};
-inline void
-SvXMLUnitConverter::SetCoreMeasureUnit( sal_Int16 const eCoreMeasureUnit )
-{
- meCoreMeasureUnit = eCoreMeasureUnit;
-}
-
-inline sal_Int16 SvXMLUnitConverter::GetCoreMeasureUnit() const
-{
- return meCoreMeasureUnit;
-}
-
-inline void
-SvXMLUnitConverter::SetXMLMeasureUnit( sal_Int16 const eXMLMeasureUnit )
-{
- meXMLMeasureUnit = eXMLMeasureUnit;
-}
-
-inline sal_Int16 SvXMLUnitConverter::GetXMLMeasureUnit() const
-{
- return meXMLMeasureUnit;
-}
-
#endif // _XMLOFF_XMLUCONV_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/core/xmluconv.cxx b/xmloff/source/core/xmluconv.cxx
index 23a61a4..97c8c9b 100644
--- a/xmloff/source/core/xmluconv.cxx
+++ b/xmloff/source/core/xmluconv.cxx
@@ -69,17 +69,71 @@ const sal_Int8 XML_MAXDIGITSCOUNT_TIME = 11;
const sal_Int8 XML_MAXDIGITSCOUNT_DATETIME = 6;
#define XML_NULLDATE "NullDate"
-void SvXMLUnitConverter::createNumTypeInfo() const
+struct SvXMLUnitConverter::Impl
{
- if( mxServiceFactory.is() )
+ sal_Int16 m_eCoreMeasureUnit;
+ sal_Int16 m_eXMLMeasureUnit;
+ util::Date m_aNullDate;
+ uno::Reference< text::XNumberingTypeInfo > m_xNumTypeInfo;
+ uno::Reference< i18n::XCharacterClassification > m_xCharClass;
+ uno::Reference< lang::XMultiServiceFactory > m_xServiceFactory;
+
+ Impl(uno::Reference<lang::XMultiServiceFactory> const& xServiceFactory,
+ sal_Int16 const eCoreMeasureUnit,
+ sal_Int16 const eXMLMeasureUnit)
+ : m_eCoreMeasureUnit(eCoreMeasureUnit)
+ , m_eXMLMeasureUnit(eXMLMeasureUnit)
+ , m_aNullDate(30, 12, 1899)
+ , m_xServiceFactory(xServiceFactory)
{
- ((SvXMLUnitConverter *)this)->xNumTypeInfo =
+ OSL_ENSURE( m_xServiceFactory.is(), "got no service manager" );
+ }
+
+ void createNumTypeInfo() const;
+};
+
+
+void SvXMLUnitConverter::Impl::createNumTypeInfo() const
+{
+ if (m_xServiceFactory.is())
+ {
+ const_cast<Impl*>(this)->m_xNumTypeInfo =
Reference < XNumberingTypeInfo > (
- mxServiceFactory->createInstance(
+ m_xServiceFactory->createInstance(
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.DefaultNumberingProvider") ) ), UNO_QUERY );
}
}
+const uno::Reference< text::XNumberingTypeInfo >&
+SvXMLUnitConverter::getNumTypeInfo() const
+{
+ if (!m_pImpl->m_xNumTypeInfo.is())
+ {
+ m_pImpl->createNumTypeInfo();
+ }
+ return m_pImpl->m_xNumTypeInfo;
+}
+
+void SvXMLUnitConverter::SetCoreMeasureUnit(sal_Int16 const eCoreMeasureUnit)
+{
+ m_pImpl->m_eCoreMeasureUnit = eCoreMeasureUnit;
+}
+
+sal_Int16 SvXMLUnitConverter::GetCoreMeasureUnit() const
+{
+ return m_pImpl->m_eCoreMeasureUnit;
+}
+
+void SvXMLUnitConverter::SetXMLMeasureUnit(sal_Int16 const eXMLMeasureUnit)
+{
+ m_pImpl->m_eXMLMeasureUnit = eXMLMeasureUnit;
+}
+
+sal_Int16 SvXMLUnitConverter::GetXMLMeasureUnit() const
+{
+ return m_pImpl->m_eXMLMeasureUnit;
+}
+
/** constructs a SvXMLUnitConverter. The core measure unit is the
default unit for numerical measures, the XML measure unit is
the default unit for textual measures
@@ -89,14 +143,8 @@ SvXMLUnitConverter::SvXMLUnitConverter(
const uno::Reference<lang::XMultiServiceFactory>& xServiceFactory,
sal_Int16 const eCoreMeasureUnit,
sal_Int16 const eXMLMeasureUnit)
-:
- aNullDate(30, 12, 1899),
- mxServiceFactory( xServiceFactory )
+: m_pImpl(new Impl(xServiceFactory, eCoreMeasureUnit, eXMLMeasureUnit))
{
- DBG_ASSERT( mxServiceFactory.is(), "got no service manager" );
-
- meCoreMeasureUnit = eCoreMeasureUnit;
- meXMLMeasureUnit = eXMLMeasureUnit;
}
SvXMLUnitConverter::~SvXMLUnitConverter()
@@ -136,7 +184,7 @@ bool SvXMLUnitConverter::convertMeasureToCore( sal_Int32& nValue,
sal_Int32 nMin, sal_Int32 nMax ) const
{
return ::sax::Converter::convertMeasure( nValue, rString,
- meCoreMeasureUnit,
+ m_pImpl->m_eCoreMeasureUnit,
nMin, nMax );
}
@@ -145,8 +193,8 @@ void SvXMLUnitConverter::convertMeasureToXML( OUStringBuffer& rString,
sal_Int32 nMeasure ) const
{
::sax::Converter::convertMeasure( rString, nMeasure,
- meCoreMeasureUnit,
- meXMLMeasureUnit );
+ m_pImpl->m_eCoreMeasureUnit,
+ m_pImpl->m_eXMLMeasureUnit );
}
/** convert measure with given unit to string */
@@ -156,7 +204,7 @@ void SvXMLUnitConverter::convertMeasureToXML( OUStringBuffer& rString,
{
::sax::Converter::convertMeasure( rString, nMeasure,
eSrcUnit,
- meXMLMeasureUnit );
+ m_pImpl->m_eXMLMeasureUnit );
}
/** convert string to enum using given enum map, if the enum is
@@ -281,7 +329,7 @@ void SvXMLUnitConverter::convertDouble(OUStringBuffer& rBuffer,
double fNumber, sal_Bool bWriteUnits) const
{
::sax::Converter::convertDouble(rBuffer, fNumber,
- bWriteUnits, meCoreMeasureUnit, meXMLMeasureUnit);
+ bWriteUnits, m_pImpl->m_eCoreMeasureUnit, m_pImpl->m_eXMLMeasureUnit);
}
/** convert string to double number (using ::rtl::math) */
@@ -290,11 +338,11 @@ sal_Bool SvXMLUnitConverter::convertDouble(double& rValue,
{
if(bLookForUnits)
{
- sal_Int16 const eSrcUnit =
- ::sax::Converter::GetUnitFromString(rString, meCoreMeasureUnit);
+ sal_Int16 const eSrcUnit = ::sax::Converter::GetUnitFromString(
+ rString, m_pImpl->m_eCoreMeasureUnit);
return ::sax::Converter::convertDouble(rValue, rString,
- eSrcUnit, meCoreMeasureUnit);
+ eSrcUnit, m_pImpl->m_eCoreMeasureUnit);
}
else
{
@@ -309,11 +357,28 @@ sal_Bool SvXMLUnitConverter::setNullDate(const com::sun::star::uno::Reference <c
if (xNumberFormatsSupplier.is())
{
const com::sun::star::uno::Reference <com::sun::star::beans::XPropertySet> xPropertySet = xNumberFormatsSupplier->getNumberFormatSettings();
- return xPropertySet.is() && (xPropertySet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM(XML_NULLDATE))) >>= aNullDate);
+ return xPropertySet.is() && (xPropertySet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(XML_NULLDATE))) >>= m_pImpl->m_aNullDate);
}
return sal_False;
}
+void SvXMLUnitConverter::setNullDate(const util::Date& aTempNullDate)
+ { m_pImpl->m_aNullDate = aTempNullDate; }
+
+/** convert double to ISO Date Time String */
+void SvXMLUnitConverter::convertDateTime(::rtl::OUStringBuffer& rBuffer,
+ const double& fDateTime, bool const bAddTimeIf0AM)
+{
+ convertDateTime(rBuffer, fDateTime, m_pImpl->m_aNullDate, bAddTimeIf0AM);
+}
+
+/** convert ISO Date Time String to double */
+bool SvXMLUnitConverter::convertDateTime(double& fDateTime,
+ const ::rtl::OUString& rString)
+{
+ return convertDateTime(fDateTime, rString, m_pImpl->m_aNullDate);
+}
+
/** convert double to ISO Date Time String */
void SvXMLUnitConverter::convertDateTime( OUStringBuffer& rBuffer,
const double& fDateTime,
@@ -782,21 +847,21 @@ OUString SvXMLUnitConverter::encodeStyleName(
}
else
{
- if( !xCharClass.is() )
+ if (!m_pImpl->m_xCharClass.is())
{
- if( mxServiceFactory.is() )
+ if (m_pImpl->m_xServiceFactory.is())
{
try
{
const_cast < SvXMLUnitConverter * >(this)
- ->xCharClass =
+ ->m_pImpl->m_xCharClass =
Reference < XCharacterClassification >(
- mxServiceFactory->createInstance(
+ m_pImpl->m_xServiceFactory->createInstance(
OUString(RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.i18n.CharacterClassification_Unicode")) ),
UNO_QUERY );
- OSL_ENSURE( xCharClass.is(),
+ OSL_ENSURE( m_pImpl->m_xCharClass.is(),
"can't instantiate character clossification component" );
}
catch( com::sun::star::uno::Exception& )
@@ -804,9 +869,9 @@ OUString SvXMLUnitConverter::encodeStyleName(
}
}
}
- if( xCharClass.is() )
+ if (m_pImpl->m_xCharClass.is())
{
- sal_Int16 nType = xCharClass->getType( rName, i );
+ sal_Int16 nType = m_pImpl->m_xCharClass->getType(rName, i);
switch( nType )
{
commit 8666469d7b0f450ec1448f80eda3c591f8d8d318
Author: Michael Stahl <mst at openoffice.org>
Date: Tue Oct 11 14:19:09 2011 +0200
#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 :)
diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx
index 10bc983..661e237 100644
--- a/dbaccess/source/filter/xml/xmlExport.cxx
+++ b/dbaccess/source/filter/xml/xmlExport.cxx
@@ -205,12 +205,13 @@ namespace dbaxml
};
// -----------------------------------------------------------------------------
ODBExport::ODBExport(const Reference< XMultiServiceFactory >& _rxMSF,sal_uInt16 nExportFlag)
-: SvXMLExport( _rxMSF,MAP_10TH_MM,XML_DATABASE, EXPORT_OASIS | nExportFlag)
+: SvXMLExport( util::MeasureUnit::MM_10TH, _rxMSF, XML_DATABASE,
+ EXPORT_OASIS | nExportFlag)
,m_aTypeCollection(_rxMSF)
,m_bAllreadyFilled(sal_False)
{
- GetMM100UnitConverter().setCoreMeasureUnit(MAP_10TH_MM);
- GetMM100UnitConverter().setXMLMeasureUnit(MAP_CM);
+ GetMM100UnitConverter().SetCoreMeasureUnit(util::MeasureUnit::MM_10TH);
+ GetMM100UnitConverter().SetXMLMeasureUnit(util::MeasureUnit::CM);
_GetNamespaceMap().Add( GetXMLToken(XML_NP_OFFICE), GetXMLToken(XML_N_OFFICE), XML_NAMESPACE_OFFICE );
_GetNamespaceMap().Add( GetXMLToken(XML_NP_OOO), GetXMLToken(XML_N_OOO), XML_NAMESPACE_OOO );
diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx
index 78074ba..8e6f01c 100644
--- a/dbaccess/source/filter/xml/xmlfilter.cxx
+++ b/dbaccess/source/filter/xml/xmlfilter.cxx
@@ -29,6 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_dbaccess.hxx"
+#include <com/sun/star/util/MeasureUnit.hpp>
#include <com/sun/star/packages/zip/ZipIOException.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp>
@@ -381,8 +382,8 @@ ODBFilter::ODBFilter( const uno::Reference< XMultiServiceFactory >& _rxMSF )
{
DBG_CTOR(ODBFilter,NULL);
- GetMM100UnitConverter().setCoreMeasureUnit(MAP_10TH_MM);
- GetMM100UnitConverter().setXMLMeasureUnit(MAP_CM);
+ GetMM100UnitConverter().SetCoreMeasureUnit(util::MeasureUnit::MM_10TH);
+ GetMM100UnitConverter().SetXMLMeasureUnit(util::MeasureUnit::CM);
GetNamespaceMap().Add( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__db) ),
GetXMLToken(XML_N_DB),
XML_NAMESPACE_DB );
diff --git a/editeng/source/misc/SvXMLAutoCorrectExport.cxx b/editeng/source/misc/SvXMLAutoCorrectExport.cxx
index 2b01f03..050504e 100644
--- a/editeng/source/misc/SvXMLAutoCorrectExport.cxx
+++ b/editeng/source/misc/SvXMLAutoCorrectExport.cxx
@@ -28,7 +28,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_editeng.hxx"
+
#include <SvXMLAutoCorrectExport.hxx>
+
+#include <com/sun/star/util/MeasureUnit.hpp>
#define _SVSTDARR_STRINGSISORTDTOR
#define _SVSTDARR_STRINGSDTOR
#include <svl/svstdarr.hxx>
@@ -44,7 +47,7 @@ SvXMLAutoCorrectExport::SvXMLAutoCorrectExport(
const SvxAutocorrWordList * pNewAutocorr_List,
const rtl::OUString &rFileName,
com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler> &rHandler)
-: SvXMLExport( xServiceFactory, rFileName, rHandler ),
+: SvXMLExport( xServiceFactory, rFileName, util::MeasureUnit::CM, rHandler ),
pAutocorr_List( pNewAutocorr_List )
{
_GetNamespaceMap().Add( GetXMLToken ( XML_NP_BLOCK_LIST),
@@ -87,7 +90,7 @@ SvXMLExceptionListExport::SvXMLExceptionListExport(
const SvStringsISortDtor &rNewList,
const rtl::OUString &rFileName,
com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler> &rHandler)
-: SvXMLExport( xServiceFactory, rFileName, rHandler ),
+: SvXMLExport( xServiceFactory, rFileName, util::MeasureUnit::CM, rHandler ),
rList( rNewList )
{
_GetNamespaceMap().Add( GetXMLToken ( XML_NP_BLOCK_LIST ),
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 9357a36..c87d443 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -37,6 +37,8 @@
#include "svgscript.hxx"
#include "impsvgdialog.hxx"
+#include <com/sun/star/util/MeasureUnit.hpp>
+
#include <svtools/miscopt.hxx>
#include <svtools/FilterConfigItem.hxx>
#include <svx/unopage.hxx>
@@ -57,6 +59,7 @@
using ::rtl::OUString;
+using namespace ::com::sun::star;
@@ -326,9 +329,9 @@ sal_Bool operator==( const TextField & aLhsTextField, const TextField & aRhsText
SVGExport::SVGExport(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory,
const Reference< XDocumentHandler >& rxHandler,
- const Sequence< PropertyValue >& rFilterData ) :
- SvXMLExport( xServiceFactory, MAP_100TH_MM ),
- mrFilterData( rFilterData )
+ const Sequence< PropertyValue >& rFilterData )
+ : SvXMLExport( util::MeasureUnit::MM_100TH, xServiceFactory )
+ , mrFilterData( rFilterData )
{
SetDocHandler( rxHandler );
sal_uInt16 nExportFlags = getExportFlags() | EXPORT_PRETTY;
diff --git a/linguistic/source/convdicxml.hxx b/linguistic/source/convdicxml.hxx
index c93965d..998b40a 100644
--- a/linguistic/source/convdicxml.hxx
+++ b/linguistic/source/convdicxml.hxx
@@ -31,6 +31,7 @@
#include <com/sun/star/linguistic2/XConversionDictionary.hpp>
#include <com/sun/star/util/XFlushable.hpp>
+#include <com/sun/star/util/MeasureUnit.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <xmloff/xmlexp.hxx>
@@ -55,7 +56,8 @@ public:
ConvDicXMLExport( ConvDic &rConvDic,
const rtl::OUString &rFileName,
com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler > &rHandler) :
- SvXMLExport ( utl::getProcessServiceFactory(), rFileName, rHandler ),
+ SvXMLExport ( utl::getProcessServiceFactory(), rFileName,
+ ::com::sun::star::util::MeasureUnit::CM, rHandler ),
rDic ( rConvDic ),
bSuccess ( sal_False )
{
diff --git a/oox/source/xls/pagesettings.cxx b/oox/source/xls/pagesettings.cxx
index 9082c73..c3cd279 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 );
diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx
index 6bace82..cbebd7a 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 bcf6289..ee31100 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 );
diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx
index aff5ead..092e82d 100644
--- a/sax/source/tools/converter.cxx
+++ b/sax/source/tools/converter.cxx
@@ -271,12 +271,6 @@ void Converter::convertMeasure( OUStringBuffer& rBuffer,
sal_Int16 nSourceUnit /* = MeasureUnit::MM_100TH */,
sal_Int16 nTargetUnit /* = MeasureUnit::INCH */ )
{
- OSL_FAIL( "Converter::convertMeasure - not implemented, tools/BigInt needs replacement" );
- (void)rBuffer;
- (void)nMeasure;
- (void)nSourceUnit;
- (void)nTargetUnit;
-#if 0
if( nSourceUnit == MeasureUnit::PERCENT )
{
OSL_ENSURE( nTargetUnit == MeasureUnit::PERCENT,
@@ -284,9 +278,9 @@ void Converter::convertMeasure( OUStringBuffer& rBuffer,
rBuffer.append( nMeasure );
rBuffer.append( sal_Unicode('%' ) );
+
+ return;
}
- else
- {
// the sign is processed seperatly
if( nMeasure < 0 )
{
@@ -400,69 +394,31 @@ void Converter::convertMeasure( OUStringBuffer& rBuffer,
}
break;
}
+ default:
+ OSL_ENSURE(false, "sax::Converter::convertMeasure(): "
+ "source unit not supported");
+ break;
}
- long nLongVal = 0;
- bool bOutLongVal = true;
- if( nMeasure > SAL_INT32_MAX / nMul )
- {
- // A big int is required for calculation
- BigInt nBigVal( nMeasure );
- BigInt nBigFac( nFac );
- nBigVal *= nMul;
- nBigVal /= nDiv;
- nBigVal += 5;
- nBigVal /= 10;
-
- if( nBigVal.IsLong() )
- {
- // To convert the value into a string a long is sufficient
- nLongVal = (long)nBigVal;
- }
- else
- {
- BigInt nBigFac2( nFac );
- BigInt nBig10( 10 );
- rBuffer.append( (sal_Int32)(nBigVal / nBigFac2) );
- if( !(nBigVal % nBigFac2).IsZero() )
- {
- rBuffer.append( sal_Unicode('.') );
- while( nFac > 1 && !(nBigVal % nBigFac2).IsZero() )
- {
- nFac /= 10;
- nBigFac2 = nFac;
- rBuffer.append( (sal_Int32)((nBigVal / nBigFac2) % nBig10 ) );
- }
- }
- bOutLongVal = false;
- }
- }
- else
- {
- nLongVal = nMeasure * nMul;
- nLongVal /= nDiv;
- nLongVal += 5;
- nLongVal /= 10;
- }
+ OSL_ENSURE(nMeasure <= SAL_MAX_INT64 / nMul, "convertMeasure: overflow");
+ sal_Int64 nValue = nMeasure * nMul;
+ nValue /= nDiv;
+ nValue += 5;
+ nValue /= 10;
- if( bOutLongVal )
+ rBuffer.append( static_cast<sal_Int64>(nValue / nFac) );
+ if (nFac > 1 && (nValue % nFac) != 0)
{
- rBuffer.append( (sal_Int32)(nLongVal / nFac) );
- if( nFac > 1 && (nLongVal % nFac) != 0 )
+ rBuffer.append( sal_Unicode('.') );
+ while (nFac > 1 && (nValue % nFac) != 0)
{
- rBuffer.append( sal_Unicode('.') );
- while( nFac > 1 && (nLongVal % nFac) != 0 )
- {
- nFac /= 10;
- rBuffer.append( (sal_Int32)((nLongVal / nFac) % 10) );
- }
+ nFac /= 10;
+ rBuffer.append( static_cast<sal_Int32>((nValue / nFac) % 10) );
}
}
if( psUnit )
rBuffer.appendAscii( psUnit );
- }
-#endif
}
static const OUString& getTrueString()
@@ -2009,6 +1965,10 @@ double Converter::GetConversionFactor(::rtl::OUStringBuffer& rUnit, sal_Int16 nS
}
break;
}
+ default:
+ OSL_ENSURE(false, "sax::Converter::GetConversionFactor(): "
+ "source unit not supported");
+ break;
}
if( psUnit )
diff --git a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx
index 27c9cb7..a523f6f 100644
--- a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx
+++ b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx
@@ -121,12 +121,16 @@ void XMLTableShapeImportHelper::finishShape(
}
else if (IsXMLToken(aLocalName, XML_END_X))
{
- static_cast<ScXMLImport&>(mrImporter).GetMM100UnitConverter().convertMeasure(nEndX, rValue);
+ static_cast<ScXMLImport&>(mrImporter).
+ GetMM100UnitConverter().convertMeasureToCore(
+ nEndX, rValue);
aAnchor.maEndOffset.X() = nEndX;
}
else if (IsXMLToken(aLocalName, XML_END_Y))
{
- static_cast<ScXMLImport&>(mrImporter).GetMM100UnitConverter().convertMeasure(nEndY, rValue);
+ static_cast<ScXMLImport&>(mrImporter).
+ GetMM100UnitConverter().convertMeasureToCore(
+ nEndY, rValue);
aAnchor.maEndOffset.Y() = nEndY;
}
else if (IsXMLToken(aLocalName, XML_TABLE_BACKGROUND))
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index cf0e55c..4f8ca89 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -452,7 +452,8 @@ sal_Int16 ScXMLExport::GetFieldUnit()
ScXMLExport::ScXMLExport(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory,
const sal_uInt16 nExportFlag)
-: SvXMLExport( xServiceFactory, SvXMLUnitConverter::GetMapUnit(GetFieldUnit()), XML_SPREADSHEET, nExportFlag ),
+: SvXMLExport( SvXMLUnitConverter::GetMeasureUnit(GetFieldUnit()),
+ xServiceFactory, XML_SPREADSHEET, nExportFlag ),
pDoc(NULL),
nSourceStreamPos(0),
pNumberFormatAttributesExportHelper(NULL),
@@ -3149,9 +3150,11 @@ void ScXMLExport::WriteShapes(const ScMyCell& rMyCell)
ScRangeStringConverter::GetStringFromAddress(sEndAddress, aItr->aEndAddress, pDoc, FormulaGrammar::CONV_OOO);
AddAttribute(XML_NAMESPACE_TABLE, XML_END_CELL_ADDRESS, sEndAddress);
rtl::OUStringBuffer sBuffer;
- GetMM100UnitConverter().convertMeasure(sBuffer, aItr->nEndX);
+ GetMM100UnitConverter().convertMeasureToXML(
+ sBuffer, aItr->nEndX);
AddAttribute(XML_NAMESPACE_TABLE, XML_END_X, sBuffer.makeStringAndClear());
- GetMM100UnitConverter().convertMeasure(sBuffer, aItr->nEndY);
+ GetMM100UnitConverter().convertMeasureToXML(
+ sBuffer, aItr->nEndY);
AddAttribute(XML_NAMESPACE_TABLE, XML_END_Y, sBuffer.makeStringAndClear());
}
ExportShape(aItr->xShape, &aPoint);
diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx
index 93c75f8..869fd0f 100644
--- a/starmath/source/mathmlexport.cxx
+++ b/starmath/source/mathmlexport.cxx
@@ -51,6 +51,7 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
+#include <com/sun/star/util/MeasureUnit.hpp>
#include <com/sun/star/uno/Any.h>
#include <rtl/math.hxx>
@@ -391,8 +392,9 @@ sal_Bool SmXMLExportWrapper::WriteThroughComponent(
SmXMLExport::SmXMLExport(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory,
sal_uInt16 nExportFlags)
-: SvXMLExport( xServiceFactory, MAP_INCH, XML_MATH, nExportFlags ) ,
- pTree(0) ,
+: SvXMLExport(util::MeasureUnit::INCH, xServiceFactory, XML_MATH,
+ nExportFlags)
+, pTree(0) ,
bSuccess(sal_False)
{
}
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index eb0b0e3..f354785 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -698,7 +698,7 @@ void SmXMLContext_Helper::RetrieveAttrs(const uno::Reference<
case XML_TOK_FONTSIZE:
::sax::Converter::convertDouble(nFontSize, sValue);
rContext.GetSmImport().GetMM100UnitConverter().
- setXMLMeasureUnit(MAP_POINT);
+ SetXMLMeasureUnit(util::MeasureUnit::POINT);
if (-1 == sValue.indexOf(GetXMLToken(XML_UNIT_PT)))
{
if (-1 == sValue.indexOf('%'))
@@ -706,7 +706,7 @@ void SmXMLContext_Helper::RetrieveAttrs(const uno::Reference<
else
{
rContext.GetSmImport().GetMM100UnitConverter().
- setXMLMeasureUnit(MAP_RELATIVE);
+ SetXMLMeasureUnit(util::MeasureUnit::PERCENT);
}
}
break;
@@ -767,8 +767,8 @@ void SmXMLContext_Helper::ApplyAttrs()
aToken.eType = TSIZE;
SmFontNode *pFontNode = new SmFontNode(aToken);
- if (MAP_RELATIVE == rContext.GetSmImport().GetMM100UnitConverter().
- getXMLMeasureUnit())
+ if (util::MeasureUnit::PERCENT == rContext.GetSmImport()
+ .GetMM100UnitConverter().GetXMLMeasureUnit())
{
if (nFontSize < 100.00)
pFontNode->SetSizeParameter(Fraction(100.00/nFontSize),
diff --git a/sw/source/core/swg/SwXMLBlockExport.cxx b/sw/source/core/swg/SwXMLBlockExport.cxx
index 848bd6c..6164407 100644
--- a/sw/source/core/swg/SwXMLBlockExport.cxx
+++ b/sw/source/core/swg/SwXMLBlockExport.cxx
@@ -30,6 +30,7 @@
#include "precompiled_sw.hxx"
#include <SwXMLBlockExport.hxx>
#include <SwXMLTextBlocks.hxx>
+#include <com/sun/star/util/MeasureUnit.hpp>
#include <xmloff/nmspmap.hxx>
#include <xmloff/xmlnmspe.hxx>
using namespace ::com::sun::star::uno;
@@ -43,7 +44,7 @@ SwXMLBlockListExport::SwXMLBlockListExport(
SwXMLTextBlocks & rBlocks,
const rtl::OUString &rFileName,
uno::Reference< xml::sax::XDocumentHandler> &rHandler)
-: SvXMLExport( xServiceFactory, rFileName, rHandler ),
+: SvXMLExport( xServiceFactory, rFileName, util::MeasureUnit::CM, rHandler ),
rBlockList(rBlocks)
{
_GetNamespaceMap().Add( GetXMLToken ( XML_NP_BLOCK_LIST ),
@@ -94,7 +95,7 @@ SwXMLTextBlockExport::SwXMLTextBlockExport(
SwXMLTextBlocks & rBlocks,
const rtl::OUString &rFileName,
uno::Reference< xml::sax::XDocumentHandler> &rHandler)
-: SvXMLExport( xServiceFactory, rFileName, rHandler ),
+: SvXMLExport( xServiceFactory, rFileName, util::MeasureUnit::CM, rHandler ),
rBlockList(rBlocks)
{
_GetNamespaceMap().Add( GetXMLToken ( XML_NP_BLOCK_LIST ),
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 520aa17..f03a7b3 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -130,7 +130,8 @@ void SwXMLExport::SetCurPaM( SwPaM& rPaM, sal_Bool bWhole, sal_Bool bTabOnly )
SwXMLExport::SwXMLExport(
const uno::Reference< lang::XMultiServiceFactory > xServiceFactory,
sal_uInt16 nExportFlags)
-: SvXMLExport( xServiceFactory, MAP_INCH, XML_TEXT, nExportFlags ),
+: SvXMLExport( util::MeasureUnit::INCH, xServiceFactory, XML_TEXT,
+ nExportFlags ),
#ifdef XML_CORE_API
pCurPaM( 0 ),
pOrigPaM( &rPaM ),
@@ -271,12 +272,12 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass )
}
}
- MapUnit eUnit =
- SvXMLUnitConverter::GetMapUnit( SW_MOD()->GetMetric(pDoc->get(IDocumentSettingAccess::HTML_MODE)) );
- if( GetMM100UnitConverter().getXMLMeasureUnit() != eUnit )
+ sal_uInt16 const eUnit = SvXMLUnitConverter::GetMeasureUnit(
+ SW_MOD()->GetMetric(pDoc->get(IDocumentSettingAccess::HTML_MODE)));
+ if (GetMM100UnitConverter().GetXMLMeasureUnit() != eUnit )
{
- GetMM100UnitConverter().setXMLMeasureUnit( eUnit );
- pTwipUnitConv->setXMLMeasureUnit( eUnit );
+ GetMM100UnitConverter().SetXMLMeasureUnit( eUnit );
+ pTwipUnitConv->SetXMLMeasureUnit( eUnit );
}
SetExtended( bExtended );
diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx
index 065571a..7404306 100644
--- a/sw/source/filter/xml/xmlexpit.cxx
+++ b/sw/source/filter/xml/xmlexpit.cxx
@@ -419,7 +419,10 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
aOut, pLRSpace->GetPropLeft() );
}
else
- rUnitConverter.convertMeasure( aOut, pLRSpace->GetLeft() );
+ {
+ rUnitConverter.convertMeasureToXML(
+ aOut, pLRSpace->GetLeft() );
+ }
break;
case MID_R_MARGIN:
@@ -429,7 +432,10 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
aOut, pLRSpace->GetPropRight() );
}
else
- rUnitConverter.convertMeasure( aOut, pLRSpace->GetRight() );
+ {
+ rUnitConverter.convertMeasureToXML(
+ aOut, pLRSpace->GetRight() );
+ }
break;
case MID_FIRST_AUTO:
@@ -451,7 +457,10 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
aOut, pLRSpace->GetPropTxtFirstLineOfst() );
}
else
- rUnitConverter.convertMeasure( aOut, pLRSpace->GetTxtFirstLineOfst() );
+ {
+ rUnitConverter.convertMeasureToXML(
+ aOut, pLRSpace->GetTxtFirstLineOfst() );
+ }
}
else
bOk = sal_False;
@@ -479,7 +488,10 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
aOut, pULSpace->GetPropUpper() );
}
else
- rUnitConverter.convertMeasure( aOut, pULSpace->GetUpper() );
+ {
+ rUnitConverter.convertMeasureToXML(
+ aOut, pULSpace->GetUpper() );
+ }
break;
case MID_LO_MARGIN:
@@ -489,7 +501,10 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
aOut, pULSpace->GetPropLower() );
}
else
- rUnitConverter.convertMeasure( aOut, pULSpace->GetLower() );
+ {
+ rUnitConverter.convertMeasureToXML(
+ aOut, pULSpace->GetLower() );
+ }
break;
default:
@@ -531,9 +546,9 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
::sax::Converter::convertColor(aOut, pShadow->GetColor().GetColor());
aOut.append( sal_Unicode(' ') );
- rUnitConverter.convertMeasure( aOut, nX );
+ rUnitConverter.convertMeasureToXML( aOut, nX );
aOut.append( sal_Unicode(' ') );
- rUnitConverter.convertMeasure( aOut, nY );
+ rUnitConverter.convertMeasureToXML( aOut, nY );
bOk = sal_True;
}
@@ -692,16 +707,16 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
// padding
case ALL_BORDER_PADDING:
case LEFT_BORDER_PADDING:
- rUnitConverter.convertMeasure( aOut, nLeftDist );
+ rUnitConverter.convertMeasureToXML( aOut, nLeftDist );
break;
case RIGHT_BORDER_PADDING:
- rUnitConverter.convertMeasure( aOut, nRightDist );
+ rUnitConverter.convertMeasureToXML( aOut, nRightDist );
break;
case TOP_BORDER_PADDING:
- rUnitConverter.convertMeasure( aOut, nTopDist );
+ rUnitConverter.convertMeasureToXML( aOut, nTopDist );
break;
case BOTTOM_BORDER_PADDING:
- rUnitConverter.convertMeasure( aOut, nBottomDist );
+ rUnitConverter.convertMeasureToXML( aOut, nBottomDist );
break;
// border
@@ -776,8 +791,9 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
if ( !bNoBorder )
{
- rUnitConverter.convertMeasure( aOut, nWidth,
- MAP_TWIP, MAP_POINT );
+ ::sax::Converter::convertMeasure(aOut, nWidth,
+ util::MeasureUnit::TWIP,
+ util::MeasureUnit::POINT);
aOut.append( sal_Unicode( ' ' ) );
aOut.append( GetXMLToken( eStyle ) );
aOut.append( sal_Unicode( ' ' ) );
@@ -817,11 +833,11 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
default:
return sal_False;
}
- rUnitConverter.convertMeasure( aOut, pLine->GetInWidth() );
+ rUnitConverter.convertMeasureToXML( aOut, pLine->GetInWidth() );
aOut.append( sal_Unicode( ' ' ) );
- rUnitConverter.convertMeasure( aOut, pLine->GetDistance() );
+ rUnitConverter.convertMeasureToXML( aOut, pLine->GetDistance() );
aOut.append( sal_Unicode( ' ' ) );
- rUnitConverter.convertMeasure( aOut, pLine->GetOutWidth() );
+ rUnitConverter.convertMeasureToXML( aOut, pLine->GetOutWidth() );
break;
}
@@ -1084,7 +1100,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
if( bOutHeight )
{
- rUnitConverter.convertMeasure( aOut, pFrmSize->GetHeight() );
+ rUnitConverter.convertMeasureToXML(aOut, pFrmSize->GetHeight());
bOk = sal_True;
}
}
diff --git a/sw/source/filter/xml/xmlimpit.cxx b/sw/source/filter/xml/xmlimpit.cxx
index 21f9ea7..dec3965 100644
--- a/sw/source/filter/xml/xmlimpit.cxx
+++ b/sw/source/filter/xml/xmlimpit.cxx
@@ -263,7 +263,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
if( rValue.indexOf( sal_Unicode('%') ) != -1 )
bOk = ::sax::Converter::convertPercent(nProp, rValue);
else
- bOk = rUnitConverter.convertMeasure( nAbs, rValue );
+ bOk = rUnitConverter.convertMeasureToCore(nAbs, rValue);
if( bOk )
{
@@ -287,7 +287,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
if( rValue.indexOf( sal_Unicode('%') ) != -1 )
bOk = ::sax::Converter::convertPercent(nProp, rValue);
else
- bOk = rUnitConverter.convertMeasure( nAbs, rValue,
+ bOk = rUnitConverter.convertMeasureToCore(nAbs, rValue,
-0x7fff, 0x7fff );
pLRSpace->SetTxtFirstLineOfst( (short)nAbs, (sal_uInt16)nProp );
@@ -319,7 +319,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
if( rValue.indexOf( sal_Unicode('%') ) != -1 )
bOk = ::sax::Converter::convertPercent( nProp, rValue );
else
- bOk = rUnitConverter.convertMeasure( nAbs, rValue );
+ bOk = rUnitConverter.convertMeasureToCore( nAbs, rValue );
switch( nMemberId )
{
@@ -370,9 +370,9 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
{
sal_Int32 nX = 0, nY = 0;
- bOk = rUnitConverter.convertMeasure( nX, aToken );
+ bOk = rUnitConverter.convertMeasureToCore( nX, aToken );
if( bOk && aTokenEnum.getNextToken( aToken ) )
- bOk = rUnitConverter.convertMeasure( nY, aToken );
+ bOk = rUnitConverter.convertMeasureToCore( nY, aToken );
if( bOk )
{
@@ -440,8 +440,11 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
case RIGHT_BORDER_PADDING:
case TOP_BORDER_PADDING:
case BOTTOM_BORDER_PADDING:
- if(!rUnitConverter.convertMeasure( nTemp, rValue, 0, 0xffff ))
+ if (!rUnitConverter.convertMeasureToCore( nTemp, rValue,
+ 0, 0xffff ))
+ {
return sal_False;
+ }
if( nMemberId == LEFT_BORDER_PADDING ||
nMemberId == ALL_BORDER_PADDING )
@@ -518,19 +521,19 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
if( !aTokenEnum.getNextToken( aToken ) )
return sal_False;
- if( !rUnitConverter.convertMeasure( nInWidth, aToken ) )
+ if (!rUnitConverter.convertMeasureToCore(nInWidth, aToken))
return sal_False;
if( !aTokenEnum.getNextToken( aToken ) )
return sal_False;
- if( !rUnitConverter.convertMeasure( nDistance, aToken ) )
+ if (!rUnitConverter.convertMeasureToCore(nDistance, aToken))
return sal_False;
if( !aTokenEnum.getNextToken( aToken ) )
return sal_False;
- if( !rUnitConverter.convertMeasure( nOutWidth, aToken ) )
+ if (!rUnitConverter.convertMeasureToCore(nOutWidth, aToken))
return sal_False;
// #i61946: accept line style even it's not part of our "normal" set of line styles
@@ -919,7 +922,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
sal_Int32 nValue;
if( bSetHeight || bSetWidth )
{
- bOk = rUnitConverter.convertMeasure( nValue, rValue, nMin,
+ bOk = rUnitConverter.convertMeasureToCore(nValue, rValue, nMin,
USHRT_MAX );
if( bOk )
{
diff --git a/sw/source/filter/xml/xmliteme.cxx b/sw/source/filter/xml/xmliteme.cxx
index 1f38c95..f76faf6 100644
--- a/sw/source/filter/xml/xmliteme.cxx
+++ b/sw/source/filter/xml/xmliteme.cxx
@@ -29,6 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <com/sun/star/util/MeasureUnit.hpp>
#include <hintids.hxx>
#include <rtl/ustring.hxx>
@@ -179,7 +180,7 @@ void SwXMLTableItemMapper_Impl::handleSpecialItem(
if( nAbsWidth )
{
OUStringBuffer sBuffer;
- rUnitConverter.convertMeasure( sBuffer, nAbsWidth );
+ rUnitConverter.convertMeasureToXML( sBuffer, nAbsWidth );
AddAttribute( rEntry.nNameSpace, rEntry.eLocalName,
sBuffer.makeStringAndClear(),
rNamespaceMap, rAttrList );
@@ -232,8 +233,8 @@ inline void SwXMLTableItemMapper_Impl::SetAbsWidth( sal_uInt32 nAbs )
void SwXMLExport::_InitItemExport()
{
- pTwipUnitConv = new SvXMLUnitConverter( MAP_TWIP,
- GetMM100UnitConverter().getXMLMeasureUnit(), getServiceFactory() );
+ pTwipUnitConv = new SvXMLUnitConverter(getServiceFactory(),
+ util::MeasureUnit::TWIP, GetMM100UnitConverter().GetXMLMeasureUnit());
xTableItemMap = new SvXMLItemMapEntries( aXMLTableItemMap );
xTableRowItemMap = new SvXMLItemMapEntries( aXMLTableRowItemMap );
diff --git a/sw/source/filter/xml/xmlitemi.cxx b/sw/source/filter/xml/xmlitemi.cxx
index d9a9895..977349e 100644
--- a/sw/source/filter/xml/xmlitemi.cxx
+++ b/sw/source/filter/xml/xmlitemi.cxx
@@ -31,6 +31,8 @@
#include <rtl/ustring.hxx>
+#include <com/sun/star/util/MeasureUnit.hpp>
+
#include <rsc/rscsfx.hxx>
#include <xmloff/i18nmap.hxx>
@@ -344,7 +346,8 @@ SvXMLImportContext *SwXMLItemSetContext_Impl::CreateChildContext(
void SwXMLImport::_InitItemImport()
{
- pTwipUnitConv = new SvXMLUnitConverter( MAP_TWIP, MAP_TWIP, getServiceFactory() );
+ pTwipUnitConv = new SvXMLUnitConverter( getServiceFactory(),
+ util::MeasureUnit::TWIP, util::MeasureUnit::TWIP );
xTableItemMap = new SvXMLItemMapEntries( aXMLTableItemMap );
xTableColItemMap = new SvXMLItemMapEntries( aXMLTableColItemMap );
diff --git a/sw/source/filter/xml/xmlithlp.cxx b/sw/source/filter/xml/xmlithlp.cxx
index d972c73..992c00d 100644
--- a/sw/source/filter/xml/xmlithlp.cxx
+++ b/sw/source/filter/xml/xmlithlp.cxx
@@ -139,7 +139,7 @@ sal_Bool lcl_frmitems_parseXMLBorder( const OUString& rValue,
rHasColor = sal_True;
}
else if( !rHasWidth &&
- rUnitConverter.convertMeasure( nTemp, aToken, 0, USHRT_MAX ) )
+ rUnitConverter.convertMeasureToCore(nTemp, aToken, 0, USHRT_MAX))
{
rWidth = (sal_uInt16)nTemp;
rHasWidth = sal_True;
diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx
index 222d6a1..e3c0ea3 100644
--- a/sw/source/filter/xml/xmltble.cxx
+++ b/sw/source/filter/xml/xmltble.cxx
@@ -552,7 +552,8 @@ void SwXMLExport::ExportTableColumnStyle( const SwXMLTableColumn_Impl& rCol )
OUStringBuffer sValue;
if( rCol.GetWidthOpt() )
{
- GetTwipUnitConverter().convertMeasure( sValue, rCol.GetWidthOpt() );
+ GetTwipUnitConverter().convertMeasureToXML( sValue,
+ rCol.GetWidthOpt() );
AddAttribute( XML_NAMESPACE_STYLE, XML_COLUMN_WIDTH,
sValue.makeStringAndClear() );
}
diff --git a/xmloff/Library_xo.mk b/xmloff/Library_xo.mk
index 333c486..02723f3 100644
--- a/xmloff/Library_xo.mk
+++ b/xmloff/Library_xo.mk
@@ -115,7 +115,6 @@ $(eval $(call gb_Library_add_exception_objects,xo,\
xmloff/source/core/unoatrcn \
xmloff/source/core/unointerfacetouniqueidentifiermapper \
xmloff/source/core/xmlcnimp \
- xmloff/source/core/xmlehelp \
xmloff/source/core/xmlerror \
xmloff/source/core/xmlexp \
xmloff/source/core/xmlictxt \
diff --git a/xmloff/inc/xmlehelp.hxx b/xmloff/inc/xmlehelp.hxx
deleted file mode 100644
index 1059540..0000000
--- a/xmloff/inc/xmlehelp.hxx
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLEHELP_HXX
-#define _XMLOFF_XMLEHELP_HXX
-
-#include <tools/mapunit.hxx>
-
-namespace rtl { class OUStringBuffer; }
-
-class SvXMLExportHelper
-{
-public:
- static void AddLength( sal_Int32 nValue, MapUnit eValueUnit,
- ::rtl::OUStringBuffer& rOut,
- MapUnit eOutUnit );
- static void AddPercentage( sal_Int32 nVal, ::rtl::OUStringBuffer& rOut );
- static double GetConversionFactor(::rtl::OUStringBuffer& rUnit,
- const MapUnit eCoreUnit, const MapUnit eDestUnit);
- static MapUnit GetUnitFromString(const ::rtl::OUString& rString,
- MapUnit eDefaultUnit);
-};
-
-
-
-#endif // _XMLOFF_XMLEHELP_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/inc/xmloff/VisAreaContext.hxx b/xmloff/inc/xmloff/VisAreaContext.hxx
index 62f9d4b..0f9e7bd 100644
--- a/xmloff/inc/xmloff/VisAreaContext.hxx
+++ b/xmloff/inc/xmloff/VisAreaContext.hxx
@@ -30,7 +30,6 @@
#define _XMLOFF_VISAREACONTEXT_HXX
#include <xmloff/xmlictxt.hxx>
-#include <tools/mapunit.hxx>
class Rectangle;
@@ -45,7 +44,8 @@ public:
XMLVisAreaContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLName,
const ::com::sun::star::uno::Reference<
::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- Rectangle& rRect, const MapUnit aMapUnit);
+ Rectangle& rRect,
+ const sal_Int16 eMeasureUnit);
virtual ~XMLVisAreaContext();
diff --git a/xmloff/inc/xmloff/xmlexp.hxx b/xmloff/inc/xmloff/xmlexp.hxx
index b5199f2..2ac801b 100644
--- a/xmloff/inc/xmloff/xmlexp.hxx
+++ b/xmloff/inc/xmloff/xmlexp.hxx
@@ -43,7 +43,6 @@
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <rtl/ustring.hxx>
-#include <tools/mapunit.hxx>
#include <xmloff/txtparae.hxx>
#include <xmloff/formlayerexport.hxx>
#include <xmloff/xmlnumfe.hxx>
@@ -279,8 +278,8 @@ public:
// const enum ::xmloff::token::XMLTokenEnum eClass = xmloff::token::XML_TOKEN_INVALID,
// sal_uInt16 nExportFlag = EXPORT_ALL );
SvXMLExport(
+ sal_Int16 const eDefaultMeasureUnit /*css::util::MeasureUnit*/,
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- MapUnit eDfltUnit,
const enum ::xmloff::token::XMLTokenEnum eClass = xmloff::token::XML_TOKEN_INVALID,
sal_uInt16 nExportFlag = EXPORT_ALL );
@@ -292,8 +291,8 @@ public:
SvXMLExport(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
const ::rtl::OUString& rFileName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > & rHandler,
- MapUnit eDfltUnit = MAP_INCH );
+ sal_Int16 const eDefaultMeasureUnit /*css::util::MeasureUnit*/,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > & rHandler);
// #110680#
//SvXMLExport( const ::rtl::OUString& rFileName,
@@ -307,7 +306,7 @@ public:
const ::rtl::OUString& rFileName,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > & rHandler,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > &,
- sal_Int16 eDfltUnit );
+ sal_Int16 const eDefaultFieldUnit );
// #110680#
//SvXMLExport( const ::rtl::OUString& rFileName,
@@ -324,7 +323,7 @@ public:
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > & rHandler,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > &,
const ::com::sun::star::uno::Reference< ::com::sun::star::document::XGraphicObjectResolver > &,
- sal_Int16 eDfltUnit );
+ sal_Int16 const eDefaultFieldUnit );
virtual ~SvXMLExport();
diff --git a/xmloff/inc/xmloff/xmluconv.hxx b/xmloff/inc/xmloff/xmluconv.hxx
index c605f7b..9fc5364 100644
--- a/xmloff/inc/xmloff/xmluconv.hxx
+++ b/xmloff/inc/xmloff/xmluconv.hxx
@@ -35,7 +35,6 @@
#include <limits.h>
#include <tools/solar.h>
-#include <tools/mapunit.hxx>
#include <xmloff/xmlement.hxx>
#include <xmloff/xmltoken.hxx>
#include <com/sun/star/util/Date.hpp>
@@ -93,8 +92,8 @@ public:
class XMLOFF_DLLPUBLIC SvXMLUnitConverter
{
private:
- MapUnit meCoreMeasureUnit;
- MapUnit meXMLMeasureUnit;
+ sal_Int16 meCoreMeasureUnit;
+ sal_Int16 meXMLMeasureUnit;
com::sun::star::util::Date aNullDate;
::com::sun::star::uno::Reference<
::com::sun::star::text::XNumberingTypeInfo > xNumTypeInfo;
@@ -109,28 +108,27 @@ public:
/** constructs a SvXMLUnitConverter. The core measure unit is the
default unit for numerical measures, the XML measure unit is
the default unit for textual measures */
- // #110680#
- // SvXMLUnitConverter( MapUnit eCoreMeasureUnit, MapUnit eXMLMeasureUnit );
SvXMLUnitConverter(
- MapUnit eCoreMeasureUnit,
- MapUnit eXMLMeasureUnit,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory );
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
+ sal_Int16 eCoreMeasureUnit,
+ sal_Int16 eXMLMeasureUnit);
virtual ~SvXMLUnitConverter();
- static MapUnit GetMapUnit(sal_Int16 nFieldUnit);
+ static sal_Int16 GetMeasureUnit(sal_Int16 const nFieldUnit);
/** sets the default unit for numerical measures */
- inline void setCoreMeasureUnit( MapUnit eCoreMeasureUnit );
+ inline void SetCoreMeasureUnit( sal_Int16 const eCoreMeasureUnit );
/** gets the default unit for numerical measures */
- inline MapUnit getCoreMeasureUnit() const;
+ inline sal_Int16 GetCoreMeasureUnit() const;
/** sets the default unit for textual measures */
- void setXMLMeasureUnit( MapUnit eXMLMeasureUnit );
+ void SetXMLMeasureUnit( sal_Int16 const eXMLMeasureUnit );
/** gets the default unit for textual measures */
- MapUnit getXMLMeasureUnit() const;
+ sal_Int16 GetXMLMeasureUnit() const;
/** gets XNumberingTypeInfo */
const ::com::sun::star::uno::Reference<
@@ -141,42 +139,22 @@ public:
return xNumTypeInfo;
}
- /** convert string to measure using optional min and max values*/
- sal_Bool convertMeasure( sal_Int32& rValue,
+ /** convert string to measure with meCoreMeasureUnit,
+ using optional min and max values*/
+ bool convertMeasureToCore( sal_Int32& rValue,
const ::rtl::OUString& rString,
sal_Int32 nMin = SAL_MIN_INT32,
sal_Int32 nMax = SAL_MAX_INT32) const;
- /** convert measure to string */
- void convertMeasure( ::rtl::OUStringBuffer& rBuffer,
+ /** convert measure to string: from meCoreMeasureUnit to meXMLMeasureUnit */
+ void convertMeasureToXML( ::rtl::OUStringBuffer& rBuffer,
sal_Int32 nMeasure ) const;
- /** convert measure with given unit to string */
- void convertMeasure( ::rtl::OUStringBuffer&,
+ /** convert measure with given unit to string with meXMLMeasureUnit */
+ void convertMeasureToXML( ::rtl::OUStringBuffer&,
sal_Int32 nMeasure,
- MapUnit eSrcUnit ) const;
-
- /** convert string to measure in given unit
- using optional min and max values */
- static sal_Bool convertMeasure( sal_Int32& rVal,
- const ::rtl::OUString& rString,
- MapUnit eDstUnit,
- sal_Int32 nMin = SAL_MIN_INT32,
- sal_Int32 nMax = SAL_MAX_INT32);
-
- /** convert measure in given unit to string with given unit */
- static void convertMeasure( ::rtl::OUStringBuffer& rBuffer,
- sal_Int32 nMeasure,
- MapUnit eSrcUnit,
- MapUnit eDstUnit );
-
- /** convert string to pixel measure unite */
- static sal_Bool convertMeasurePx( sal_Int32& rValue,
- const ::rtl::OUString& rString );
+ sal_Int16 eSrcUnit ) const;
- /** convert pixel measure unit to string */
- static void convertMeasurePx( ::rtl::OUStringBuffer& rBuffer,
- sal_Int32 nValue );
/** convert string to enum using given enum map, if the enum is
not found in the map, this method will return false */
@@ -286,22 +264,24 @@ public:
};
-inline void SvXMLUnitConverter::setCoreMeasureUnit( MapUnit eCoreMeasureUnit )
+inline void
+SvXMLUnitConverter::SetCoreMeasureUnit( sal_Int16 const eCoreMeasureUnit )
{
meCoreMeasureUnit = eCoreMeasureUnit;
}
-inline MapUnit SvXMLUnitConverter::getCoreMeasureUnit() const
+inline sal_Int16 SvXMLUnitConverter::GetCoreMeasureUnit() const
{
return meCoreMeasureUnit;
}
-inline void SvXMLUnitConverter::setXMLMeasureUnit( MapUnit eXMLMeasureUnit )
+inline void
+SvXMLUnitConverter::SetXMLMeasureUnit( sal_Int16 const eXMLMeasureUnit )
{
meXMLMeasureUnit = eXMLMeasureUnit;
}
-inline MapUnit SvXMLUnitConverter::getXMLMeasureUnit() const
+inline sal_Int16 SvXMLUnitConverter::GetXMLMeasureUnit() const
{
return meXMLMeasureUnit;
}
diff --git a/xmloff/source/chart/PropertyMaps.cxx b/xmloff/source/chart/PropertyMaps.cxx
index 7666cc8..a045f12 100644
--- a/xmloff/source/chart/PropertyMaps.cxx
+++ b/xmloff/source/chart/PropertyMaps.cxx
@@ -438,7 +438,7 @@ void XMLChartExportPropertyMapper::handleSpecialItem(
{
awt::Size aSize;
rProperty.maValue >>= aSize;
- rUnitConverter.convertMeasure( sValueBuffer,
+ rUnitConverter.convertMeasureToXML( sValueBuffer,
nContextId == XML_SCH_CONTEXT_SPECIAL_SYMBOL_WIDTH
? aSize.Width
: aSize.Height );
@@ -585,7 +585,8 @@ bool XMLChartImportPropertyMapper::handleSpecialItem(
{
awt::Size aSize;
rProperty.maValue >>= aSize;
- rUnitConverter.convertMeasure( nContextId == XML_SCH_CONTEXT_SPECIAL_SYMBOL_WIDTH
+ rUnitConverter.convertMeasureToCore(
+ (nContextId == XML_SCH_CONTEXT_SPECIAL_SYMBOL_WIDTH)
? aSize.Width
: aSize.Height,
rValue );
diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx
index 96d04db..2aeb6e9 100644
--- a/xmloff/source/chart/SchXMLChartContext.cxx
+++ b/xmloff/source/chart/SchXMLChartContext.cxx
@@ -319,11 +319,13 @@ void SchXMLChartContext::StartElement( const uno::Reference< xml::sax::XAttribut
break;
case XML_TOK_CHART_WIDTH:
- GetImport().GetMM100UnitConverter().convertMeasure( maChartSize.Width, aValue );
+ GetImport().GetMM100UnitConverter().convertMeasureToCore(
+ maChartSize.Width, aValue );
break;
case XML_TOK_CHART_HEIGHT:
- GetImport().GetMM100UnitConverter().convertMeasure( maChartSize.Height, aValue );
+ GetImport().GetMM100UnitConverter().convertMeasureToCore(
+ maChartSize.Height, aValue );
break;
case XML_TOK_CHART_STYLE_NAME:
@@ -1183,12 +1185,14 @@ void SchXMLTitleContext::StartElement( const uno::Reference< xml::sax::XAttribut
{
if( IsXMLToken( aLocalName, XML_X ) )
{
- GetImport().GetMM100UnitConverter().convertMeasure( maPosition.X, aValue );
+ GetImport().GetMM100UnitConverter().convertMeasureToCore(
+ maPosition.X, aValue );
bHasXPosition = true;
}
else if( IsXMLToken( aLocalName, XML_Y ) )
{
- GetImport().GetMM100UnitConverter().convertMeasure( maPosition.Y, aValue );
+ GetImport().GetMM100UnitConverter().convertMeasureToCore(
+ maPosition.Y, aValue );
bHasYPosition = true;
}
}
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index 0897728..8e4556c 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -104,6 +104,7 @@
#include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
#include <com/sun/star/chart2/data/XNumericalDataSequence.hpp>
+#include <com/sun/star/util/MeasureUnit.hpp>
#include <com/sun/star/util/XStringMapping.hpp>
#include <com/sun/star/drawing/HomogenMatrix.hpp>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
@@ -122,6 +123,7 @@ using namespace ::xmloff::token;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
using ::rtl::OUStringToOString;
+using namespace ::com::sun::star;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Any;
@@ -3557,11 +3559,13 @@ void SchXMLExportHelper_Impl::getCellAddress( sal_Int32 nCol, sal_Int32 nRow )
void SchXMLExportHelper_Impl::addPosition( const awt::Point & rPosition )
{
- mrExport.GetMM100UnitConverter().convertMeasure( msStringBuffer, rPosition.X );
+ mrExport.GetMM100UnitConverter().convertMeasureToXML(
+ msStringBuffer, rPosition.X );
msString = msStringBuffer.makeStringAndClear();
mrExport.AddAttribute( XML_NAMESPACE_SVG, XML_X, msString );
- mrExport.GetMM100UnitConverter().convertMeasure( msStringBuffer, rPosition.Y );
+ mrExport.GetMM100UnitConverter().convertMeasureToXML(
+ msStringBuffer, rPosition.Y );
msString = msStringBuffer.makeStringAndClear();
mrExport.AddAttribute( XML_NAMESPACE_SVG, XML_Y, msString );
}
@@ -3574,12 +3578,14 @@ void SchXMLExportHelper_Impl::addPosition( Reference< drawing::XShape > xShape )
void SchXMLExportHelper_Impl::addSize( const awt::Size & rSize, bool bIsOOoNamespace)
{
- mrExport.GetMM100UnitConverter().convertMeasure( msStringBuffer, rSize.Width );
+ mrExport.GetMM100UnitConverter().convertMeasureToXML(
+ msStringBuffer, rSize.Width );
msString = msStringBuffer.makeStringAndClear();
mrExport.AddAttribute( bIsOOoNamespace ? XML_NAMESPACE_CHART_EXT : XML_NAMESPACE_SVG , XML_WIDTH, msString );
- mrExport.GetMM100UnitConverter().convertMeasure( msStringBuffer, rSize.Height);
+ mrExport.GetMM100UnitConverter().convertMeasureToXML(
+ msStringBuffer, rSize.Height);
msString = msStringBuffer.makeStringAndClear();
mrExport.AddAttribute( bIsOOoNamespace ? XML_NAMESPACE_CHART_EXT : XML_NAMESPACE_SVG, XML_HEIGHT, msString );
}
@@ -3631,7 +3637,8 @@ void SchXMLExportHelper_Impl::exportText( const OUString& rText, bool bConvertTa
SchXMLExport::SchXMLExport(
const Reference< lang::XMultiServiceFactory >& xServiceFactory,
sal_uInt16 nExportFlags )
-: SvXMLExport( xServiceFactory, MAP_CM, ::xmloff::token::XML_CHART, nExportFlags ),
+: SvXMLExport( util::MeasureUnit::CM, xServiceFactory,
+ ::xmloff::token::XML_CHART, nExportFlags ),
maAutoStylePool( *this ),
maExportHelper( *this, maAutoStylePool )
{
diff --git a/xmloff/source/chart/SchXMLLegendContext.cxx b/xmloff/source/chart/SchXMLLegendContext.cxx
index 8df4ead..c48d3df 100644
--- a/xmloff/source/chart/SchXMLLegendContext.cxx
+++ b/xmloff/source/chart/SchXMLLegendContext.cxx
@@ -171,11 +171,13 @@ void SchXMLLegendContext::StartElement( const uno::Reference< xml::sax::XAttribu
break;
case XML_TOK_LEGEND_X:
- GetImport().GetMM100UnitConverter().convertMeasure( aLegendPos.X, aValue );
+ GetImport().GetMM100UnitConverter().convertMeasureToCore(
+ aLegendPos.X, aValue );
bHasXPosition = true;
break;
case XML_TOK_LEGEND_Y:
- GetImport().GetMM100UnitConverter().convertMeasure( aLegendPos.Y, aValue );
+ GetImport().GetMM100UnitConverter().convertMeasureToCore(
+ aLegendPos.Y, aValue );
bHasYPosition = true;
break;
case XML_TOK_LEGEND_STYLE_NAME:
@@ -189,12 +191,14 @@ void SchXMLLegendContext::StartElement( const uno::Reference< xml::sax::XAttribu
break;
case XML_TOK_LEGEND_WIDTH:
case XML_TOK_LEGEND_WIDTH_EXT:
- GetImport().GetMM100UnitConverter().convertMeasure( aLegendSize.Width, aValue );
+ GetImport().GetMM100UnitConverter().convertMeasureToCore(
+ aLegendSize.Width, aValue );
bHasWidth = true;
break;
case XML_TOK_LEGEND_HEIGHT:
case XML_TOK_LEGEND_HEIGHT_EXT:
- GetImport().GetMM100UnitConverter().convertMeasure( aLegendSize.Height, aValue );
+ GetImport().GetMM100UnitConverter().convertMeasureToCore(
+ aLegendSize.Height, aValue );
bHasHeight = true;
break;
default:
diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
index ceeaa69..22d3168 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
@@ -776,22 +776,26 @@ bool SchXMLPositonAttributesHelper::readPositioningAttribute( sal_uInt16 nPrefix
{
if( IsXMLToken( rLocalName, XML_X ) )
{
- m_rImport.GetMM100UnitConverter().convertMeasure( m_aPosition.X, rValue );
+ m_rImport.GetMM100UnitConverter().convertMeasureToCore(
+ m_aPosition.X, rValue );
m_bHasPositionX = true;
}
else if( IsXMLToken( rLocalName, XML_Y ) )
{
- m_rImport.GetMM100UnitConverter().convertMeasure( m_aPosition.Y, rValue );
+ m_rImport.GetMM100UnitConverter().convertMeasureToCore(
+ m_aPosition.Y, rValue );
m_bHasPositionY = true;
}
else if( IsXMLToken( rLocalName, XML_WIDTH ) )
{
- m_rImport.GetMM100UnitConverter().convertMeasure( m_aSize.Width, rValue );
+ m_rImport.GetMM100UnitConverter().convertMeasureToCore(
+ m_aSize.Width, rValue );
m_bHasSizeWidth = true;
}
else if( IsXMLToken( rLocalName, XML_HEIGHT ) )
{
- m_rImport.GetMM100UnitConverter().convertMeasure( m_aSize.Height, rValue );
+ m_rImport.GetMM100UnitConverter().convertMeasureToCore(
+ m_aSize.Height, rValue );
m_bHasSizeHeight = true;
}
else
@@ -1116,11 +1120,13 @@ void SchXMLEquationContext::StartElement( const uno::Reference< xml::sax::XAttri
switch( rAttrTokenMap.Get( nPrefix, aLocalName ))
{
case XML_TOK_REGEQ_POS_X:
- rImport.GetMM100UnitConverter().convertMeasure( aPosition.X, aValue );
+ rImport.GetMM100UnitConverter().convertMeasureToCore(
+ aPosition.X, aValue );
bHasXPos = true;
break;
case XML_TOK_REGEQ_POS_Y:
- rImport.GetMM100UnitConverter().convertMeasure( aPosition.Y, aValue );
+ rImport.GetMM100UnitConverter().convertMeasureToCore(
+ aPosition.Y, aValue );
bHasYPos = true;
break;
case XML_TOK_REGEQ_DISPLAY_EQUATION:
diff --git a/xmloff/source/core/xmlehelp.cxx b/xmloff/source/core/xmlehelp.cxx
deleted file mode 100644
index fe38c79..0000000
--- a/xmloff/source/core/xmlehelp.cxx
+++ /dev/null
@@ -1,501 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_xmloff.hxx"
-#include <limits.h>
-#include <tools/debug.hxx>
-#include <tools/bigint.hxx>
-#include <rtl/ustrbuf.hxx>
-#include "xmlehelp.hxx"
-
-#include <xmloff/xmltoken.hxx>
-
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-
-using namespace ::xmloff::token;
-
-void SvXMLExportHelper::AddLength( sal_Int32 nValue, MapUnit eValueUnit,
- OUStringBuffer& rOut,
- MapUnit eOutUnit )
-{
- // the sign is processed seperatly
- if( nValue < 0 )
- {
- nValue = -nValue;
- rOut.append( sal_Unicode('-') );
- }
-
- // The new length is (nVal * nMul)/(nDiv*nFac*10)
- sal_Int32 nMul = 1000;
- sal_Int32 nDiv = 1;
- sal_Int32 nFac = 100;
- enum XMLTokenEnum eUnit = XML_TOKEN_INVALID;
- switch( eValueUnit )
- {
- case MAP_TWIP:
- switch( eOutUnit )
- {
- case MAP_100TH_MM:
- case MAP_10TH_MM:
- DBG_ASSERT( MAP_INCH == eOutUnit,
- "output unit not supported for twip values" );
- case MAP_MM:
- // 0.01mm = 0.57twip (exactly)
- nMul = 25400; // 25.4 * 1000
- nDiv = 1440; // 72 * 20;
- nFac = 100;
- eUnit = XML_UNIT_MM;
- break;
-
- case MAP_CM:
- // 0.001cm = 0.57twip (exactly)
- nMul = 25400; // 2.54 * 10000
- nDiv = 1440; // 72 * 20;
- nFac = 1000;
- eUnit = XML_UNIT_CM;
- break;
-
- case MAP_POINT:
- // 0.01pt = 0.2twip (exactly)
- nMul = 1000;
- nDiv = 20;
- nFac = 100;
- eUnit = XML_UNIT_PT;
- break;
-
- case MAP_INCH:
- default:
- DBG_ASSERT( MAP_INCH == eOutUnit,
- "output unit not supported for twip values" );
- // 0.0001in = 0.144twip (exactly)
- nMul = 100000;
- nDiv = 1440; // 72 * 20;
- nFac = 10000;
- eUnit = XML_UNIT_INCH;
- break;
- }
- break;
-
- case MAP_POINT:
- // 1pt = 1pt (exactly)
- DBG_ASSERT( MAP_POINT == eOutUnit,
- "output unit not supported for pt values" );
- nMul = 10;
- nDiv = 1;
- nFac = 1;
- eUnit = XML_UNIT_PT;
- break;
- case MAP_10TH_MM:
- case MAP_100TH_MM:
- {
- long nFac2 = (MAP_100TH_MM == eValueUnit) ? 100 : 10;
- switch( eOutUnit )
- {
- case MAP_100TH_MM:
- case MAP_10TH_MM:
- DBG_ASSERT( MAP_INCH == eOutUnit,
- "output unit not supported for 1/100mm values" );
- case MAP_MM:
- // 0.01mm = 1 mm/100 (exactly)
- nMul = 10;
- nDiv = 1;
- nFac = nFac2;
- eUnit = XML_UNIT_MM;
- break;
-
- case MAP_CM:
- // 0.001mm = 1 mm/100 (exactly)
- nMul = 10;
- nDiv = 1; // 72 * 20;
- nFac = 10*nFac2;
- eUnit = XML_UNIT_CM;
- break;
-
- case MAP_POINT:
- // 0.01pt = 0.35 mm/100 (exactly)
- nMul = 72000;
- nDiv = 2540;
- nFac = nFac2;
- eUnit = XML_UNIT_PT;
- break;
-
- case MAP_INCH:
- default:
- DBG_ASSERT( MAP_INCH == eOutUnit,
- "output unit not supported for 1/100mm values" );
- // 0.0001in = 0.254 mm/100 (exactly)
- nMul = 100000;
- nDiv = 2540;
- nFac = 100*nFac2;
- eUnit = XML_UNIT_INCH;
- break;
- }
- break;
- }
- default:
- DBG_ASSERT( 0, "input unit not handled" );
- break;
- }
-
-
- sal_Int32 nLongVal = 0;
- sal_Bool bOutLongVal = sal_True;
- if( nValue > SAL_MAX_INT32 / nMul )
- {
- // A big int is required for calculation
- BigInt nBigVal( nValue );
- nBigVal *= nMul;
- nBigVal /= nDiv;
- nBigVal += 5;
- nBigVal /= 10;
-
- if( nBigVal.IsLong() )
- {
- // To convert the value into a string a sal_Int32 is sufficient
- nLongVal = sal_Int32( nBigVal );
- }
- else
- {
- BigInt nBigFac( nFac );
- BigInt nBig10( 10 );
- rOut.append( (sal_Int32)(nBigVal / nBigFac) );
- if( !(nBigVal % nBigFac).IsZero() )
- {
- rOut.append( sal_Unicode('.') );
- while( nFac > 1 && !(nBigVal % nBigFac).IsZero() )
- {
- nFac /= 10;
- nBigFac = nFac;
- rOut.append( (sal_Int32)((nBigVal / nBigFac) % nBig10 ) );
- }
- }
- bOutLongVal = sal_False;
- }
- }
- else
- {
- nLongVal = nValue * nMul;
- nLongVal /= nDiv;
- nLongVal += 5;
- nLongVal /= 10;
- }
-
- if( bOutLongVal )
- {
- rOut.append( (sal_Int32)(nLongVal / nFac) );
- if( nFac > 1 && (nLongVal % nFac) != 0 )
- {
- rOut.append( sal_Unicode('.') );
- while( nFac > 1 && (nLongVal % nFac) != 0 )
- {
- nFac /= 10;
- rOut.append( (sal_Int32)((nLongVal / nFac) % 10) );
- }
- }
- }
-
- if( eUnit != XML_TOKEN_INVALID )
- rOut.append( GetXMLToken(eUnit) );
-}
-
-void SvXMLExportHelper::AddPercentage( sal_Int32 nValue, OUStringBuffer& rOut )
-{
- rOut.append( nValue );
- rOut.append( sal_Unicode('%' ) );
-}
-
-double SvXMLExportHelper::GetConversionFactor(::rtl::OUStringBuffer& rUnit,
- const MapUnit eCoreUnit, const MapUnit eDestUnit)
-{
- double fRetval(1.0);
- rUnit.setLength(0L);
-
- if(eCoreUnit != eDestUnit)
- {
- enum XMLTokenEnum eUnit = XML_TOKEN_INVALID;
-
- switch(eCoreUnit)
- {
- case MAP_TWIP:
- {
- switch(eDestUnit)
- {
- case MAP_100TH_MM:
- case MAP_10TH_MM:
- {
- DBG_ASSERT(MAP_INCH == eDestUnit, "output unit not supported for twip values");
- }
- case MAP_MM:
- {
- // 0.01mm = 0.57twip (exactly)
- fRetval = ((25400.0 / 1440.0) / 1000.0);
- eUnit = XML_UNIT_MM;
- break;
- }
- case MAP_CM:
- {
- // 0.001cm = 0.57twip (exactly)
- fRetval = ((25400.0 / 1440.0) / 10000.0);
- eUnit = XML_UNIT_CM;
- break;
- }
- case MAP_POINT:
- {
- // 0.01pt = 0.2twip (exactly)
- fRetval = ((1000.0 / 20.0) / 1000.0);
- eUnit = XML_UNIT_PT;
- break;
- }
- case MAP_INCH:
- default:
- {
- DBG_ASSERT(MAP_INCH == eDestUnit, "output unit not supported for twip values");
- // 0.0001in = 0.144twip (exactly)
- fRetval = ((100000.0 / 1440.0) / 100000.0);
- eUnit = XML_UNIT_INCH;
- break;
- }
- }
- break;
- }
- case MAP_POINT:
- {
- switch(eDestUnit)
- {
- case MAP_MM:
- // 1mm = 72 / 25.4 pt (exactly)
- fRetval = ( 25.4 / 72.0 );
- eUnit = XML_UNIT_MM;
- break;
-
- case MAP_CM:
- // 1cm = 72 / 2.54 pt (exactly)
- fRetval = ( 2.54 / 72.0 );
- eUnit = XML_UNIT_CM;
- break;
-
- case MAP_TWIP:
- // 1twip = 72 / 1440 pt (exactly)
- fRetval = 20.0; // 1440.0 / 72.0
- eUnit = XML_UNIT_PC;
- break;
-
- case MAP_INCH:
- default:
- DBG_ASSERT(MAP_INCH == eDestUnit, "output unit not supported for pt values");
- // 1in = 72 pt (exactly)
- fRetval = ( 1.0 / 72.0 );
- eUnit = XML_UNIT_INCH;
- break;
- }
- break;
- }
- case MAP_10TH_MM:
- {
- switch(eDestUnit)
- {
- case MAP_100TH_MM:
- case MAP_10TH_MM:
- {
- DBG_ASSERT(MAP_INCH == eDestUnit, "output unit not supported for 1/100mm values");
- }
- case MAP_MM:
- {
- // 0.01mm = 1 mm/100 (exactly)
- fRetval = ((10.0 / 1.0) / 100.0);
- eUnit = XML_UNIT_MM;
- break;
- }
- case MAP_CM:
- {
- // 0.001mm = 1 mm/100 (exactly)
- fRetval = ((10.0 / 1.0) / 1000.0);
- eUnit = XML_UNIT_CM;
- break;
- }
- case MAP_POINT:
- {
- // 0.01pt = 0.35 mm/100 (exactly)
- fRetval = ((72000.0 / 2540.0) / 100.0);
- eUnit = XML_UNIT_PT;
- break;
- }
- case MAP_INCH:
- default:
- {
- DBG_ASSERT(MAP_INCH == eDestUnit, "output unit not supported for 1/100mm values");
- // 0.0001in = 0.254 mm/100 (exactly)
- fRetval = ((100000.0 / 2540.0) / 10000.0);
- eUnit = XML_UNIT_INCH;
- break;
- }
- }
- break;
- }
- case MAP_100TH_MM:
- {
- switch(eDestUnit)
- {
- case MAP_100TH_MM:
- case MAP_10TH_MM:
- {
- DBG_ASSERT(MAP_INCH == eDestUnit, "output unit not supported for 1/100mm values");
- }
- case MAP_MM:
- {
- // 0.01mm = 1 mm/100 (exactly)
- fRetval = ((10.0 / 1.0) / 1000.0);
- eUnit = XML_UNIT_MM;
- break;
- }
- case MAP_CM:
- {
- // 0.001mm = 1 mm/100 (exactly)
- fRetval = ((10.0 / 1.0) / 10000.0);
- eUnit = XML_UNIT_CM;
- break;
- }
- case MAP_POINT:
- {
- // 0.01pt = 0.35 mm/100 (exactly)
- fRetval = ((72000.0 / 2540.0) / 1000.0);
- eUnit = XML_UNIT_PT;
- break;
- }
- case MAP_INCH:
- default:
- {
- DBG_ASSERT(MAP_INCH == eDestUnit, "output unit not supported for 1/100mm values");
- // 0.0001in = 0.254 mm/100 (exactly)
- fRetval = ((100000.0 / 2540.0) / 100000.0);
- eUnit = XML_UNIT_INCH;
- break;
- }
- }
- break;
- }
- default:
- OSL_FAIL("xmloff::SvXMLExportHelper::GetConversionFactor(), illegal eCoreUnit value!");
- break;
- }
-
- if(eUnit != XML_TOKEN_INVALID)
- rUnit.append(GetXMLToken(eUnit));
- }
-
- return fRetval;
-}
-
-MapUnit SvXMLExportHelper::GetUnitFromString(const ::rtl::OUString& rString, MapUnit eDefaultUnit)
-{
- sal_Int32 nPos = 0;
- sal_Int32 nLen = rString.getLength();
- MapUnit eRetUnit = eDefaultUnit;
-
- // skip white space
- while( nPos < nLen && sal_Unicode(' ') == rString[nPos] )
- nPos++;
-
- // skip negative
- if( nPos < nLen && sal_Unicode('-') == rString[nPos] )
- nPos++;
-
- // skip number
- while( nPos < nLen && sal_Unicode('0') <= rString[nPos] && sal_Unicode('9') >= rString[nPos] )
- nPos++;
-
- if( nPos < nLen && sal_Unicode('.') == rString[nPos] )
- {
- nPos++;
- while( nPos < nLen && sal_Unicode('0') <= rString[nPos] && sal_Unicode('9') >= rString[nPos] )
- nPos++;
- }
-
- // skip white space
- while( nPos < nLen && sal_Unicode(' ') == rString[nPos] )
- nPos++;
-
- if( nPos < nLen )
- {
- switch(rString[nPos])
- {
- case sal_Unicode('%') :
- {
- eRetUnit = MAP_RELATIVE;
- break;
- }
- case sal_Unicode('c'):
- case sal_Unicode('C'):
- {
- if(nPos+1 < nLen && (rString[nPos+1] == sal_Unicode('m')
- || rString[nPos+1] == sal_Unicode('M')))
- eRetUnit = MAP_CM;
- break;
- }
- case sal_Unicode('e'):
- case sal_Unicode('E'):
- {
- // CSS1_EMS or CSS1_EMX later
- break;
- }
- case sal_Unicode('i'):
- case sal_Unicode('I'):
- {
- if(nPos+1 < nLen && (rString[nPos+1] == sal_Unicode('n')
- || rString[nPos+1] == sal_Unicode('n')))
- eRetUnit = MAP_INCH;
- break;
- }
- case sal_Unicode('m'):
- case sal_Unicode('M'):
- {
- if(nPos+1 < nLen && (rString[nPos+1] == sal_Unicode('m')
- || rString[nPos+1] == sal_Unicode('M')))
- eRetUnit = MAP_MM;
- break;
- }
- case sal_Unicode('p'):
- case sal_Unicode('P'):
- {
- if(nPos+1 < nLen && (rString[nPos+1] == sal_Unicode('t')
- || rString[nPos+1] == sal_Unicode('T')))
- eRetUnit = MAP_POINT;
- if(nPos+1 < nLen && (rString[nPos+1] == sal_Unicode('c')
- || rString[nPos+1] == sal_Unicode('C')))
- eRetUnit = MAP_TWIP;
- break;
- }
- }
- }
-
- return eRetUnit;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index f244a5c..faf5d39 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -43,6 +43,7 @@
#include <com/sun/star/xml/sax/SAXInvalidCharacterException.hpp>
#include <com/sun/star/uri/XUriReferenceFactory.hpp>
#include <com/sun/star/uri/UriReferenceFactory.hpp>
+#include <com/sun/star/util/MeasureUnit.hpp>
#include <comphelper/processfactory.hxx>
#include <comphelper/configurationhelper.hxx>
#include <xmloff/attrlist.hxx>
@@ -462,13 +463,15 @@ void SvXMLExport::_DetermineModelType()
}
SvXMLExport::SvXMLExport(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- MapUnit eDfltUnit, const enum XMLTokenEnum eClass, sal_uInt16 nExportFlags )
+ sal_Int16 const eDefaultMeasureUnit /*css::util::MeasureUnit*/,
+ const uno::Reference< lang::XMultiServiceFactory >& xServiceFactory,
+ const enum XMLTokenEnum eClass, sal_uInt16 nExportFlags )
: mpImpl( new SvXMLExport_Impl ),
mxServiceFactory(xServiceFactory),
mpAttrList( new SvXMLAttributeList ),
mpNamespaceMap( new SvXMLNamespaceMap ),
- mpUnitConv( new SvXMLUnitConverter( MAP_100TH_MM, eDfltUnit, getServiceFactory() ) ),
+ mpUnitConv( new SvXMLUnitConverter(getServiceFactory(),
+ util::MeasureUnit::MM_100TH, eDefaultMeasureUnit) ),
mpNumExport(0L),
mpProgressBarHelper( NULL ),
mpEventExport( NULL ),
@@ -488,8 +491,8 @@ SvXMLExport::SvXMLExport(
SvXMLExport::SvXMLExport(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
const OUString &rFileName,
- const uno::Reference< xml::sax::XDocumentHandler > & rHandler,
- MapUnit eDfltUnit )
+ sal_Int16 const eDefaultMeasureUnit /*css::util::MeasureUnit*/,
+ const uno::Reference< xml::sax::XDocumentHandler > & rHandler)
: mpImpl( new SvXMLExport_Impl ),
mxServiceFactory(xServiceFactory),
mxHandler( rHandler ),
@@ -497,7 +500,8 @@ SvXMLExport::SvXMLExport(
mpAttrList( new SvXMLAttributeList ),
msOrigFileName( rFileName ),
mpNamespaceMap( new SvXMLNamespaceMap ),
- mpUnitConv( new SvXMLUnitConverter( MAP_100TH_MM, eDfltUnit, getServiceFactory() ) ),
+ mpUnitConv( new SvXMLUnitConverter(getServiceFactory(),
+ util::MeasureUnit::MM_100TH, eDefaultMeasureUnit) ),
mpNumExport(0L),
mpProgressBarHelper( NULL ),
mpEventExport( NULL ),
@@ -523,7 +527,7 @@ SvXMLExport::SvXMLExport(
const OUString &rFileName,
const uno::Reference< xml::sax::XDocumentHandler > & rHandler,
const Reference< XModel >& rModel,
- sal_Int16 eDfltUnit )
+ sal_Int16 const eDefaultFieldUnit)
: mpImpl( new SvXMLExport_Impl ),
mxServiceFactory(xServiceFactory),
mxModel( rModel ),
@@ -533,7 +537,9 @@ SvXMLExport::SvXMLExport(
mpAttrList( new SvXMLAttributeList ),
msOrigFileName( rFileName ),
mpNamespaceMap( new SvXMLNamespaceMap ),
- mpUnitConv( new SvXMLUnitConverter( MAP_100TH_MM, SvXMLUnitConverter::GetMapUnit(eDfltUnit), getServiceFactory() ) ),
+ mpUnitConv( new SvXMLUnitConverter(getServiceFactory(),
+ util::MeasureUnit::MM_100TH,
+ SvXMLUnitConverter::GetMeasureUnit(eDefaultFieldUnit)) ),
mpNumExport(0L),
mpProgressBarHelper( NULL ),
mpEventExport( NULL ),
@@ -560,7 +566,7 @@ SvXMLExport::SvXMLExport(
const uno::Reference< xml::sax::XDocumentHandler > & rHandler,
const Reference< XModel >& rModel,
const Reference< document::XGraphicObjectResolver >& rEmbeddedGraphicObjects,
- sal_Int16 eDfltUnit )
+ sal_Int16 const eDefaultFieldUnit)
: mpImpl( new SvXMLExport_Impl ),
mxServiceFactory(xServiceFactory),
mxModel( rModel ),
@@ -571,7 +577,9 @@ SvXMLExport::SvXMLExport(
mpAttrList( new SvXMLAttributeList ),
msOrigFileName( rFileName ),
mpNamespaceMap( new SvXMLNamespaceMap ),
- mpUnitConv( new SvXMLUnitConverter( MAP_100TH_MM, SvXMLUnitConverter::GetMapUnit(eDfltUnit), getServiceFactory() ) ),
+ mpUnitConv( new SvXMLUnitConverter(getServiceFactory(),
+ util::MeasureUnit::MM_100TH,
+ SvXMLUnitConverter::GetMeasureUnit(eDefaultFieldUnit)) ),
mpNumExport(0L),
mpProgressBarHelper( NULL ),
mpEventExport( NULL ),
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index cb431db..1fe7a1e 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -53,6 +53,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
+#include <com/sun/star/util/MeasureUnit.hpp>
#include <com/sun/star/document/XBinaryStreamResolver.hpp>
#include <com/sun/star/document/XStorageBasedDocument.hpp>
#include <com/sun/star/xml/sax/XLocator.hpp>
@@ -352,8 +353,8 @@ SvXMLImport::SvXMLImport(
: mpImpl( new SvXMLImport_Impl() ),
mpNamespaceMap( new SvXMLNamespaceMap ),
- // #110680#
- mpUnitConv( new SvXMLUnitConverter( MAP_100TH_MM, MAP_100TH_MM, xServiceFactory ) ),
+ mpUnitConv( new SvXMLUnitConverter( xServiceFactory,
+ util::MeasureUnit::MM_100TH, util::MeasureUnit::MM_100TH) ),
mpContexts( new SvXMLImportContexts_Impl ),
mpNumImport( NULL ),
@@ -381,8 +382,8 @@ SvXMLImport::SvXMLImport(
mxNumberFormatsSupplier (rModel, uno::UNO_QUERY),
mpImpl( new SvXMLImport_Impl() ),
mpNamespaceMap( new SvXMLNamespaceMap ),
- // #110680#
- mpUnitConv( new SvXMLUnitConverter( MAP_100TH_MM, MAP_100TH_MM, xServiceFactory ) ),
+ mpUnitConv( new SvXMLUnitConverter(xServiceFactory,
+ util::MeasureUnit::MM_100TH, util::MeasureUnit::MM_100TH) ),
mpContexts( new SvXMLImportContexts_Impl ),
mpNumImport( NULL ),
mpProgressBarHelper( NULL ),
@@ -411,8 +412,8 @@ SvXMLImport::SvXMLImport(
mxGraphicResolver( rGraphicObjects ),
mpImpl( new SvXMLImport_Impl() ),
mpNamespaceMap( new SvXMLNamespaceMap ),
- // #110680#
- mpUnitConv( new SvXMLUnitConverter( MAP_100TH_MM, MAP_100TH_MM, xServiceFactory ) ),
+ mpUnitConv( new SvXMLUnitConverter(xServiceFactory,
+ util::MeasureUnit::MM_100TH, util::MeasureUnit::MM_100TH) ),
mpContexts( new SvXMLImportContexts_Impl ),
mpNumImport( NULL ),
mpProgressBarHelper( NULL ),
diff --git a/xmloff/source/core/xmluconv.cxx b/xmloff/source/core/xmluconv.cxx
index 1963fc8..23a61a4 100644
--- a/xmloff/source/core/xmluconv.cxx
+++ b/xmloff/source/core/xmluconv.cxx
@@ -33,21 +33,14 @@
#include <com/sun/star/util/DateTime.hpp>
#include <com/sun/star/util/Date.hpp>
-#include <com/sun/star/util/Time.hpp>
#include <tools/debug.hxx>
#include <rtl/ustrbuf.hxx>
-#include "xmlehelp.hxx"
#include <xmloff/xmlement.hxx>
#include <xmloff/xmltoken.hxx>
#include <rtl/math.hxx>
#include <rtl/logfile.hxx>
-#ifndef _TOOLS_DATE_HXX
#include <tools/date.hxx>
-#include <tools/string.hxx>
-#endif
-
-#include <tools/time.hxx>
#include <tools/fldunit.hxx>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
@@ -93,9 +86,10 @@ void SvXMLUnitConverter::createNumTypeInfo() const
*/
SvXMLUnitConverter::SvXMLUnitConverter(
- MapUnit eCoreMeasureUnit,
- MapUnit eXMLMeasureUnit,
- const uno::Reference<lang::XMultiServiceFactory>& xServiceFactory ) :
+ const uno::Reference<lang::XMultiServiceFactory>& xServiceFactory,
+ sal_Int16 const eCoreMeasureUnit,
+ sal_Int16 const eXMLMeasureUnit)
+:
aNullDate(30, 12, 1899),
mxServiceFactory( xServiceFactory )
{
@@ -109,313 +103,62 @@ SvXMLUnitConverter::~SvXMLUnitConverter()
{
}
-MapUnit SvXMLUnitConverter::GetMapUnit(sal_Int16 nFieldUnit)
+sal_Int16 SvXMLUnitConverter::GetMeasureUnit(sal_Int16 const nFieldUnit)
{
- MapUnit eUnit = MAP_INCH;
+ sal_Int16 eUnit = util::MeasureUnit::INCH;
switch( nFieldUnit )
{
case FUNIT_MM:
- eUnit = MAP_MM;
+ eUnit = util::MeasureUnit::MM;
break;
case FUNIT_CM:
case FUNIT_M:
case FUNIT_KM:
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list