summaryrefslogtreecommitdiffstats
path: root/dbaccess/source
diff options
context:
space:
mode:
authorMichael Stahl <mst@openoffice.org>2011-10-11 14:19:00 +0200
committerMichael Stahl <mst@openoffice.org>2011-10-11 17:57:00 +0200
commit3ca2bef76886450058d1667703aeafe4c2e456c3 (patch)
treeb18d70f79bfcfd2b2e34790e86edafb4c4337a80 /dbaccess/source
parentpartially revert 849a713ffd29a58ae79e48f80835c28bbd9d5a72 (diff)
downloadcore-3ca2bef76886450058d1667703aeafe4c2e456c3.tar.gz
core-3ca2bef76886450058d1667703aeafe4c2e456c3.zip
#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/source')
-rw-r--r--dbaccess/source/core/recovery/settingsimport.cxx14
-rw-r--r--dbaccess/source/filter/xml/xmlDataSourceSetting.cxx11
-rw-r--r--dbaccess/source/filter/xml/xmlExport.cxx5
3 files changed, 17 insertions, 13 deletions
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");