diff options
author | Michael Stahl <mst@openoffice.org> | 2011-10-11 14:19:00 +0200 |
---|---|---|
committer | Michael Stahl <mst@openoffice.org> | 2011-10-11 17:57:00 +0200 |
commit | 3ca2bef76886450058d1667703aeafe4c2e456c3 (patch) | |
tree | b18d70f79bfcfd2b2e34790e86edafb4c4337a80 /reportdesign/source | |
parent | 02c32e0f0e75a9df80888051d1ec189fa14129bd (diff) |
#i108468#: clean up xmluconv code duplication, part 1:
move convertNumber64 from SvXMLUnitConverter to sax::converter.
remove duplicate methods from SvXMLUnitConverter:
convertBool, convertPercent, convertColor, convertNumber, convertDouble,
indexOfComma, encodeBase64, decodeBase64, decodeBase64SomeChars,
clearUndefinedChars
Diffstat (limited to 'reportdesign/source')
-rw-r--r-- | reportdesign/source/filter/xml/xmlControlProperty.cxx | 15 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlExport.cxx | 3 |
2 files changed, 10 insertions, 8 deletions
diff --git a/reportdesign/source/filter/xml/xmlControlProperty.cxx b/reportdesign/source/filter/xml/xmlControlProperty.cxx index 848ce3b6785a..8fa12cc929dc 100644 --- a/reportdesign/source/filter/xml/xmlControlProperty.cxx +++ b/reportdesign/source/filter/xml/xmlControlProperty.cxx @@ -26,8 +26,10 @@ * ************************************************************************/ #include "precompiled_rptxml.hxx" + #include "xmlControlProperty.hxx" -#include <xmloff/xmluconv.hxx> + +#include <sax/tools/converter.hxx> #include "xmlfilter.hxx" #include <xmloff/xmltoken.hxx> #include <xmloff/xmlnmspe.hxx> @@ -199,17 +201,16 @@ ORptFilter& OXMLControlProperty::GetOwnImport() // ----------------------------------------------------------------------------- Any OXMLControlProperty::convertString(const ::com::sun::star::uno::Type& _rExpectedType, const ::rtl::OUString& _rReadCharacters) { - ORptFilter& rImporter = GetOwnImport(); Any aReturn; switch (_rExpectedType.getTypeClass()) { case TypeClass_BOOLEAN: // sal_Bool { - bool bValue; + bool bValue(false); #if OSL_DEBUG_LEVEL > 0 sal_Bool bSuccess = #endif - rImporter.GetMM100UnitConverter().convertBool(bValue, _rReadCharacters); + ::sax::Converter::convertBool(bValue, _rReadCharacters); OSL_ENSURE(bSuccess, ::rtl::OStringBuffer("OXMLControlProperty::convertString: could not convert \""). append(::rtl::OUStringToOString(_rReadCharacters, RTL_TEXTENCODING_ASCII_US)). @@ -224,7 +225,7 @@ Any OXMLControlProperty::convertString(const ::com::sun::star::uno::Type& _rExpe #if OSL_DEBUG_LEVEL > 0 sal_Bool bSuccess = #endif - rImporter.GetMM100UnitConverter().convertNumber(nValue, _rReadCharacters); + ::sax::Converter::convertNumber(nValue, _rReadCharacters); OSL_ENSURE(bSuccess, ::rtl::OStringBuffer("OXMLControlProperty::convertString: could not convert \""). append(rtl::OUStringToOString(_rReadCharacters, RTL_TEXTENCODING_ASCII_US)). @@ -246,7 +247,7 @@ Any OXMLControlProperty::convertString(const ::com::sun::star::uno::Type& _rExpe #if OSL_DEBUG_LEVEL > 0 sal_Bool bSuccess = #endif - rImporter.GetMM100UnitConverter().convertDouble(nValue, _rReadCharacters); + ::sax::Converter::convertDouble(nValue, _rReadCharacters); OSL_ENSURE(bSuccess, ::rtl::OStringBuffer("OXMLControlProperty::convertString: could not convert \""). append(::rtl::OUStringToOString(_rReadCharacters, RTL_TEXTENCODING_ASCII_US)). @@ -277,7 +278,7 @@ Any OXMLControlProperty::convertString(const ::com::sun::star::uno::Type& _rExpe #if OSL_DEBUG_LEVEL > 0 sal_Bool bSuccess = #endif - rImporter.GetMM100UnitConverter().convertDouble(nValue, _rReadCharacters); + ::sax::Converter::convertDouble(nValue, _rReadCharacters); OSL_ENSURE(bSuccess, ::rtl::OStringBuffer("OPropertyImport::convertString: could not convert \""). append(rtl::OUStringToOString(_rReadCharacters, RTL_TEXTENCODING_ASCII_US)). diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx index 9d986e5ac868..6bace826d7a6 100644 --- a/reportdesign/source/filter/xml/xmlExport.cxx +++ b/reportdesign/source/filter/xml/xmlExport.cxx @@ -45,6 +45,7 @@ #include "xmlHelper.hxx" #include "xmlstrings.hrc" #include "xmlPropertyHandler.hxx" +#include <sax/tools/converter.hxx> #include <com/sun/star/awt/ImagePosition.hpp> #include <com/sun/star/util/NumberFormat.hpp> #include <com/sun/star/style/ParagraphAdjust.hpp> @@ -1398,7 +1399,7 @@ sal_uInt32 ORptExport::exportDoc(enum ::xmloff::token::XMLTokenEnum eClass) ::rtl::OUString ORptExport::implConvertNumber(sal_Int32 _nValue) { ::rtl::OUStringBuffer aBuffer; - GetMM100UnitConverter().convertNumber(aBuffer, _nValue); + ::sax::Converter::convertNumber(aBuffer, _nValue); return aBuffer.makeStringAndClear(); } // ----------------------------------------------------------------------------- |