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 /xmloff/source/xforms | |
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 'xmloff/source/xforms')
-rw-r--r-- | xmloff/source/xforms/SchemaRestrictionContext.cxx | 8 | ||||
-rw-r--r-- | xmloff/source/xforms/XFormsSubmissionContext.cxx | 7 | ||||
-rw-r--r-- | xmloff/source/xforms/xformsexport.cxx | 7 |
3 files changed, 14 insertions, 8 deletions
diff --git a/xmloff/source/xforms/SchemaRestrictionContext.cxx b/xmloff/source/xforms/SchemaRestrictionContext.cxx index befc06a7e521..5b61c1354927 100644 --- a/xmloff/source/xforms/SchemaRestrictionContext.cxx +++ b/xmloff/source/xforms/SchemaRestrictionContext.cxx @@ -39,6 +39,8 @@ #include <xmloff/xmluconv.hxx> #include <xmloff/xmlimp.hxx> +#include <sax/tools/converter.hxx> + #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/uno/Type.hxx> #include <com/sun/star/util/Date.hpp> @@ -157,14 +159,14 @@ Any lcl_string( const OUString& rValue ) Any lcl_int32( const OUString& rValue ) { sal_Int32 nValue; - bool bSuccess = SvXMLUnitConverter::convertNumber( nValue, rValue ); + bool bSuccess = ::sax::Converter::convertNumber( nValue, rValue ); return bSuccess ? makeAny( nValue ) : Any(); } Any lcl_int16( const OUString& rValue ) { sal_Int32 nValue; - bool bSuccess = SvXMLUnitConverter::convertNumber( nValue, rValue ); + bool bSuccess = ::sax::Converter::convertNumber( nValue, rValue ); return bSuccess ? makeAny( static_cast<sal_Int16>( nValue ) ) : Any(); } @@ -183,7 +185,7 @@ Any lcl_whitespace( const OUString& rValue ) Any lcl_double( const OUString& rValue ) { double fValue; - bool bSuccess = SvXMLUnitConverter::convertDouble( fValue, rValue ); + bool bSuccess = ::sax::Converter::convertDouble( fValue, rValue ); return bSuccess ? makeAny( fValue ) : Any(); } diff --git a/xmloff/source/xforms/XFormsSubmissionContext.cxx b/xmloff/source/xforms/XFormsSubmissionContext.cxx index e86bfc7701bb..92ceb000c69d 100644 --- a/xmloff/source/xforms/XFormsSubmissionContext.cxx +++ b/xmloff/source/xforms/XFormsSubmissionContext.cxx @@ -39,7 +39,8 @@ #include <xmloff/xmltkmap.hxx> #include "xmloff/xmlnmspe.hxx" #include <xmloff/nmspmap.hxx> -#include <xmloff/xmluconv.hxx> + +#include <sax/tools/converter.hxx> #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/xforms/XModel.hpp> @@ -106,8 +107,8 @@ XFormsSubmissionContext::~XFormsSubmissionContext() Any toBool( const OUString& rValue ) { Any aValue; - bool bValue; - if( SvXMLUnitConverter::convertBool( bValue, rValue ) ) + bool bValue(false); + if (::sax::Converter::convertBool( bValue, rValue )) { aValue <<= ( bValue ? true : false ); } diff --git a/xmloff/source/xforms/xformsexport.cxx b/xmloff/source/xforms/xformsexport.cxx index afd8731473b3..54561d70f522 100644 --- a/xmloff/source/xforms/xformsexport.cxx +++ b/xmloff/source/xforms/xformsexport.cxx @@ -40,6 +40,9 @@ #include <xmloff/nmspmap.hxx> #include "DomExport.hxx" #include <xmloff/xmluconv.hxx> + +#include <sax/tools/converter.hxx> + #include <comphelper/componentcontext.hxx> #include <comphelper/processfactory.hxx> @@ -149,8 +152,8 @@ void lcl_formatDate( OUStringBuffer& aBuffer, const Date& aDate ); void lcl_formatTime( OUStringBuffer& aBuffer, const com::sun::star::util::Time& aTime ); void lcl_formatDateTime( OUStringBuffer& aBuffer, const DateTime& aDateTime ); -convert_t lcl_int32 = &lcl_convert<sal_Int32,&SvXMLUnitConverter::convertNumber>; -convert_t lcl_double = &lcl_convert<double,&SvXMLUnitConverter::convertDouble>; +convert_t lcl_int32 = &lcl_convert<sal_Int32,&::sax::Converter::convertNumber>; +convert_t lcl_double = &lcl_convert<double,&::sax::Converter::convertDouble>; convert_t lcl_dateTime = &lcl_convertRef<DateTime,&lcl_formatDateTime>; convert_t lcl_date = &lcl_convertRef<Date,&lcl_formatDate>; convert_t lcl_time = &lcl_convertRef<com::sun::star::util::Time,&lcl_formatTime>; |