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 /dbaccess | |
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 'dbaccess')
-rw-r--r-- | dbaccess/Library_dba.mk | 1 | ||||
-rw-r--r-- | dbaccess/Library_dbaxml.mk | 1 | ||||
-rw-r--r-- | dbaccess/source/core/recovery/settingsimport.cxx | 14 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlDataSourceSetting.cxx | 11 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlExport.cxx | 5 |
5 files changed, 19 insertions, 13 deletions
diff --git a/dbaccess/Library_dba.mk b/dbaccess/Library_dba.mk index 69501aa680c4..cd9edf1bd967 100644 --- a/dbaccess/Library_dba.mk +++ b/dbaccess/Library_dba.mk @@ -61,6 +61,7 @@ $(eval $(call gb_Library_add_linked_libs,dba,\ i18nisolang1 \ sal \ salhelper \ + sax \ sb \ sfx \ svl \ diff --git a/dbaccess/Library_dbaxml.mk b/dbaccess/Library_dbaxml.mk index 7a3866d295f1..d9ae7eae7c02 100644 --- a/dbaccess/Library_dbaxml.mk +++ b/dbaccess/Library_dbaxml.mk @@ -49,6 +49,7 @@ $(eval $(call gb_Library_add_linked_libs,dbaxml,\ dba \ dbtools \ sal \ + sax \ sfx \ svl \ tk \ diff --git a/dbaccess/source/core/recovery/settingsimport.cxx b/dbaccess/source/core/recovery/settingsimport.cxx index 397c97eeb34c..fae9f58a4360 100644 --- a/dbaccess/source/core/recovery/settingsimport.cxx +++ b/dbaccess/source/core/recovery/settingsimport.cxx @@ -32,8 +32,8 @@ /** === end UNO includes === **/ #include <tools/diagnose_ex.h> +#include <sax/tools/converter.hxx> #include <xmloff/xmltoken.hxx> -#include <xmloff/xmluconv.hxx> //........................................................................ namespace dbaccess @@ -216,8 +216,10 @@ namespace dbaccess if ( ::xmloff::token::IsXMLToken( rItemType, ::xmloff::token::XML_INT ) ) { sal_Int32 nValue(0); - if ( SvXMLUnitConverter::convertNumber( nValue, sValue ) ) + if (::sax::Converter::convertNumber( nValue, sValue )) + { o_rValue <<= nValue; + } else { OSL_FAIL( "ConfigItemImport::getItemValue: could not convert an int value!" ); @@ -225,9 +227,11 @@ namespace dbaccess } else if ( ::xmloff::token::IsXMLToken( rItemType, ::xmloff::token::XML_BOOLEAN ) ) { - bool nValue( sal_False ); - if ( SvXMLUnitConverter::convertBool( nValue, sValue ) ) - o_rValue <<= nValue; + bool bValue(false); + if (::sax::Converter::convertBool( bValue, sValue )) + { + o_rValue <<= bValue; + } else { OSL_FAIL( "ConfigItemImport::getItemValue: could not convert a boolean value!" ); diff --git a/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx b/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx index 1e16bfc0f3ab..92a62bd403c8 100644 --- a/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx +++ b/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx @@ -30,7 +30,7 @@ #include "precompiled_dbaccess.hxx" #include "xmlDataSourceSetting.hxx" #include "xmlDataSource.hxx" -#include <xmloff/xmluconv.hxx> +#include <sax/tools/converter.hxx> #include "xmlfilter.hxx" #include <xmloff/xmltoken.hxx> #include <xmloff/xmlnmspe.hxx> @@ -183,17 +183,16 @@ ODBFilter& OXMLDataSourceSetting::GetOwnImport() // ----------------------------------------------------------------------------- Any OXMLDataSourceSetting::convertString(const ::com::sun::star::uno::Type& _rExpectedType, const ::rtl::OUString& _rReadCharacters) { - ODBFilter& 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("OXMLDataSourceSetting::convertString: could not convert \"") .append(::rtl::OUStringToOString(_rReadCharacters, RTL_TEXTENCODING_ASCII_US)) @@ -208,7 +207,7 @@ Any OXMLDataSourceSetting::convertString(const ::com::sun::star::uno::Type& _rEx #if OSL_DEBUG_LEVEL > 0 sal_Bool bSuccess = #endif - rImporter.GetMM100UnitConverter().convertNumber(nValue, _rReadCharacters); + ::sax::Converter::convertNumber(nValue, _rReadCharacters); OSL_ENSURE(bSuccess, ::rtl::OStringBuffer("OXMLDataSourceSetting::convertString: could not convert \"") .append(::rtl::OUStringToOString(_rReadCharacters, RTL_TEXTENCODING_ASCII_US)) @@ -230,7 +229,7 @@ Any OXMLDataSourceSetting::convertString(const ::com::sun::star::uno::Type& _rEx #if OSL_DEBUG_LEVEL > 0 sal_Bool bSuccess = #endif - rImporter.GetMM100UnitConverter().convertDouble(nValue, _rReadCharacters); + ::sax::Converter::convertDouble(nValue, _rReadCharacters); OSL_ENSURE(bSuccess, ::rtl::OStringBuffer("OXMLDataSourceSetting::convertString: could not convert \"") .append(rtl::OUStringToOString(_rReadCharacters, RTL_TEXTENCODING_ASCII_US)) diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx index 783d9df38e45..b120de87b3f3 100644 --- a/dbaccess/source/filter/xml/xmlExport.cxx +++ b/dbaccess/source/filter/xml/xmlExport.cxx @@ -32,6 +32,7 @@ #include "xmlExport.hxx" #include "xmlAutoStyle.hxx" #include "flt_reghelper.hxx" +#include <sax/tools/converter.hxx> #include <xmloff/ProgressBarHelper.hxx> #include <xmloff/xmltoken.hxx> #include <xmloff/txtimp.hxx> @@ -1379,7 +1380,7 @@ void ODBExport::GetConfigurationSettings(Sequence<PropertyValue>& aProps) break; case TypeClass_DOUBLE: // let the unit converter format is as string - GetMM100UnitConverter().convertDouble(aBuffer, getDouble(_rValue)); + ::sax::Converter::convertDouble(aBuffer, getDouble(_rValue)); break; case TypeClass_BOOLEAN: aBuffer = getBOOL(_rValue) ? ::xmloff::token::GetXMLToken(XML_TRUE) : ::xmloff::token::GetXMLToken(XML_FALSE); @@ -1388,7 +1389,7 @@ void ODBExport::GetConfigurationSettings(Sequence<PropertyValue>& aProps) case TypeClass_SHORT: case TypeClass_LONG: // let the unit converter format is as string - GetMM100UnitConverter().convertNumber(aBuffer, getINT32(_rValue)); + ::sax::Converter::convertNumber(aBuffer, getINT32(_rValue)); break; default: OSL_FAIL("ODBExport::implConvertAny: Invalid type"); |