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 | |
parent | partially revert 849a713ffd29a58ae79e48f80835c28bbd9d5a72 (diff) | |
download | core-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 'xmloff')
112 files changed, 937 insertions, 1162 deletions
diff --git a/xmloff/Library_xo.mk b/xmloff/Library_xo.mk index 95c2d332d2d9..333c486274c9 100644 --- a/xmloff/Library_xo.mk +++ b/xmloff/Library_xo.mk @@ -57,6 +57,7 @@ $(eval $(call gb_Library_add_linked_libs,xo,\ i18nisolang1 \ sal \ salhelper \ + sax \ svl \ tl \ utl \ diff --git a/xmloff/Library_xof.mk b/xmloff/Library_xof.mk index e855693314fa..c602d3902738 100644 --- a/xmloff/Library_xof.mk +++ b/xmloff/Library_xof.mk @@ -47,6 +47,7 @@ $(eval $(call gb_Library_add_linked_libs,xof,\ cppuhelper \ sal \ salhelper \ + sax \ xo \ $(gb_STDLIBS) \ )) diff --git a/xmloff/inc/xmloff/shapeimport.hxx b/xmloff/inc/xmloff/shapeimport.hxx index 564abd460b87..5de8adf632ff 100644 --- a/xmloff/inc/xmloff/shapeimport.hxx +++ b/xmloff/inc/xmloff/shapeimport.hxx @@ -189,7 +189,7 @@ enum SdXML3DLightAttrTokenMap class SdXML3DLightContext: public SvXMLImportContext { // local parameters which need to be read - Color maDiffuseColor; + sal_Int32 maDiffuseColor; ::basegfx::B3DVector maDirection; bool mbEnabled; bool mbSpecular; @@ -202,7 +202,7 @@ public: const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList); virtual ~SdXML3DLightContext(); - const Color& GetDiffuseColor() { return maDiffuseColor; } + sal_Int32 GetDiffuseColor() { return maDiffuseColor; } const ::basegfx::B3DVector& GetDirection() { return maDirection; } sal_Bool GetEnabled() { return mbEnabled; } sal_Bool GetSpecular() { return mbSpecular; } @@ -229,7 +229,7 @@ protected: sal_Int32 mnFocalLength; sal_Int32 mnShadowSlant; com::sun::star::drawing::ShadeMode mxShadeMode; - Color maAmbientColor; + sal_Int32 maAmbientColor; bool mbLightingMode; ::basegfx::B3DVector maVRP; diff --git a/xmloff/inc/xmloff/xmlnumfi.hxx b/xmloff/inc/xmloff/xmlnumfi.hxx index d5ccc45354ff..d00169641f9f 100644 --- a/xmloff/inc/xmloff/xmlnumfi.hxx +++ b/xmloff/inc/xmloff/xmlnumfi.hxx @@ -215,7 +215,7 @@ public: void AddCondition( const sal_Int32 nIndex ); void AddCondition( const sal_Int32 nIndex, const rtl::OUString& rFormat, const LocaleDataWrapper& rData ); void AddCondition( const rtl::OUString& rCondition, const rtl::OUString& rApplyName ); - void AddColor( const Color& rColor ); + void AddColor( sal_uInt32 const nColor ); /// determine whether number format uses the system language sal_Bool IsSystemLanguage(); diff --git a/xmloff/inc/xmloff/xmluconv.hxx b/xmloff/inc/xmloff/xmluconv.hxx index f73641c78c71..1ca051b888bd 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/color.hxx> #include <tools/mapunit.hxx> #include <xmloff/xmlement.hxx> #include <xmloff/xmltoken.hxx> @@ -168,22 +167,6 @@ public: MapUnit eSrcUnit, MapUnit eDstUnit ); - /** convert string to boolean */ - static sal_Bool convertBool( bool& rBool, - const ::rtl::OUString& rString ); - - /** convert boolean to string */ - static void convertBool( ::rtl::OUStringBuffer& rBuffer, - sal_Bool bValue ); - - /** convert string to percent */ - static sal_Bool convertPercent( sal_Int32& rValue, - const ::rtl::OUString& rString ); - - /** convert percent to string */ - static void convertPercent( ::rtl::OUStringBuffer& rBuffer, - sal_Int32 nValue ); - /** convert string to pixel measure unite */ static sal_Bool convertMeasurePx( sal_Int32& rValue, const ::rtl::OUString& rString ); @@ -223,58 +206,15 @@ public: const SvXMLEnumStringMapEntry *pMap, sal_Char* pDefault = NULL ); - /** convert string to color */ - static sal_Bool convertColor( Color& rColor, - const ::rtl::OUString&rValue ); - - /** convert color to string */ - static void convertColor( ::rtl::OUStringBuffer &rBuffer, - const Color& rCol ); - - /** convert number to string */ - static void convertNumber( ::rtl::OUStringBuffer& rBuffer, - sal_Int32 nNumber ); - - /** convert string to number with optional min and max values */ - static sal_Bool convertNumber( sal_Int32& rValue, - const ::rtl::OUString& rString, - sal_Int32 nMin = SAL_MIN_INT32, - sal_Int32 nMax = SAL_MAX_INT32); - - /** convert number to string */ - static void convertNumber64( ::rtl::OUStringBuffer& rBuffer, - sal_Int64 nNumber ); - - /** convert string to number with optional min and max values */ - static sal_Bool convertNumber64( sal_Int64& rValue, - const ::rtl::OUString& rString, - sal_Int64 nMin = SAL_MIN_INT64, - sal_Int64 nMax = SAL_MAX_INT64); /** convert double number to string (using ::rtl::math) and DO - convert to export MapUnit */ + convert to export MapUnit using meCoreMeasureUnit/meXMLMeasureUnit */ void convertDouble(::rtl::OUStringBuffer& rBuffer, double fNumber, sal_Bool bWriteUnits) const; - /** convert double number to string (using ::rtl::math) and - DO convert from eSrcUnit to export MapUnit */ - static void convertDouble( ::rtl::OUStringBuffer& rBuffer, - double fNumber, sal_Bool bWriteUnits, MapUnit eCoreUnit, MapUnit eDstUnit); - - /** convert double number to string (using ::rtl::math) without unit conversion */ - static void convertDouble( ::rtl::OUStringBuffer& rBuffer, double fNumber); - /** convert string to double number (using ::rtl::math) and DO convert. */ sal_Bool convertDouble(double& rValue, const ::rtl::OUString& rString, sal_Bool bLookForUnits) const; - /** convert string to double number (using ::rtl::math) and DO convert from - SrcUnit to DstUnit. */ - static sal_Bool convertDouble(double& rValue, - const ::rtl::OUString& rString, MapUnit eSrcUnit, MapUnit eCoreUnit); - - /** convert string to double number (using ::rtl::math) without unit conversion */ - static sal_Bool convertDouble(double& rValue, const ::rtl::OUString& rString); - /** get the Null Date of the XModel and set it to the UnitConverter */ sal_Bool setNullDate ( const com::sun::star::uno::Reference <com::sun::star::frame::XModel>& xModel); @@ -369,21 +309,6 @@ public: static sal_Bool convertDateTime( com::sun::star::util::DateTime& rDateTime, const ::rtl::OUString& rString ); - /** gets the position of the first comma after npos in the string - rStr. Commas inside '"' pairs are not matched */ - static sal_Int32 indexOfComma( const ::rtl::OUString& rStr, - sal_Int32 nPos ); - - static void encodeBase64(rtl::OUStringBuffer& aStrBuffer, const com::sun::star::uno::Sequence<sal_Int8>& aPass); - - // Decode a base 64 encoded string into a sequence of bytes. The first - // version can be used for attribute values only, bacause it does not - // return any chars left from conversion. - // For text submitted throgh the SAX characters call, the later method - // must be used! - static void decodeBase64(com::sun::star::uno::Sequence<sal_Int8>& aPass, const rtl::OUString& sBuffer); - - static sal_Int32 decodeBase64SomeChars(com::sun::star::uno::Sequence<sal_Int8>& aPass, const rtl::OUString& sBuffer); /** convert num-forat and num-letter-sync values to NumberingType */ sal_Bool convertNumFormat( sal_Int16& rType, @@ -402,8 +327,6 @@ public: static void convertPropertySet(com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>& rProperties, const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps); - static void clearUndefinedChars(rtl::OUString& rTarget, const rtl::OUString& rSource); - ::rtl::OUString encodeStyleName( const ::rtl::OUString& rName, sal_Bool *pEncoded=0 ) const; diff --git a/xmloff/prj/build.lst b/xmloff/prj/build.lst index 1a8261d7a37e..bcaae91a7b19 100644 --- a/xmloff/prj/build.lst +++ b/xmloff/prj/build.lst @@ -1,2 +1,2 @@ -xo xmloff : LIBXSLT:libxslt offapi svl NULL +xo xmloff : LIBXSLT:libxslt offapi svl sax NULL xo xmloff\prj nmake - all xo_prj NULL diff --git a/xmloff/source/chart/PropertyMaps.cxx b/xmloff/source/chart/PropertyMaps.cxx index f49e1b571fc6..7666cc800e48 100644 --- a/xmloff/source/chart/PropertyMaps.cxx +++ b/xmloff/source/chart/PropertyMaps.cxx @@ -37,6 +37,8 @@ #undef XML_SCH_CREATE_GLOBAL_MAPS #endif +#include <sax/tools/converter.hxx> + #include "XMLChartPropertySetMapper.hxx" #include "SchXMLTools.hxx" #include <xmloff/EnumPropertyHdl.hxx> @@ -382,20 +384,20 @@ void XMLChartExportPropertyMapper::handleSpecialItem( case XML_SCH_CONTEXT_SPECIAL_TICKS_MIN_INNER: rProperty.maValue >>= nValue; bValue = (( nValue & chart::ChartAxisMarks::INNER ) == chart::ChartAxisMarks::INNER ); - SvXMLUnitConverter::convertBool( sValueBuffer, bValue ); + ::sax::Converter::convertBool( sValueBuffer, bValue ); break; case XML_SCH_CONTEXT_SPECIAL_TICKS_MAJ_OUTER: case XML_SCH_CONTEXT_SPECIAL_TICKS_MIN_OUTER: rProperty.maValue >>= nValue; bValue = (( nValue & chart::ChartAxisMarks::OUTER ) == chart::ChartAxisMarks::OUTER ); - SvXMLUnitConverter::convertBool( sValueBuffer, bValue ); + ::sax::Converter::convertBool( sValueBuffer, bValue ); break; case XML_SCH_CONTEXT_SPECIAL_TEXT_ROTATION: { // convert from 100th degrees to degrees (double) rProperty.maValue >>= nValue; double fVal = (double)(nValue) / 100.0; - SvXMLUnitConverter::convertDouble( sValueBuffer, fVal ); + ::sax::Converter::convertDouble( sValueBuffer, fVal ); } break; case XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_NUMBER: @@ -423,12 +425,12 @@ void XMLChartExportPropertyMapper::handleSpecialItem( case XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_TEXT: rProperty.maValue >>= nValue; bValue = (( nValue & chart::ChartDataCaption::TEXT ) == chart::ChartDataCaption::TEXT ); - SvXMLUnitConverter::convertBool( sValueBuffer, bValue ); + ::sax::Converter::convertBool( sValueBuffer, bValue ); break; case XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_SYMBOL: rProperty.maValue >>= nValue; bValue = (( nValue & chart::ChartDataCaption::SYMBOL ) == chart::ChartDataCaption::SYMBOL ); - SvXMLUnitConverter::convertBool( sValueBuffer, bValue ); + ::sax::Converter::convertBool( sValueBuffer, bValue ); break; case XML_SCH_CONTEXT_SPECIAL_SYMBOL_WIDTH: @@ -516,7 +518,7 @@ bool XMLChartImportPropertyMapper::handleSpecialItem( { case XML_SCH_CONTEXT_SPECIAL_TICKS_MAJ_INNER: case XML_SCH_CONTEXT_SPECIAL_TICKS_MIN_INNER: - SvXMLUnitConverter::convertBool( bValue, rValue ); + ::sax::Converter::convertBool( bValue, rValue ); // modify old value rProperty.maValue >>= nValue; if( bValue ) @@ -527,7 +529,7 @@ bool XMLChartImportPropertyMapper::handleSpecialItem( break; case XML_SCH_CONTEXT_SPECIAL_TICKS_MAJ_OUTER: case XML_SCH_CONTEXT_SPECIAL_TICKS_MIN_OUTER: - SvXMLUnitConverter::convertBool( bValue, rValue ); + ::sax::Converter::convertBool( bValue, rValue ); // modify old value rProperty.maValue >>= nValue; if( bValue ) @@ -540,7 +542,7 @@ bool XMLChartImportPropertyMapper::handleSpecialItem( { // convert from degrees (double) to 100th degrees (integer) double fVal; - SvXMLUnitConverter::convertDouble( fVal, rValue ); + ::sax::Converter::convertDouble( fVal, rValue ); nValue = (sal_Int32)( fVal * 100.0 ); rProperty.maValue <<= nValue; } @@ -562,7 +564,7 @@ bool XMLChartImportPropertyMapper::handleSpecialItem( break; case XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_TEXT: rProperty.maValue >>= nValue; - SvXMLUnitConverter::convertBool( bValue, rValue ); + ::sax::Converter::convertBool( bValue, rValue ); if( bValue ) SCH_XML_SETFLAG( nValue, chart::ChartDataCaption::TEXT ); else @@ -571,7 +573,7 @@ bool XMLChartImportPropertyMapper::handleSpecialItem( break; case XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_SYMBOL: rProperty.maValue >>= nValue; - SvXMLUnitConverter::convertBool( bValue, rValue ); + ::sax::Converter::convertBool( bValue, rValue ); if( bValue ) SCH_XML_SETFLAG( nValue, chart::ChartDataCaption::SYMBOL ); else diff --git a/xmloff/source/chart/SchXMLAxisContext.cxx b/xmloff/source/chart/SchXMLAxisContext.cxx index 05f7b1304a8c..aa53f6e138bf 100644 --- a/xmloff/source/chart/SchXMLAxisContext.cxx +++ b/xmloff/source/chart/SchXMLAxisContext.cxx @@ -29,6 +29,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" +#include <sax/tools/converter.hxx> + #include "SchXMLAxisContext.hxx" #include "SchXMLChartContext.hxx" #include "SchXMLTools.hxx" @@ -1012,7 +1014,7 @@ void DateScaleContext::StartElement( const Reference< xml::sax::XAttributeList > { chart::TimeInterval aInterval(1,0); aIncrement.MajorTimeInterval >>= aInterval; - SvXMLUnitConverter::convertNumber( aInterval.Number, aValue ); + ::sax::Converter::convertNumber( aInterval.Number, aValue ); aIncrement.MajorTimeInterval = uno::makeAny(aInterval); bSetNewIncrement = true; } @@ -1030,7 +1032,7 @@ void DateScaleContext::StartElement( const Reference< xml::sax::XAttributeList > { chart::TimeInterval aInterval(1,0); aIncrement.MinorTimeInterval >>= aInterval; - SvXMLUnitConverter::convertNumber( aInterval.Number, aValue ); + ::sax::Converter::convertNumber( aInterval.Number, aValue ); aIncrement.MinorTimeInterval = uno::makeAny(aInterval); bSetNewIncrement = true; } diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index f3c1534e31f3..9bd03631a28e 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -29,6 +29,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" +#include <sax/tools/converter.hxx> + #include <xmloff/xmlprmap.hxx> #include "SchXMLExport.hxx" @@ -1504,7 +1506,9 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >& awt::Size aSize( xLegendShape->getSize() ); addSize( aSize, true ); rtl::OUStringBuffer aAspectRatioString; - SvXMLUnitConverter::convertDouble(aAspectRatioString, double(aSize.Width)/double(aSize.Height)); + ::sax::Converter::convertDouble( + aAspectRatioString, + double(aSize.Width)/double(aSize.Height)); mrExport.AddAttribute( XML_NAMESPACE_STYLE, XML_LEGEND_EXPANSION_ASPECT_RATIO, aAspectRatioString.makeStringAndClear() ); } } @@ -1770,7 +1774,8 @@ void SchXMLExportHelper_Impl::exportTable() { bExportString = false; - SvXMLUnitConverter::convertDouble( msStringBuffer, fValue ); + ::sax::Converter::convertDouble( + msStringBuffer, fValue); msString = msStringBuffer.makeStringAndClear(); mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_FLOAT ); mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE, msString ); @@ -1824,7 +1829,7 @@ void SchXMLExportHelper_Impl::exportTable() { bExportString = false; - SvXMLUnitConverter::convertDouble( msStringBuffer, fValue ); + ::sax::Converter::convertDouble(msStringBuffer, fValue); msString = msStringBuffer.makeStringAndClear(); mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_FLOAT ); mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE, msString ); @@ -1856,7 +1861,7 @@ void SchXMLExportHelper_Impl::exportTable() for( t2DNumberContainer::value_type::const_iterator aColIt( aRowIt->begin()); aColIt != aRowIt->end(); ++aColIt ) { - SvXMLUnitConverter::convertDouble( msStringBuffer, *aColIt ); + ::sax::Converter::convertDouble( msStringBuffer, *aColIt ); msString = msStringBuffer.makeStringAndClear(); mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_FLOAT ); mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE, msString ); @@ -2299,13 +2304,13 @@ void SchXMLExportHelper_Impl::exportDateScale( const Reference< beans::XProperty chart::TimeInterval aInterval; if( aIncrement.MajorTimeInterval >>= aInterval ) { - SvXMLUnitConverter::convertNumber( aValue, aInterval.Number ); + ::sax::Converter::convertNumber( aValue, aInterval.Number ); mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_MAJOR_INTERVAL_VALUE, aValue.makeStringAndClear() ); mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_MAJOR_INTERVAL_UNIT, lcl_getTimeUnitToken( aInterval.TimeUnit ) ); } if( aIncrement.MinorTimeInterval >>= aInterval ) { - SvXMLUnitConverter::convertNumber( aValue, aInterval.Number ); + ::sax::Converter::convertNumber( aValue, aInterval.Number ); mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_MINOR_INTERVAL_VALUE, aValue.makeStringAndClear() ); mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_MINOR_INTERVAL_UNIT, lcl_getTimeUnitToken( aInterval.TimeUnit ) ); } diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx index 249b1d53ce21..ceeaa69f3982 100644 --- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx +++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx @@ -29,6 +29,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" +#include <sax/tools/converter.hxx> + #include "SchXMLPlotAreaContext.hxx" #include "SchXMLImport.hxx" #include "SchXMLAxisContext.hxx" @@ -1122,10 +1124,10 @@ void SchXMLEquationContext::StartElement( const uno::Reference< xml::sax::XAttri bHasYPos = true; break; case XML_TOK_REGEQ_DISPLAY_EQUATION: - rImport.GetMM100UnitConverter().convertBool( bShowEquation, aValue ); + ::sax::Converter::convertBool(bShowEquation, aValue); break; case XML_TOK_REGEQ_DISPLAY_R_SQUARE: - rImport.GetMM100UnitConverter().convertBool( bShowRSquare, aValue ); + ::sax::Converter::convertBool(bShowRSquare, aValue); break; case XML_TOK_REGEQ_STYLE_NAME: sAutoStyleName = aValue; diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx index 55e5f3d9e358..4b3a6e767610 100644 --- a/xmloff/source/chart/SchXMLTableContext.cxx +++ b/xmloff/source/chart/SchXMLTableContext.cxx @@ -29,6 +29,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" +#include <sax/tools/converter.hxx> + #include "SchXMLTableContext.hxx" #include "SchXMLParagraphContext.hxx" #include "SchXMLTextListContext.hxx" @@ -41,7 +43,6 @@ #include "xmloff/xmlnmspe.hxx" #include <xmloff/xmltoken.hxx> #include <xmloff/nmspmap.hxx> -#include <xmloff/xmluconv.hxx> #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/chart2/XAnyDescriptionAccess.hpp> #include <com/sun/star/chart2/XDataSeriesContainer.hpp> @@ -707,7 +708,7 @@ void SchXMLTableCellContext::StartElement( const uno::Reference< xml::sax::XAttr { double fData; // the result may be false if a NaN is read, but that's ok - SvXMLUnitConverter::convertDouble( fData, aCellContent ); + ::sax::Converter::convertDouble( fData, aCellContent ); aCell.fValue = fData; // dont read text from following <text:p> or <text:list> element diff --git a/xmloff/source/chart/XMLAxisPositionPropertyHdl.cxx b/xmloff/source/chart/XMLAxisPositionPropertyHdl.cxx index 74700f6b16ab..9e89d1a5f8ad 100644 --- a/xmloff/source/chart/XMLAxisPositionPropertyHdl.cxx +++ b/xmloff/source/chart/XMLAxisPositionPropertyHdl.cxx @@ -28,11 +28,19 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" + #include "XMLAxisPositionPropertyHdl.hxx" -#include <xmloff/xmluconv.hxx> -#include <com/sun/star/chart/ChartAxisPosition.hpp> + #include <rtl/ustrbuf.hxx> +#include <com/sun/star/uno/Any.hxx> +#include <com/sun/star/chart/ChartAxisPosition.hpp> + +#include <sax/tools/converter.hxx> + +#include <xmloff/xmltoken.hxx> + + using namespace ::xmloff::token; using ::rtl::OUString; using ::rtl::OUStringBuffer; @@ -77,7 +85,7 @@ sal_Bool XMLAxisPositionPropertyHdl::importXML( const OUString& rStrImpValue, else { double fDblValue=0.0; - bResult = SvXMLUnitConverter::convertDouble( fDblValue, rStrImpValue ); + bResult = ::sax::Converter::convertDouble(fDblValue, rStrImpValue); rValue <<= fDblValue; } } @@ -97,7 +105,7 @@ sal_Bool XMLAxisPositionPropertyHdl::exportXML( OUString& rStrExpValue, { double fValue = 0.0; rValue >>= fValue; - SvXMLUnitConverter::convertDouble( sValueBuffer, fValue ); + ::sax::Converter::convertDouble( sValueBuffer, fValue ); rStrExpValue = sValueBuffer.makeStringAndClear(); bResult = true; } @@ -117,7 +125,7 @@ sal_Bool XMLAxisPositionPropertyHdl::exportXML( OUString& rStrExpValue, bResult = true; break; case ::com::sun::star::chart::ChartAxisPosition_ZERO: - SvXMLUnitConverter::convertDouble( sValueBuffer, 0.0 ); + ::sax::Converter::convertDouble( sValueBuffer, 0.0 ); rStrExpValue = sValueBuffer.makeStringAndClear(); bResult = true; break; diff --git a/xmloff/source/chart/XMLErrorIndicatorPropertyHdl.cxx b/xmloff/source/chart/XMLErrorIndicatorPropertyHdl.cxx index 966f33ef85d3..d20d797e793e 100644 --- a/xmloff/source/chart/XMLErrorIndicatorPropertyHdl.cxx +++ b/xmloff/source/chart/XMLErrorIndicatorPropertyHdl.cxx @@ -28,11 +28,17 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" + #include "XMLErrorIndicatorPropertyHdl.hxx" -#include <xmloff/xmluconv.hxx> -#include <com/sun/star/chart/ChartErrorIndicatorType.hpp> + #include <rtl/ustrbuf.hxx> +#include <com/sun/star/uno/Any.hxx> +#include <com/sun/star/chart/ChartErrorIndicatorType.hpp> + +#include <sax/tools/converter.hxx> + + using namespace com::sun::star; XMLErrorIndicatorPropertyHdl::~XMLErrorIndicatorPropertyHdl() @@ -41,8 +47,8 @@ XMLErrorIndicatorPropertyHdl::~XMLErrorIndicatorPropertyHdl() sal_Bool XMLErrorIndicatorPropertyHdl::importXML( const ::rtl::OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& /*rUnitConverter*/ ) const { - bool bValue; - SvXMLUnitConverter::convertBool( bValue, rStrImpValue ); + bool bValue(false); + ::sax::Converter::convertBool( bValue, rStrImpValue ); // modify existing value chart::ChartErrorIndicatorType eType = chart::ChartErrorIndicatorType_NONE; @@ -97,7 +103,7 @@ sal_Bool XMLErrorIndicatorPropertyHdl::exportXML( ::rtl::OUString& rStrExpValue, if( bValue ) { - SvXMLUnitConverter::convertBool( aBuffer, bValue ); + ::sax::Converter::convertBool( aBuffer, bValue ); rStrExpValue = aBuffer.makeStringAndClear(); } diff --git a/xmloff/source/core/DocumentSettingsContext.cxx b/xmloff/source/core/DocumentSettingsContext.cxx index 3727b4d0265c..ee450f7913d6 100644 --- a/xmloff/source/core/DocumentSettingsContext.cxx +++ b/xmloff/source/core/DocumentSettingsContext.cxx @@ -29,6 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" +#include <sax/tools/converter.hxx> #include <com/sun/star/util/XStringSubstitution.hpp> #include <xmloff/DocumentSettingsContext.hxx> @@ -618,9 +619,8 @@ void XMLConfigItemContext::Characters( const ::rtl::OUString& rChars ) sChars = sTrimmedChars; } uno::Sequence<sal_Int8> aBuffer((sChars.getLength() / 4) * 3 ); - sal_Int32 nCharsDecoded = - GetImport().GetMM100UnitConverter(). - decodeBase64SomeChars( aBuffer, sChars ); + sal_Int32 const nCharsDecoded = + ::sax::Converter::decodeBase64SomeChars( aBuffer, sChars ); sal_uInt32 nStartPos(maDecoded.getLength()); sal_uInt32 nCount(aBuffer.getLength()); maDecoded.realloc(nStartPos + nCount); @@ -651,19 +651,19 @@ void XMLConfigItemContext::EndElement() else if (IsXMLToken(msType, XML_BYTE)) { sal_Int32 nValue(0); - SvXMLUnitConverter::convertNumber(nValue, msValue); + ::sax::Converter::convertNumber(nValue, msValue); mrAny <<= static_cast<sal_Int8>(nValue); } else if (IsXMLToken(msType, XML_SHORT)) { sal_Int32 nValue(0); - SvXMLUnitConverter::convertNumber(nValue, msValue); + ::sax::Converter::convertNumber(nValue, msValue); mrAny <<= static_cast<sal_Int16>(nValue); } else if (IsXMLToken(msType, XML_INT)) { sal_Int32 nValue(0); - SvXMLUnitConverter::convertNumber(nValue, msValue); + ::sax::Converter::convertNumber(nValue, msValue); mrAny <<= nValue; } else if (IsXMLToken(msType, XML_LONG)) @@ -674,7 +674,7 @@ void XMLConfigItemContext::EndElement() else if (IsXMLToken(msType, XML_DOUBLE)) { double fValue(0.0); - SvXMLUnitConverter::convertDouble(fValue, msValue); + ::sax::Converter::convertDouble(fValue, msValue); mrAny <<= fValue; } else if (IsXMLToken(msType, XML_STRING)) @@ -684,7 +684,7 @@ void XMLConfigItemContext::EndElement() else if (IsXMLToken(msType, XML_DATETIME)) { util::DateTime aDateTime; - SvXMLUnitConverter::convertDateTime(aDateTime, msValue); + ::sax::Converter::convertDateTime(aDateTime, msValue); mrAny <<= aDateTime; } else if (IsXMLToken(msType, XML_BASE64BINARY)) diff --git a/xmloff/source/core/SettingsExportHelper.cxx b/xmloff/source/core/SettingsExportHelper.cxx index 7125df8f53c2..323f4c4c2836 100644 --- a/xmloff/source/core/SettingsExportHelper.cxx +++ b/xmloff/source/core/SettingsExportHelper.cxx @@ -28,10 +28,12 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" + +#include <sax/tools/converter.hxx> + #include <xmloff/SettingsExportHelper.hxx> #include "xmloff/xmlnmspe.hxx" #include <xmloff/xmltoken.hxx> -#include <xmloff/xmluconv.hxx> #include <tools/debug.hxx> #include <tools/diagnose_ex.h> #include <comphelper/extract.hxx> @@ -210,7 +212,7 @@ void XMLSettingsExportHelper::exportByte(const sal_Int8 nValue, const rtl::OUStr m_rContext.AddAttribute( XML_TYPE, XML_BYTE ); m_rContext.StartElement( XML_CONFIG_ITEM, sal_True ); rtl::OUStringBuffer sBuffer; - SvXMLUnitConverter::convertNumber(sBuffer, sal_Int32(nValue)); + ::sax::Converter::convertNumber(sBuffer, sal_Int32(nValue)); m_rContext.Characters( sBuffer.makeStringAndClear() ); m_rContext.EndElement( sal_False ); #else @@ -228,7 +230,7 @@ void XMLSettingsExportHelper::exportShort(const sal_Int16 nValue, const rtl::OUS m_rContext.AddAttribute( XML_TYPE, XML_SHORT ); m_rContext.StartElement( XML_CONFIG_ITEM, sal_True ); rtl::OUStringBuffer sBuffer; - SvXMLUnitConverter::convertNumber(sBuffer, sal_Int32(nValue)); + ::sax::Converter::convertNumber(sBuffer, sal_Int32(nValue)); m_rContext.Characters( sBuffer.makeStringAndClear() ); m_rContext.EndElement( sal_False ); } @@ -240,7 +242,7 @@ void XMLSettingsExportHelper::exportInt(const sal_Int32 nValue, const rtl::OUStr m_rContext.AddAttribute( XML_TYPE, XML_INT ); m_rContext.StartElement( XML_CONFIG_ITEM, sal_True ); rtl::OUStringBuffer sBuffer; - SvXMLUnitConverter::convertNumber(sBuffer, nValue); + ::sax::Converter::convertNumber(sBuffer, nValue); m_rContext.Characters( sBuffer.makeStringAndClear() ); m_rContext.EndElement( sal_False ); } @@ -263,7 +265,7 @@ void XMLSettingsExportHelper::exportDouble(const double fValue, const rtl::OUStr m_rContext.AddAttribute( XML_TYPE, XML_DOUBLE ); m_rContext.StartElement( XML_CONFIG_ITEM, sal_True ); rtl::OUStringBuffer sBuffer; - SvXMLUnitConverter::convertDouble(sBuffer, fValue); + ::sax::Converter::convertDouble(sBuffer, fValue); m_rContext.Characters( sBuffer.makeStringAndClear() ); m_rContext.EndElement( sal_False ); } @@ -285,7 +287,7 @@ void XMLSettingsExportHelper::exportDateTime(const util::DateTime& aValue, const m_rContext.AddAttribute( XML_NAME, rName ); m_rContext.AddAttribute( XML_TYPE, XML_DATETIME ); rtl::OUStringBuffer sBuffer; - SvXMLUnitConverter::convertDateTime(sBuffer, aValue); + ::sax::Converter::convertDateTime(sBuffer, aValue); m_rContext.StartElement( XML_CONFIG_ITEM, sal_True ); m_rContext.Characters( sBuffer.makeStringAndClear() ); m_rContext.EndElement( sal_False ); @@ -380,7 +382,7 @@ void XMLSettingsExportHelper::exportbase64Binary( if(nLength) { rtl::OUStringBuffer sBuffer; - SvXMLUnitConverter::encodeBase64(sBuffer, aProps); + ::sax::Converter::encodeBase64(sBuffer, aProps); m_rContext.Characters( sBuffer.makeStringAndClear() ); } m_rContext.EndElement( sal_False ); diff --git a/xmloff/source/core/XMLBase64Export.cxx b/xmloff/source/core/XMLBase64Export.cxx index cca38edbe776..338e13c5815f 100644 --- a/xmloff/source/core/XMLBase64Export.cxx +++ b/xmloff/source/core/XMLBase64Export.cxx @@ -28,9 +28,13 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" + #include <rtl/ustrbuf.hxx> + #include <com/sun/star/io/XInputStream.hpp> -#include <xmloff/xmluconv.hxx> + +#include <sax/tools/converter.hxx> + #include <xmloff/xmlexp.hxx> #include "xmloff/xmlnmspe.hxx" #include "XMLBase64Export.hxx" @@ -60,8 +64,7 @@ sal_Bool XMLBase64Export::exportXML( const Reference < XInputStream> & rIn ) nRead = rIn->readBytes( aInBuff, INPUT_BUFFER_SIZE ); if( nRead > 0 ) { - GetExport().GetMM100UnitConverter().encodeBase64( aOutBuff, - aInBuff ); + ::sax::Converter::encodeBase64( aOutBuff, aInBuff ); GetExport().Characters( aOutBuff.makeStringAndClear() ); if( nRead == INPUT_BUFFER_SIZE ) GetExport().IgnorableWhitespace(); diff --git a/xmloff/source/core/XMLBase64ImportContext.cxx b/xmloff/source/core/XMLBase64ImportContext.cxx index cdbbe4eaa50d..58a2ef2145fd 100644 --- a/xmloff/source/core/XMLBase64ImportContext.cxx +++ b/xmloff/source/core/XMLBase64ImportContext.cxx @@ -28,9 +28,12 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" -#include <xmloff/xmlimp.hxx> -#include <xmloff/xmluconv.hxx> + #include <com/sun/star/io/XOutputStream.hpp> + +#include <sax/tools/converter.hxx> + +#include <xmloff/xmlimp.hxx> #include <xmloff/XMLBase64ImportContext.hxx> using ::rtl::OUString; @@ -81,9 +84,8 @@ void XMLBase64ImportContext::Characters( const ::rtl::OUString& rChars ) sChars = sTrimmedChars; } Sequence< sal_Int8 > aBuffer( (sChars.getLength() / 4) * 3 ); - sal_Int32 nCharsDecoded = - GetImport().GetMM100UnitConverter(). - decodeBase64SomeChars( aBuffer, sChars ); + sal_Int32 const nCharsDecoded = + ::sax::Converter::decodeBase64SomeChars( aBuffer, sChars ); xOut->writeBytes( aBuffer ); if( nCharsDecoded != sChars.getLength() ) sBase64CharsLeft = sChars.copy( nCharsDecoded ); diff --git a/xmloff/source/core/xmluconv.cxx b/xmloff/source/core/xmluconv.cxx index ae4b02efb9d1..8d32a055aa90 100644 --- a/xmloff/source/core/xmluconv.cxx +++ b/xmloff/source/core/xmluconv.cxx @@ -28,6 +28,9 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" + +#include <xmloff/xmluconv.hxx> + #include <com/sun/star/util/DateTime.hpp> #include <com/sun/star/util/Date.hpp> #include <com/sun/star/util/Time.hpp> @@ -35,7 +38,6 @@ #include <rtl/ustrbuf.hxx> #include "xmlehelp.hxx" #include <xmloff/xmlement.hxx> -#include <xmloff/xmluconv.hxx> #include <xmloff/xmltoken.hxx> #include <rtl/math.hxx> #include <rtl/logfile.hxx> @@ -56,6 +58,22 @@ #include <com/sun/star/i18n/UnicodeType.hpp> #include <basegfx/vector/b3dvector.hxx> +#include <sax/tools/converter.hxx> + + +//TODO just temporary => remove! +static sal_Bool convertNumber( sal_Int32& rValue, + const ::rtl::OUString& rString, + sal_Int32 nMin = SAL_MIN_INT32, + sal_Int32 nMax = SAL_MAX_INT32) +{ + return ::sax::Converter::convertNumber(rValue, rString, nMin, nMax); +} +static void convertNumber( ::rtl::OUStringBuffer& rBuffer, sal_Int32 nNumber ) +{ + return ::sax::Converter::convertNumber(rBuffer, nNumber); +} + using namespace com::sun::star; using namespace com::sun::star::uno; using namespace com::sun::star::lang; @@ -395,37 +413,6 @@ void SvXMLUnitConverter::convertMeasure( OUStringBuffer& rBuffer, } } -/** convert string to boolean */ -sal_Bool SvXMLUnitConverter::convertBool( bool& rBool, - const OUString& rString ) -{ - rBool = IsXMLToken(rString, XML_TRUE); - - return rBool || IsXMLToken(rString, XML_FALSE); -} - -/** convert boolean to string */ -void SvXMLUnitConverter::convertBool( OUStringBuffer& rBuffer, - sal_Bool bValue ) -{ - rBuffer.append( GetXMLToken( bValue ? XML_TRUE : XML_FALSE ) ); -} - -/** convert string to percent */ -sal_Bool SvXMLUnitConverter::convertPercent( sal_Int32& rPercent, - const OUString& rString ) -{ - return convertMeasure( rPercent, rString, MAP_RELATIVE ); -} - -/** convert percent to string */ -void SvXMLUnitConverter::convertPercent( OUStringBuffer& rBuffer, - sal_Int32 nValue ) -{ - rBuffer.append( nValue ); - rBuffer.append( sal_Unicode('%' ) ); -} - /** convert string to pixel measure */ sal_Bool SvXMLUnitConverter::convertMeasurePx( sal_Int32& rPixel, const OUString& rString ) @@ -556,151 +543,18 @@ int lcl_gethex( int nChar ) return 0; } -/** convert string to color */ -sal_Bool SvXMLUnitConverter::convertColor( Color& rColor, - const OUString& rValue ) -{ - if( rValue.getLength() != 7 || rValue[0] != '#' ) - return sal_False; - - rColor.SetRed( - sal::static_int_cast< sal_uInt8 >( - lcl_gethex( rValue[1] ) * 16 + lcl_gethex( rValue[2] ) ) ); - - rColor.SetGreen( - sal::static_int_cast< sal_uInt8 >( - lcl_gethex( rValue[3] ) * 16 + lcl_gethex( rValue[4] ) ) ); - - rColor.SetBlue( - sal::static_int_cast< sal_uInt8 >( - lcl_gethex( rValue[5] ) * 16 + lcl_gethex( rValue[6] ) ) ); - - return sal_True; -} - static sal_Char aHexTab[] = "0123456789abcdef"; -/** convert color to string */ -void SvXMLUnitConverter::convertColor( OUStringBuffer& rBuffer, - const Color& rCol ) -{ - rBuffer.append( sal_Unicode( '#' ) ); - - sal_uInt8 nCol = rCol.GetRed(); - rBuffer.append( sal_Unicode( aHexTab[ nCol >> 4 ] ) ); - rBuffer.append( sal_Unicode( aHexTab[ nCol & 0xf ] ) ); - - nCol = rCol.GetGreen(); - rBuffer.append( sal_Unicode( aHexTab[ nCol >> 4 ] ) ); - rBuffer.append( sal_Unicode( aHexTab[ nCol & 0xf ] ) ); - - nCol = rCol.GetBlue(); - rBuffer.append( sal_Unicode( aHexTab[ nCol >> 4 ] ) ); - rBuffer.append( sal_Unicode( aHexTab[ nCol & 0xf ] ) ); -} - -/** convert number to string */ -void SvXMLUnitConverter::convertNumber( OUStringBuffer& rBuffer, - sal_Int32 nNumber ) -{ - rBuffer.append( sal_Int32( nNumber ) ); -} - -/** convert string to number with optional min and max values */ -sal_Bool SvXMLUnitConverter::convertNumber( sal_Int32& rValue, - const OUString& rString, - sal_Int32 nMin, sal_Int32 nMax ) -{ - rValue = 0; - sal_Int64 nNumber = 0; - sal_Bool bRet = convertNumber64(nNumber,rString,nMin,nMax); - if ( bRet ) - rValue = static_cast<sal_Int32>(nNumber); - return bRet; -} - -/** convert 64-bit number to string */ -void SvXMLUnitConverter::convertNumber64( OUStringBuffer& rBuffer, - sal_Int64 nNumber ) -{ - rBuffer.append( nNumber ); -} - -/** convert string to 64-bit number with optional min and max values */ -sal_Bool SvXMLUnitConverter::convertNumber64( sal_Int64& rValue, - const OUString& rString, - sal_Int64 nMin, sal_Int64 nMax ) -{ - sal_Bool bNeg = sal_False; - rValue = 0; - - sal_Int32 nPos = 0; - const sal_Int32 nLen = rString.getLength(); - - // skip white space - while( (nPos < nLen) && (rString[nPos] <= sal_Unicode(' ')) ) - ++nPos; - - if( nPos < nLen && sal_Unicode('-') == rString[nPos] ) - { - bNeg = sal_True; - ++nPos; - } - - // get number - while( nPos < nLen && - sal_Unicode('0') <= rString[nPos] && - sal_Unicode('9') >= rString[nPos] ) - { - // TODO: check overflow! - rValue *= 10; - rValue += (rString[nPos] - sal_Unicode('0')); - ++nPos; - } - - if( bNeg ) - rValue *= -1; - - return ( nPos == nLen && rValue >= nMin && rValue <= nMax ); -} /** convert double number to string (using ::rtl::math) */ void SvXMLUnitConverter::convertDouble(OUStringBuffer& rBuffer, double fNumber, sal_Bool bWriteUnits) const { - SvXMLUnitConverter::convertDouble(rBuffer, fNumber, + //FIXME TODO need to convert MapUnit to MeasureUnit here + ::sax::Converter::convertDouble(rBuffer, fNumber, bWriteUnits, meCoreMeasureUnit, meXMLMeasureUnit); } -/** convert double number to string (using ::rtl::math) */ -void SvXMLUnitConverter::convertDouble( OUStringBuffer& rBuffer, - double fNumber, sal_Bool bWriteUnits, MapUnit eCoreUnit, MapUnit eDstUnit) -{ - if(MAP_RELATIVE == eCoreUnit) - { - DBG_ASSERT(eDstUnit == MAP_RELATIVE, "MAP_RELATIVE only maps to MAP_RELATIVE!" ); - ::rtl::math::doubleToUStringBuffer( rBuffer, fNumber, rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, '.', sal_True); - if(bWriteUnits) - rBuffer.append(sal_Unicode('%')); - } - else - { - OUStringBuffer sUnit; - double fFactor = SvXMLExportHelper::GetConversionFactor(sUnit, eCoreUnit, eDstUnit); - if(fFactor != 1.0) - fNumber *= fFactor; - ::rtl::math::doubleToUStringBuffer( rBuffer, fNumber, rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, '.', sal_True); - if(bWriteUnits) - rBuffer.append(sUnit.makeStringAndClear()); - } -} - -/** convert double number to string (using ::rtl::math) */ -void SvXMLUnitConverter::convertDouble( OUStringBuffer& rBuffer, double fNumber) -{ - ::rtl::math::doubleToUStringBuffer( rBuffer, fNumber, rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, '.', sal_True); -} - /** convert string to double number (using ::rtl::math) */ sal_Bool SvXMLUnitConverter::convertDouble(double& rValue, const ::rtl::OUString& rString, sal_Bool bLookForUnits) const @@ -709,39 +563,14 @@ sal_Bool SvXMLUnitConverter::convertDouble(double& rValue, { MapUnit eSrcUnit = SvXMLExportHelper::GetUnitFromString(rString, meCoreMeasureUnit); - return SvXMLUnitConverter::convertDouble(rValue, rString, + //FIXME TODO need to convert MapUnit to MeasureUnit here + return ::sax::Converter::convertDouble(rValue, rString, eSrcUnit, meCoreMeasureUnit); } else { - return SvXMLUnitConverter::convertDouble(rValue, rString); - } -} - -/** convert string to double number (using ::rtl::math) */ -sal_Bool SvXMLUnitConverter::convertDouble(double& rValue, - const OUString& rString, MapUnit eSrcUnit, MapUnit eCoreUnit) -{ - rtl_math_ConversionStatus eStatus; - rValue = ::rtl::math::stringToDouble( rString, (sal_Unicode)('.'), (sal_Unicode)(','), &eStatus, NULL ); - - if(eStatus == rtl_math_ConversionStatus_Ok) - { - OUStringBuffer sUnit; - const double fFactor = SvXMLExportHelper::GetConversionFactor(sUnit, eCoreUnit, eSrcUnit); - if(fFactor != 1.0 && fFactor != 0.0) - rValue /= fFactor; + return ::sax::Converter::convertDouble(rValue, rString); } - - return ( eStatus == rtl_math_ConversionStatus_Ok ); -} - -/** convert string to double number (using ::rtl::math) */ -sal_Bool SvXMLUnitConverter::convertDouble(double& rValue, const OUString& rString) -{ - rtl_math_ConversionStatus eStatus; - rValue = ::rtl::math::stringToDouble( rString, (sal_Unicode)('.'), (sal_Unicode)(','), &eStatus, NULL ); - return ( eStatus == rtl_math_ConversionStatus_Ok ); } /** get the Null Date of the XModel and set it to the UnitConverter */ @@ -1275,42 +1104,6 @@ sal_Bool SvXMLUnitConverter::convertDateTime( com::sun::star::util::DateTime& rD return bSuccess; } -/** gets the position of the first comma after npos in the string - rStr. Commas inside '"' pairs are not matched */ -sal_Int32 SvXMLUnitConverter::indexOfComma( const OUString& rStr, - sal_Int32 nPos ) -{ - sal_Unicode cQuote = 0; - sal_Int32 nLen = rStr.getLength(); - for( ; nPos < nLen; nPos++ ) - { - sal_Unicode c = rStr[nPos]; - switch( c ) - { - case sal_Unicode('\''): - if( 0 == cQuote ) - cQuote = c; - else if( '\'' == cQuote ) - cQuote = 0; - break; - - case sal_Unicode('"'): - if( 0 == cQuote ) - cQuote = c; - else if( '\"' == cQuote ) - cQuote = 0; - break; - - case sal_Unicode(','): - if( 0 == cQuote ) - return nPos; - break; - } - } - - return -1; -} - SvXMLTokenEnumerator::SvXMLTokenEnumerator( const OUString& rString, sal_Unicode cSeperator /* = sal_Unicode(' ') */ ) : maTokenString( rString ), mnNextTokenPos(0), mcSeperator( cSeperator ) { @@ -1405,11 +1198,11 @@ sal_Bool SvXMLUnitConverter::convertB3DVector( ::basegfx::B3DVector& rVector, co void SvXMLUnitConverter::convertB3DVector( OUStringBuffer &rBuffer, const ::basegfx::B3DVector& rVector ) { rBuffer.append(sal_Unicode('(')); - convertDouble(rBuffer, rVector.getX()); + ::sax::Converter::convertDouble(rBuffer, rVector.getX()); rBuffer.append(sal_Unicode(' ')); - convertDouble(rBuffer, rVector.getY()); + ::sax::Converter::convertDouble(rBuffer, rVector.getY()); rBuffer.append(sal_Unicode(' ')); - convertDouble(rBuffer, rVector.getZ()); + ::sax::Converter::convertDouble(rBuffer, rVector.getZ()); rBuffer.append(sal_Unicode(')')); } @@ -1441,179 +1234,6 @@ void SvXMLUnitConverter::convertPosition3D( OUStringBuffer &rBuffer, rBuffer.append( sal_Unicode(')') ); } -const - sal_Char aBase64EncodeTable[] = - { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', - 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', - 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', - 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/' }; - -const - sal_uInt8 aBase64DecodeTable[] = - { 62,255,255,255, 63, // 43-47 -// + / - - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,255,255,255, 0,255,255, // 48-63 -// 0 1 2 3 4 5 6 7 8 9 = - - 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, // 64-79 -// A B C D E F G H I J K L M N O - - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,255,255,255,255,255, // 80-95 -// P Q R S T U V W X Y Z - - 0, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, // 96-111 -// a b c d e f g h i j k l m n o - - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51 }; // 112-123 -// p q r s t u v w x y z - - - -void ThreeByteToFourByte (const sal_Int8* pBuffer, const sal_Int32 nStart, const sal_Int32 nFullLen, OUStringBuffer& sBuffer) -{ - sal_Int32 nLen(nFullLen - nStart); - if (nLen > 3) - nLen = 3; - if (nLen == 0) - { - return; - } - - sal_Int32 nBinaer; - switch (nLen) - { - case 1: - { - nBinaer = ((sal_uInt8)pBuffer[nStart + 0]) << 16; - } - break; - case 2: - { - nBinaer = (((sal_uInt8)pBuffer[nStart + 0]) << 16) + - (((sal_uInt8)pBuffer[nStart + 1]) << 8); - } - break; - default: - { - nBinaer = (((sal_uInt8)pBuffer[nStart + 0]) << 16) + - (((sal_uInt8)pBuffer[nStart + 1]) << 8) + - ((sal_uInt8)pBuffer[nStart + 2]); - } - break; - } - - sal_Unicode buf[] = { '=', '=', '=', '=' }; - - sal_uInt8 nIndex (static_cast<sal_uInt8>((nBinaer & 0xFC0000) >> 18)); - buf[0] = aBase64EncodeTable [nIndex]; - - nIndex = static_cast<sal_uInt8>((nBinaer & 0x3F000) >> 12); - buf[1] = aBase64EncodeTable [nIndex]; - if (nLen > 1) - { - nIndex = static_cast<sal_uInt8>((nBinaer & 0xFC0) >> 6); - buf[2] = aBase64EncodeTable [nIndex]; - if (nLen > 2) - { - nIndex = static_cast<sal_uInt8>((nBinaer & 0x3F)); - buf[3] = aBase64EncodeTable [nIndex]; - } - } - sBuffer.append(buf, SAL_N_ELEMENTS(buf)); -} - -void SvXMLUnitConverter::encodeBase64(OUStringBuffer& aStrBuffer, const uno::Sequence<sal_Int8>& aPass) -{ - sal_Int32 i(0); - sal_Int32 nBufferLength(aPass.getLength()); - const sal_Int8* pBuffer = aPass.getConstArray(); - while (i < nBufferLength) - { - ThreeByteToFourByte (pBuffer, i, nBufferLength, aStrBuffer); - i += 3; - } -} - -void SvXMLUnitConverter::decodeBase64(uno::Sequence<sal_Int8>& aBuffer, const OUString& sBuffer) -{ - sal_Int32 nCharsDecoded = decodeBase64SomeChars( aBuffer, sBuffer ); - OSL_ENSURE( nCharsDecoded == sBuffer.getLength(), - "some bytes left in base64 decoding!" ); - (void)nCharsDecoded; -} - -sal_Int32 SvXMLUnitConverter::decodeBase64SomeChars( - uno::Sequence<sal_Int8>& rOutBuffer, - const OUString& rInBuffer) -{ - sal_Int32 nInBufferLen = rInBuffer.getLength(); - sal_Int32 nMinOutBufferLen = (nInBufferLen / 4) * 3; - if( rOutBuffer.getLength() < nMinOutBufferLen ) - rOutBuffer.realloc( nMinOutBufferLen ); - - const sal_Unicode *pInBuffer = rInBuffer.getStr(); - sal_Int8 *pOutBuffer = rOutBuffer.getArray(); - sal_Int8 *pOutBufferStart = pOutBuffer; - sal_Int32 nCharsDecoded = 0; - - sal_uInt8 aDecodeBuffer[4]; - sal_Int32 nBytesToDecode = 0; - sal_Int32 nBytesGotFromDecoding = 3; - sal_Int32 nInBufferPos= 0; - while( nInBufferPos < nInBufferLen ) - { - sal_Unicode cChar = *pInBuffer; - if( cChar >= '+' && cChar <= 'z' ) - { - sal_uInt8 nByte = aBase64DecodeTable[cChar-'+']; - if( nByte != 255 ) - { - // We have found a valid character! - aDecodeBuffer[nBytesToDecode++] = nByte; - - // One '=' character at the end means 2 out bytes - // Two '=' characters at the end mean 1 out bytes - if( '=' == cChar && nBytesToDecode > 2 ) - nBytesGotFromDecoding--; - if( 4 == nBytesToDecode ) - { - // Four characters found, so we may convert now! - sal_uInt32 nOut = (aDecodeBuffer[0] << 18) + - (aDecodeBuffer[1] << 12) + - (aDecodeBuffer[2] << 6) + - aDecodeBuffer[3]; - - *pOutBuffer++ = (sal_Int8)((nOut & 0xff0000) >> 16); - if( nBytesGotFromDecoding > 1 ) - *pOutBuffer++ = (sal_Int8)((nOut & 0xff00) >> 8); - if( nBytesGotFromDecoding > 2 ) - *pOutBuffer++ = (sal_Int8)(nOut & 0xff); - nCharsDecoded = nInBufferPos + 1; - nBytesToDecode = 0; - nBytesGotFromDecoding = 3; - } - } - else - { - nCharsDecoded++; - } - } - else - { - nCharsDecoded++; - } - - nInBufferPos++; - pInBuffer++; - } - if( (pOutBuffer - pOutBufferStart) != rOutBuffer.getLength() ) - rOutBuffer.realloc( pOutBuffer - pOutBufferStart ); - - return nCharsDecoded; -} - sal_Bool SvXMLUnitConverter::convertNumFormat( sal_Int16& rType, const OUString& rNumFmt, @@ -1779,21 +1399,6 @@ void SvXMLUnitConverter::convertPropertySet(uno::Reference<beans::XPropertySet>& } } -void SvXMLUnitConverter::clearUndefinedChars(OUString& rTarget, const OUString& rSource) -{ - sal_uInt32 nLength(rSource.getLength()); - OUStringBuffer sBuffer(nLength); - for (sal_uInt32 i = 0; i < nLength; i++) - { - sal_Unicode cChar = rSource[i]; - if (!(cChar < 0x0020) || - (cChar == 0x0009) || // TAB - (cChar == 0x000A) || // LF - (cChar == 0x000D)) // legal character - sBuffer.append(cChar); - } - rTarget = sBuffer.makeStringAndClear(); -} OUString SvXMLUnitConverter::encodeStyleName( const OUString& rName, @@ -2092,7 +1697,7 @@ sal_Bool SvXMLUnitConverter::convertAny( OUStringBuffer& sValue, { sType.appendAscii("integer"); bConverted = sal_True; - SvXMLUnitConverter::convertNumber(sValue, nTempValue); + ::sax::Converter::convertNumber(sValue, nTempValue); } } break; @@ -2104,7 +1709,7 @@ sal_Bool SvXMLUnitConverter::convertAny( OUStringBuffer& sValue, { sType.appendAscii("boolean"); bConverted = sal_True; - SvXMLUnitConverter::convertBool(sValue, bTempValue); + ::sax::Converter::convertBool(sValue, bTempValue); } } break; @@ -2117,7 +1722,7 @@ sal_Bool SvXMLUnitConverter::convertAny( OUStringBuffer& sValue, { sType.appendAscii("float"); bConverted = sal_True; - SvXMLUnitConverter::convertDouble(sValue, fTempValue); + ::sax::Converter::convertDouble(sValue, fTempValue); } } break; @@ -2194,7 +1799,7 @@ sal_Bool SvXMLUnitConverter::convertAny( com::sun::star::uno::Any& aValue, if (sType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("boolean"))) { bool bTempValue = false; - SvXMLUnitConverter::convertBool(bTempValue, sValue); + ::sax::Converter::convertBool(bTempValue, sValue); aValue <<= bTempValue; bConverted = sal_True; } @@ -2202,7 +1807,7 @@ sal_Bool SvXMLUnitConverter::convertAny( com::sun::star::uno::Any& aValue, if (sType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("integer"))) { sal_Int32 nTempValue = 0; - SvXMLUnitConverter::convertNumber(nTempValue, sValue); + ::sax::Converter::convertNumber(nTempValue, sValue); aValue <<= nTempValue; bConverted = sal_True; } @@ -2210,7 +1815,7 @@ sal_Bool SvXMLUnitConverter::convertAny( com::sun::star::uno::Any& aValue, if (sType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("float"))) { double fTempValue = 0.0; - SvXMLUnitConverter::convertDouble(fTempValue, sValue); + ::sax::Converter::convertDouble(fTempValue, sValue); aValue <<= fTempValue; bConverted = sal_True; } diff --git a/xmloff/source/draw/animationexport.cxx b/xmloff/source/draw/animationexport.cxx index 851209b13a8a..57c1cd22f7d4 100644 --- a/xmloff/source/draw/animationexport.cxx +++ b/xmloff/source/draw/animationexport.cxx @@ -62,6 +62,8 @@ #include <com/sun/star/presentation/EffectCommands.hpp> #include <com/sun/star/drawing/XShape.hpp> +#include <sax/tools/converter.hxx> + #include <tools/debug.hxx> #include <tools/time.hxx> #include <xmloff/unointerfacetouniqueidentifiermapper.hxx> @@ -619,7 +621,7 @@ void AnimationsExporterImpl::exportTransitionNode() mxPageProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "TransitionFadeColor" ) ) ) >>= nFadeColor; mxPageProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "TransitionDuration" ) ) ) >>= fDuration; - SvXMLUnitConverter::convertDouble( sTmp, fDuration ); + ::sax::Converter::convertDouble( sTmp, fDuration ); sTmp.append( sal_Unicode('s')); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_DUR, sTmp.makeStringAndClear() ); @@ -637,7 +639,7 @@ void AnimationsExporterImpl::exportTransitionNode() if( (nTransition == TransitionType::FADE) && ((nSubtype == TransitionSubType::FADETOCOLOR) || (nSubtype == TransitionSubType::FADEFROMCOLOR) )) { - SvXMLUnitConverter::convertColor( sTmp, nFadeColor ); + ::sax::Converter::convertColor( sTmp, nFadeColor ); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_FADECOLOR, sTmp.makeStringAndClear() ); } SvXMLElementExport aElement2( mrExport, XML_NAMESPACE_ANIMATION, XML_TRANSITIONFILTER, sal_True, sal_True ); @@ -804,7 +806,7 @@ void AnimationsExporterImpl::exportNode( const Reference< XAnimationNode >& xNod { if( aTemp >>= fTemp ) { - SvXMLUnitConverter::convertDouble( sTmp, fTemp ); + ::sax::Converter::convertDouble( sTmp, fTemp ); sTmp.append( sal_Unicode('s')); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_DUR, sTmp.makeStringAndClear() ); } @@ -854,21 +856,21 @@ void AnimationsExporterImpl::exportNode( const Reference< XAnimationNode >& xNod fTemp = xNode->getAcceleration(); if( fTemp != 0.0 ) { - SvXMLUnitConverter::convertDouble( sTmp, fTemp ); + ::sax::Converter::convertDouble( sTmp, fTemp ); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_ACCELERATE, sTmp.makeStringAndClear() ); } fTemp = xNode->getDecelerate(); if( fTemp != 0.0 ) { - SvXMLUnitConverter::convertDouble( sTmp, fTemp ); + ::sax::Converter::convertDouble( sTmp, fTemp ); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_DECELERATE, sTmp.makeStringAndClear() ); } sal_Bool bTemp = xNode->getAutoReverse(); if( bTemp ) { - SvXMLUnitConverter::convertBool( sTmp, bTemp ); + ::sax::Converter::convertBool( sTmp, bTemp ); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_AUTOREVERSE, sTmp.makeStringAndClear() ); } @@ -880,7 +882,7 @@ void AnimationsExporterImpl::exportNode( const Reference< XAnimationNode >& xNod mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_REPEATCOUNT, XML_INDEFINITE ); else if( aTemp >>= fTemp ) { - SvXMLUnitConverter::convertDouble( sTmp, fTemp ); + ::sax::Converter::convertDouble( sTmp, fTemp ); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_REPEATCOUNT, sTmp.makeStringAndClear() ); } } @@ -895,7 +897,7 @@ void AnimationsExporterImpl::exportNode( const Reference< XAnimationNode >& xNod } else if( aTemp >>= fTemp ) { - SvXMLUnitConverter::convertDouble( sTmp, fTemp ); + ::sax::Converter::convertDouble( sTmp, fTemp ); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_REPEATDUR, sTmp.makeStringAndClear() ); } } @@ -1354,7 +1356,7 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat if( (nTransition == TransitionType::FADE) && ((nSubtype == TransitionSubType::FADETOCOLOR) || (nSubtype == TransitionSubType::FADEFROMCOLOR) )) { nTemp = xTransitionFilter->getFadeColor(); - SvXMLUnitConverter::convertColor( sTmp, nTemp ); + ::sax::Converter::convertColor( sTmp, nTemp ); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_FADECOLOR, sTmp.makeStringAndClear() ); } } @@ -1384,7 +1386,7 @@ void AnimationsExporterImpl::exportAudio( const Reference< XAudio >& xAudio ) if( fVolume != 1.0 ) { OUStringBuffer sTmp; - SvXMLUnitConverter::convertDouble( sTmp, fVolume ); + ::sax::Converter::convertDouble( sTmp, fVolume ); mrExport.AddAttribute( XML_NAMESPACE_ANIMATION, XML_AUDIO_LEVEL, sTmp.makeStringAndClear() ); } diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx index 85528e83ceba..81a53fe8a280 100644 --- a/xmloff/source/draw/animationimport.cxx +++ b/xmloff/source/draw/animationimport.cxx @@ -63,6 +63,8 @@ #include <comphelper/processfactory.hxx> #include <cppuhelper/implbase1.hxx> +#include <sax/tools/converter.hxx> + #include <list> #include <xmloff/xmltypes.hxx> #include "sdpropls.hxx" @@ -843,7 +845,7 @@ void AnimationNodeContext::init_node( const ::com::sun::star::uno::Reference< : case ANA_AutoReverse: { bool bTemp; - if( SvXMLUnitConverter::convertBool( bTemp, rValue ) ) + if (::sax::Converter::convertBool( bTemp, rValue )) mxNode->setAutoReverse( bTemp ); } break; @@ -888,7 +890,7 @@ void AnimationNodeContext::init_node( const ::com::sun::star::uno::Reference< : case ANA_After_Effect: { bool bTemp; - if( SvXMLUnitConverter::convertBool( bTemp, rValue ) ) + if (::sax::Converter::convertBool( bTemp, rValue )) aUserData.push_back( NamedValue( GetXMLToken( XML_AFTER_EFFECT ), makeAny( bTemp ) ) ); } break; @@ -1153,9 +1155,9 @@ void AnimationNodeContext::init_node( const ::com::sun::star::uno::Reference< : { if( xTransitionFilter.is() ) { - Color aColor; - SvXMLUnitConverter::convertColor( aColor, rValue ); - xTransitionFilter->setFadeColor( static_cast< sal_Int32 >( aColor.GetRGBColor() ) ); + sal_Int32 nColor(0); + ::sax::Converter::convertColor(nColor, rValue); + xTransitionFilter->setFadeColor(nColor); } } break; diff --git a/xmloff/source/draw/animexp.cxx b/xmloff/source/draw/animexp.cxx index f6bb306d9a4d..8cd68c87be26 100644 --- a/xmloff/source/draw/animexp.cxx +++ b/xmloff/source/draw/animexp.cxx @@ -34,9 +34,10 @@ #include <com/sun/star/presentation/AnimationSpeed.hpp> #include <xmloff/unointerfacetouniqueidentifiermapper.hxx> +#include <sax/tools/converter.hxx> + #include <list> #include <comphelper/extract.hxx> -#include <tools/color.hxx> #include <xmloff/xmltoken.hxx> #include "xmloff/xmlnmspe.hxx" #include <xmloff/xmluconv.hxx> @@ -217,7 +218,7 @@ struct XMLEffectHint sal_Int16 mnStartScale; AnimationSpeed meSpeed; - Color maDimColor; + sal_Int32 maDimColor; OUString maSoundURL; sal_Bool mbPlayFull; sal_Int32 mnPresId; @@ -417,9 +418,8 @@ void XMLAnimationsExporter::collect( Reference< XShape > xShape, SvXMLExport& rE aEffect.meSpeed = AnimationSpeed_MEDIUM; if( bDimPrev ) { - sal_Int32 nColor = 0; - xProps->getPropertyValue( mpImpl->msDimColor ) >>= nColor; - aEffect.maDimColor.SetColor( nColor ); + xProps->getPropertyValue( mpImpl->msDimColor ) + >>= aEffect.maDimColor; } if( !aEffect.mxShape.is() ) @@ -465,7 +465,7 @@ void XMLAnimationsExporter::exportAnimations( SvXMLExport& rExport ) { // export a dim action; - SvXMLUnitConverter::convertColor( sTmp, rEffect.maDimColor ); + ::sax::Converter::convertColor( sTmp, rEffect.maDimColor ); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_COLOR, sTmp.makeStringAndClear() ); SvXMLElementExport aElem( rExport, XML_NAMESPACE_PRESENTATION, XML_DIM, sal_True, sal_True ); @@ -497,7 +497,7 @@ void XMLAnimationsExporter::exportAnimations( SvXMLExport& rExport ) if( rEffect.mnStartScale != -1 ) { - SvXMLUnitConverter::convertPercent( sTmp, rEffect.mnStartScale ); + ::sax::Converter::convertPercent(sTmp, rEffect.mnStartScale); rExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_START_SCALE, sTmp.makeStringAndClear() ); } diff --git a/xmloff/source/draw/animimp.cxx b/xmloff/source/draw/animimp.cxx index 89c90e2ae05b..4a3f6581bd9b 100644 --- a/xmloff/source/draw/animimp.cxx +++ b/xmloff/source/draw/animimp.cxx @@ -37,8 +37,9 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/xml/sax/XAttributeList.hpp> +#include <sax/tools/converter.hxx> + #include <list> -#include <tools/color.hxx> #include <comphelper/extract.hxx> #include <xmloff/xmltoken.hxx> #include <xmloff/xmlimp.hxx> @@ -396,7 +397,7 @@ public: sal_Int16 mnStartScale; AnimationSpeed meSpeed; - Color maDimColor; + sal_Int32 maDimColor; OUString maSoundURL; sal_Bool mbPlayFull; OUString maPathShapeId; @@ -525,7 +526,7 @@ XMLAnimationsEffectContext::XMLAnimationsEffectContext( SvXMLImport& rImport, s } else if( IsXMLToken( aLocalName, XML_COLOR ) ) { - SvXMLUnitConverter::convertColor(maDimColor, sValue); + ::sax::Converter::convertColor(maDimColor, sValue); } break; @@ -545,7 +546,7 @@ XMLAnimationsEffectContext::XMLAnimationsEffectContext( SvXMLImport& rImport, s else if( IsXMLToken( aLocalName, XML_START_SCALE ) ) { sal_Int32 nScale; - if( SvXMLUnitConverter::convertPercent( nScale, sValue ) ) + if (::sax::Converter::convertPercent( nScale, sValue )) mnStartScale = (sal_Int16)nScale; } else if( IsXMLToken( aLocalName, XML_SPEED ) ) @@ -612,7 +613,7 @@ void XMLAnimationsEffectContext::EndElement() aAny <<= (sal_Bool)sal_True; xSet->setPropertyValue( mpImpl->msDimPrev, aAny ); - aAny <<= (sal_Int32)maDimColor.GetColor(); + aAny <<= maDimColor; xSet->setPropertyValue( mpImpl->msDimColor, aAny ); } else if( meKind == XMLE_PLAY ) diff --git a/xmloff/source/draw/eventimp.cxx b/xmloff/source/draw/eventimp.cxx index 6d82798bd283..8bb10ef3446b 100644 --- a/xmloff/source/draw/eventimp.cxx +++ b/xmloff/source/draw/eventimp.cxx @@ -38,6 +38,9 @@ #include <com/sun/star/presentation/ClickAction.hpp> #include <tools/urlobj.hxx> #include <comphelper/extract.hxx> + +#include <sax/tools/converter.hxx> + #include <xmloff/xmltoken.hxx> #include <xmloff/xmlimp.hxx> #include "xmloff/xmlnmspe.hxx" @@ -225,7 +228,7 @@ SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImp, sal_uInt16 nPrfx, cons else if( IsXMLToken( aAttrLocalName, XML_START_SCALE ) ) { sal_Int32 nScale; - if( SvXMLUnitConverter::convertPercent( nScale, sValue ) ) + if (::sax::Converter::convertPercent( nScale, sValue )) mnStartScale = (sal_Int16)nScale; } else if( IsXMLToken( aAttrLocalName, XML_SPEED ) ) @@ -236,7 +239,7 @@ SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImp, sal_uInt16 nPrfx, cons } else if( IsXMLToken( aAttrLocalName, XML_VERB ) ) { - SvXMLUnitConverter::convertNumber( mnVerb, sValue ); + ::sax::Converter::convertNumber( mnVerb, sValue ); } break; diff --git a/xmloff/source/draw/propimp0.cxx b/xmloff/source/draw/propimp0.cxx index c1e97269427e..34deab9fd332 100644 --- a/xmloff/source/draw/propimp0.cxx +++ b/xmloff/source/draw/propimp0.cxx @@ -34,6 +34,9 @@ #include <com/sun/star/drawing/LineDash.hpp> #include <com/sun/star/util/DateTime.hpp> #include <com/sun/star/uno/Any.hxx> + +#include <sax/tools/converter.hxx> + #include <xmloff/xmluconv.hxx> #include <xmloff/xmlimp.hxx> @@ -114,7 +117,7 @@ sal_Bool XMLOpacityPropertyHdl::importXML( if( rStrImpValue.indexOf( sal_Unicode('%') ) != -1 ) { - if( SvXMLUnitConverter::convertPercent( nValue, rStrImpValue ) ) + if (::sax::Converter::convertPercent( nValue, rStrImpValue )) bRet = sal_True; } else @@ -165,7 +168,7 @@ sal_Bool XMLOpacityPropertyHdl::exportXML( OUStringBuffer aOut; nVal = 100 - nVal; - SvXMLUnitConverter::convertPercent( aOut, nVal ); + ::sax::Converter::convertPercent( aOut, nVal ); rStrExpValue = aOut.makeStringAndClear(); bRet = sal_True; } @@ -192,7 +195,7 @@ sal_Bool XMLTextAnimationStepPropertyHdl::importXML( sal_Int32 nPos = rStrImpValue.indexOf( aPX ); if( nPos != -1 ) { - if( rUnitConverter.convertNumber( nValue, rStrImpValue.copy( 0, nPos ) ) ) + if (::sax::Converter::convertNumber(nValue, rStrImpValue.copy(0, nPos))) { rValue <<= sal_Int16( -nValue ); bRet = sal_True; @@ -225,7 +228,7 @@ sal_Bool XMLTextAnimationStepPropertyHdl::exportXML( if( nVal < 0 ) { const OUString aPX( RTL_CONSTASCII_USTRINGPARAM( "px" ) ); - rUnitConverter.convertNumber( aOut, (sal_Int32)-nVal ); + ::sax::Converter::convertNumber( aOut, (sal_Int32)-nVal ); aOut.append( aPX ); } else diff --git a/xmloff/source/draw/sdpropls.cxx b/xmloff/source/draw/sdpropls.cxx index 8b68b1d5d5b3..3fc565318ddd 100644 --- a/xmloff/source/draw/sdpropls.cxx +++ b/xmloff/source/draw/sdpropls.cxx @@ -71,7 +71,7 @@ #include "XMLIsPercentagePropertyHandler.hxx" #include "XMLPercentOrMeasurePropertyHandler.hxx" #include "animations.hxx" -#include <xmloff/xmluconv.hxx> +#include <sax/tools/converter.hxx> #include "sdxmlexp_impl.hxx" @@ -744,7 +744,7 @@ sal_Bool XMLCaptionEscapeRelative::importXML( const OUString& rStrImpValue, Any& { sal_Int32 nValue; - if( !SvXMLUnitConverter::convertPercent( nValue, rStrImpValue ) ) + if (!::sax::Converter::convertPercent( nValue, rStrImpValue )) return sal_False; nValue *= 100; @@ -759,8 +759,8 @@ sal_Bool XMLCaptionEscapeRelative::exportXML( OUString& rStrExpValue, const Any& return sal_False; nValue /= 100; - OUStringBuffer aOut; - SvXMLUnitConverter::convertPercent( aOut, nValue ); + OUStringBuffer aOut; + ::sax::Converter::convertPercent( aOut, nValue ); rStrExpValue = aOut.makeStringAndClear(); return sal_True; } @@ -848,7 +848,7 @@ sal_Bool XMLSdHeaderFooterVisibilityTypeHdl::exportXML( if (rValue >>= bValue) { - SvXMLUnitConverter::convertBool( aOut, bValue ); + ::sax::Converter::convertBool( aOut, bValue ); rStrExpValue = aOut.makeStringAndClear(); bRet = sal_True; diff --git a/xmloff/source/draw/shapeexport2.cxx b/xmloff/source/draw/shapeexport2.cxx index aaf4acb6f1f5..515dde639fdb 100644 --- a/xmloff/source/draw/shapeexport2.cxx +++ b/xmloff/source/draw/shapeexport2.cxx @@ -39,6 +39,9 @@ #include <com/sun/star/document/XEventsSupplier.hpp> #include <com/sun/star/drawing/HomogenMatrix3.hpp> #include <com/sun/star/media/ZoomLevel.hpp> + +#include <sax/tools/converter.hxx> + #include "anim.hxx" #include <xmloff/shapeexport.hxx> @@ -443,7 +446,7 @@ void XMLShapeExport::ImpExportEvents( const uno::Reference< drawing::XShape >& x if( nStartScale != -1 ) { - SvXMLUnitConverter::convertPercent( msBuffer, nStartScale ); + ::sax::Converter::convertPercent( msBuffer, nStartScale ); mrExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_START_SCALE, msBuffer.makeStringAndClear() ); } } @@ -900,11 +903,11 @@ void XMLShapeExport::ImpExportEllipseShape( mrExport.AddAttribute(XML_NAMESPACE_DRAW, XML_KIND, sStringBuffer.makeStringAndClear() ); // export start angle - SvXMLUnitConverter::convertDouble( sStringBuffer, dStartAngle ); + ::sax::Converter::convertDouble( sStringBuffer, dStartAngle ); mrExport.AddAttribute(XML_NAMESPACE_DRAW, XML_START_ANGLE, sStringBuffer.makeStringAndClear() ); // export end angle - SvXMLUnitConverter::convertDouble( sStringBuffer, dEndAngle ); + ::sax::Converter::convertDouble( sStringBuffer, dEndAngle ); mrExport.AddAttribute(XML_NAMESPACE_DRAW, XML_END_ANGLE, sStringBuffer.makeStringAndClear() ); } diff --git a/xmloff/source/draw/shapeexport3.cxx b/xmloff/source/draw/shapeexport3.cxx index 759509f112d8..f8f8e0194565 100644 --- a/xmloff/source/draw/shapeexport3.cxx +++ b/xmloff/source/draw/shapeexport3.cxx @@ -38,6 +38,8 @@ #include <com/sun/star/drawing/DoubleSequence.hpp> #include <tools/gen.hxx> +#include <sax/tools/converter.hxx> + #include <xmloff/shapeexport.hxx> #include "sdpropls.hxx" #include <tools/debug.hxx> @@ -394,7 +396,7 @@ void XMLShapeExport::export3DSceneAttributes( const com::sun::star::uno::Referen aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneShadowSlant"))); sal_Int16 nShadowSlant = 0; aAny >>= nShadowSlant; - mrExport.GetMM100UnitConverter().convertNumber(sStringBuffer, (sal_Int32)nShadowSlant); + ::sax::Converter::convertNumber(sStringBuffer, (sal_Int32)nShadowSlant); aStr = sStringBuffer.makeStringAndClear(); mrExport.AddAttribute(XML_NAMESPACE_DR3D, XML_SHADOW_SLANT, aStr); @@ -421,10 +423,9 @@ void XMLShapeExport::export3DSceneAttributes( const com::sun::star::uno::Referen // ambientColor aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneAmbientColor"))); - sal_Int32 aColTemp = 0; - Color aAmbientColor; - aAny >>= aColTemp; aAmbientColor.SetColor(aColTemp); - mrExport.GetMM100UnitConverter().convertColor(sStringBuffer, aAmbientColor); + sal_Int32 nAmbientColor = 0; + aAny >>= nAmbientColor; + ::sax::Converter::convertColor(sStringBuffer, nAmbientColor); aStr = sStringBuffer.makeStringAndClear(); mrExport.AddAttribute(XML_NAMESPACE_DR3D, XML_AMBIENT_COLOR, aStr); @@ -432,7 +433,7 @@ void XMLShapeExport::export3DSceneAttributes( const com::sun::star::uno::Referen aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneTwoSidedLighting"))); sal_Bool bTwoSidedLighting = false; aAny >>= bTwoSidedLighting; - mrExport.GetMM100UnitConverter().convertBool(sStringBuffer, bTwoSidedLighting); + ::sax::Converter::convertBool(sStringBuffer, bTwoSidedLighting); aStr = sStringBuffer.makeStringAndClear(); mrExport.AddAttribute(XML_NAMESPACE_DR3D, XML_LIGHTING_MODE, aStr); } @@ -450,8 +451,6 @@ void XMLShapeExport::export3DLamps( const com::sun::star::uno::Reference< com::s OUString aPropName; OUString aIndexStr; - sal_Int32 aColTemp = 0; - Color aLightColor; ::basegfx::B3DVector aLightDirection; drawing::Direction3D xLightDir; sal_Bool bLightOnOff = false; @@ -462,9 +461,9 @@ void XMLShapeExport::export3DLamps( const com::sun::star::uno::Reference< com::s // lightcolor aPropName = aColorPropName; aPropName += aIndexStr; - xPropSet->getPropertyValue( aPropName ) >>= aColTemp; - aLightColor.SetColor(aColTemp); - mrExport.GetMM100UnitConverter().convertColor(sStringBuffer, aLightColor); + sal_Int32 nLightColor = 0; + xPropSet->getPropertyValue( aPropName ) >>= nLightColor; + ::sax::Converter::convertColor(sStringBuffer, nLightColor); aStr = sStringBuffer.makeStringAndClear(); mrExport.AddAttribute(XML_NAMESPACE_DR3D, XML_DIFFUSE_COLOR, aStr); @@ -481,7 +480,7 @@ void XMLShapeExport::export3DLamps( const com::sun::star::uno::Reference< com::s aPropName = aLightOnPropName; aPropName += aIndexStr; xPropSet->getPropertyValue(aPropName) >>= bLightOnOff; - mrExport.GetMM100UnitConverter().convertBool(sStringBuffer, bLightOnOff); + ::sax::Converter::convertBool(sStringBuffer, bLightOnOff); aStr = sStringBuffer.makeStringAndClear(); mrExport.AddAttribute(XML_NAMESPACE_DR3D, XML_ENABLED, aStr); diff --git a/xmloff/source/draw/shapeexport4.cxx b/xmloff/source/draw/shapeexport4.cxx index 13d6730a028a..767026e9953f 100644 --- a/xmloff/source/draw/shapeexport4.cxx +++ b/xmloff/source/draw/shapeexport4.cxx @@ -45,6 +45,8 @@ #include <com/sun/star/table/XColumnRowRange.hpp> +#include <sax/tools/converter.hxx> + #include <xmloff/shapeexport.hxx> #include "sdpropls.hxx" #include <tools/debug.hxx> @@ -519,7 +521,8 @@ void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< bean double fTextRotateAngle = 0; if ( rGeoProp.Value >>= fTextRotateAngle ) { - rUnitConverter.convertDouble( aStrBuffer, fTextRotateAngle ); + ::sax::Converter::convertDouble( + aStrBuffer, fTextRotateAngle ); aStr = aStrBuffer.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_TEXT_ROTATE_ANGLE, aStr ); } @@ -549,7 +552,12 @@ void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< bean double fExtrusionBrightness = 0; if ( rProp.Value >>= fExtrusionBrightness ) { - rUnitConverter.convertDouble( aStrBuffer, fExtrusionBrightness, sal_False, MAP_RELATIVE, MAP_RELATIVE ); + ::sax::Converter::convertDouble( + aStrBuffer, + fExtrusionBrightness, + false, + util::MeasureUnit::PERCENT, + util::MeasureUnit::PERCENT); aStrBuffer.append( (sal_Unicode)'%' ); aStr = aStrBuffer.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_EXTRUSION_BRIGHTNESS, aStr ); @@ -577,7 +585,12 @@ void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< bean double fExtrusionDiffusion = 0; if ( rProp.Value >>= fExtrusionDiffusion ) { - rUnitConverter.convertDouble( aStrBuffer, fExtrusionDiffusion, sal_False, MAP_RELATIVE, MAP_RELATIVE ); + ::sax::Converter::convertDouble( + aStrBuffer, + fExtrusionDiffusion, + false, + util::MeasureUnit::PERCENT, + util::MeasureUnit::PERCENT); aStrBuffer.append( (sal_Unicode)'%' ); aStr = aStrBuffer.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_EXTRUSION_DIFFUSION, aStr ); @@ -620,7 +633,12 @@ void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< bean double fExtrusionFirstLightLevel = 0; if ( rProp.Value >>= fExtrusionFirstLightLevel ) { - rUnitConverter.convertDouble( aStrBuffer, fExtrusionFirstLightLevel, sal_False, MAP_RELATIVE, MAP_RELATIVE ); + ::sax::Converter::convertDouble( + aStrBuffer, + fExtrusionFirstLightLevel, + false, + util::MeasureUnit::PERCENT, + util::MeasureUnit::PERCENT); aStrBuffer.append( (sal_Unicode)'%' ); aStr = aStrBuffer.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_EXTRUSION_FIRST_LIGHT_LEVEL, aStr ); @@ -632,7 +650,12 @@ void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< bean double fExtrusionSecondLightLevel = 0; if ( rProp.Value >>= fExtrusionSecondLightLevel ) { - rUnitConverter.convertDouble( aStrBuffer, fExtrusionSecondLightLevel, sal_False, MAP_RELATIVE, MAP_RELATIVE ); + ::sax::Converter::convertDouble( + aStrBuffer, + fExtrusionSecondLightLevel, + false, + util::MeasureUnit::PERCENT, + util::MeasureUnit::PERCENT); aStrBuffer.append( (sal_Unicode)'%' ); aStr = aStrBuffer.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_EXTRUSION_SECOND_LIGHT_LEVEL, aStr ); @@ -726,7 +749,12 @@ void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< bean double fExtrusionShininess = 0; if ( rProp.Value >>= fExtrusionShininess ) { - rUnitConverter.convertDouble( aStrBuffer, fExtrusionShininess, sal_False, MAP_RELATIVE, MAP_RELATIVE ); + ::sax::Converter::convertDouble( + aStrBuffer, + fExtrusionShininess, + false, + util::MeasureUnit::PERCENT, + util::MeasureUnit::PERCENT); aStrBuffer.append( (sal_Unicode)'%' ); aStr = aStrBuffer.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_EXTRUSION_SHININESS, aStr ); @@ -750,7 +778,12 @@ void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< bean double fExtrusionSpecularity = 0; if ( rProp.Value >>= fExtrusionSpecularity ) { - rUnitConverter.convertDouble( aStrBuffer, fExtrusionSpecularity, sal_False, MAP_RELATIVE, MAP_RELATIVE ); + ::sax::Converter::convertDouble( + aStrBuffer, + fExtrusionSpecularity, + false, + util::MeasureUnit::PERCENT, + util::MeasureUnit::PERCENT); aStrBuffer.append( (sal_Unicode)'%' ); aStr = aStrBuffer.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_EXTRUSION_SPECULARITY, aStr ); @@ -1027,16 +1060,19 @@ void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< bean { double fValue = 0.0; rAdj.Value >>= fValue; - rUnitConverter.convertDouble( aStrBuffer, fValue ); + ::sax::Converter::convertDouble(aStrBuffer, fValue); } else { rAdj.Value >>= nValue; - rUnitConverter.convertNumber( aStrBuffer, nValue ); + ::sax::Converter::convertNumber(aStrBuffer, nValue); } } else - rUnitConverter.convertNumber( aStrBuffer, 0 ); // this should not be, but better than setting nothing + { + // this should not be, but better than setting nothing + ::sax::Converter::convertNumber( aStrBuffer, 0 ); + } } aStr = aStrBuffer.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_MODIFIERS, aStr ); diff --git a/xmloff/source/draw/xexptran.cxx b/xmloff/source/draw/xexptran.cxx index 75d0ff1a654a..aab16133f8c9 100644 --- a/xmloff/source/draw/xexptran.cxx +++ b/xmloff/source/draw/xexptran.cxx @@ -31,6 +31,7 @@ #include "xexptran.hxx" #include <tools/debug.hxx> #include <rtl/ustrbuf.hxx> +#include <sax/tools/converter.hxx> #include <xmloff/xmluconv.hxx> #include <tools/gen.hxx> #include <basegfx/vector/b2dvector.hxx> @@ -150,7 +151,7 @@ void Imp_SkipNumberAndSpacesAndCommas(const OUString& rStr, sal_Int32& rPos, void Imp_PutNumberChar(OUString& rStr, sal_Int32 nValue) { OUStringBuffer sStringBuffer; - SvXMLUnitConverter::convertNumber(sStringBuffer, nValue); + ::sax::Converter::convertNumber(sStringBuffer, nValue); rStr += OUString(sStringBuffer.makeStringAndClear()); } @@ -243,7 +244,10 @@ double Imp_GetDoubleChar(const OUString& rStr, sal_Int32& rPos, const sal_Int32 if(bLookForUnits) rConv.convertDouble(fRetval, sNumberString.makeStringAndClear(), true); else - rConv.convertDouble(fRetval, sNumberString.makeStringAndClear()); + { + ::sax::Converter::convertDouble(fRetval, + sNumberString.makeStringAndClear()); + } } return fRetval; @@ -257,7 +261,9 @@ void Imp_PutDoubleChar(OUString& rStr, const SvXMLUnitConverter& rConv, double f if(bConvertUnits) rConv.convertDouble(sStringBuffer, fValue, true); else - rConv.convertDouble(sStringBuffer, fValue); + { + ::sax::Converter::convertDouble(sStringBuffer, fValue); + } rStr += OUString(sStringBuffer.makeStringAndClear()); } diff --git a/xmloff/source/draw/ximp3dscene.cxx b/xmloff/source/draw/ximp3dscene.cxx index e82c5635c784..b71ae0d9394b 100644 --- a/xmloff/source/draw/ximp3dscene.cxx +++ b/xmloff/source/draw/ximp3dscene.cxx @@ -28,6 +28,9 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" + +#include <sax/tools/converter.hxx> + #include "ximp3dscene.hxx" #include <xmloff/xmluconv.hxx> #include "xexptran.hxx" @@ -72,7 +75,7 @@ SdXML3DLightContext::SdXML3DLightContext( { case XML_TOK_3DLIGHT_DIFFUSE_COLOR: { - GetImport().GetMM100UnitConverter().convertColor(maDiffuseColor, sValue); + ::sax::Converter::convertColor(maDiffuseColor, sValue); break; } case XML_TOK_3DLIGHT_DIRECTION: @@ -82,12 +85,12 @@ SdXML3DLightContext::SdXML3DLightContext( } case XML_TOK_3DLIGHT_ENABLED: { - GetImport().GetMM100UnitConverter().convertBool(mbEnabled, sValue); + ::sax::Converter::convertBool(mbEnabled, sValue); break; } case XML_TOK_3DLIGHT_SPECULAR: { - GetImport().GetMM100UnitConverter().convertBool(mbSpecular, sValue); + ::sax::Converter::convertBool(mbSpecular, sValue); break; } } @@ -333,7 +336,7 @@ void SdXML3DSceneAttributesHelper::processSceneAttribute( sal_uInt16 nPrefix, co } else if( IsXMLToken( rLocalName, XML_SHADOW_SLANT ) ) { - mrImport.GetMM100UnitConverter().convertNumber(mnShadowSlant, rValue); + ::sax::Converter::convertNumber(mnShadowSlant, rValue); return; } else if( IsXMLToken( rLocalName, XML_SHADE_MODE ) ) @@ -350,12 +353,12 @@ void SdXML3DSceneAttributesHelper::processSceneAttribute( sal_uInt16 nPrefix, co } else if( IsXMLToken( rLocalName, XML_AMBIENT_COLOR ) ) { - mrImport.GetMM100UnitConverter().convertColor(maAmbientColor, rValue); + ::sax::Converter::convertColor(maAmbientColor, rValue); return; } else if( IsXMLToken( rLocalName, XML_LIGHTING_MODE ) ) { - mrImport.GetMM100UnitConverter().convertBool(mbLightingMode, rValue); + ::sax::Converter::convertBool(mbLightingMode, rValue); return; } } @@ -390,7 +393,7 @@ void SdXML3DSceneAttributesHelper::setSceneAttributes( const com::sun::star::uno xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneShadeMode")), aAny); // ambientColor - aAny <<= maAmbientColor.GetColor(); + aAny <<= maAmbientColor; xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneAmbientColor")), aAny); // lightingMode @@ -408,7 +411,7 @@ void SdXML3DSceneAttributesHelper::setSceneAttributes( const com::sun::star::uno SdXML3DLightContext* pCtx = (SdXML3DLightContext*)maList[ a ]; // set anys - aAny <<= pCtx->GetDiffuseColor().GetColor(); + aAny <<= pCtx->GetDiffuseColor(); drawing::Direction3D xLightDir; xLightDir.DirectionX = pCtx->GetDirection().getX(); xLightDir.DirectionY = pCtx->GetDirection().getY(); diff --git a/xmloff/source/draw/ximpcustomshape.cxx b/xmloff/source/draw/ximpcustomshape.cxx index f7b135ef561b..0308eafdaa8f 100644 --- a/xmloff/source/draw/ximpcustomshape.cxx +++ b/xmloff/source/draw/ximpcustomshape.cxx @@ -30,7 +30,6 @@ #include "precompiled_xmloff.hxx" #include "ximpcustomshape.hxx" #include "ximpshap.hxx" -#include "xmlehelp.hxx" #include <rtl/math.hxx> #include <rtl/ustrbuf.hxx> #include <rtl/ustring.hxx> @@ -58,6 +57,7 @@ #include <com/sun/star/drawing/EnhancedCustomShapeTextPathMode.hpp> #include <com/sun/star/drawing/ProjectionMode.hpp> #include <boost/unordered_map.hpp> +#include <sax/tools/converter.hxx> using namespace ::com::sun::star; using namespace ::xmloff::token; @@ -88,7 +88,7 @@ void GetBool( std::vector< com::sun::star::beans::PropertyValue >& rDest, const rtl::OUString& rValue, const EnhancedCustomShapeTokenEnum eDestProp ) { bool bAttrBool; - if ( SvXMLUnitConverter::convertBool( bAttrBool, rValue ) ) + if (::sax::Converter::convertBool( bAttrBool, rValue )) { beans::PropertyValue aProp; aProp.Name = EASGet( eDestProp ); @@ -101,7 +101,7 @@ void GetInt32( std::vector< com::sun::star::beans::PropertyValue >& rDest, const rtl::OUString& rValue, const EnhancedCustomShapeTokenEnum eDestProp ) { sal_Int32 nAttrNumber; - if ( SvXMLUnitConverter::convertNumber( nAttrNumber, rValue ) ) + if (::sax::Converter::convertNumber( nAttrNumber, rValue )) { beans::PropertyValue aProp; aProp.Name = EASGet( eDestProp ); @@ -114,7 +114,7 @@ void GetDouble( std::vector< com::sun::star::beans::PropertyValue >& rDest, const rtl::OUString& rValue, const EnhancedCustomShapeTokenEnum eDestProp ) { double fAttrDouble; - if ( SvXMLUnitConverter::convertDouble( fAttrDouble, rValue ) ) + if (::sax::Converter::convertDouble( fAttrDouble, rValue )) { beans::PropertyValue aProp; aProp.Name = EASGet( eDestProp ); @@ -127,8 +127,10 @@ void GetDistance( std::vector< com::sun::star::beans::PropertyValue >& rDest, const rtl::OUString& rValue, const EnhancedCustomShapeTokenEnum eDestProp ) { double fAttrDouble; - MapUnit eSrcUnit( SvXMLExportHelper::GetUnitFromString( rValue, MAP_100TH_MM ) ); - if ( SvXMLUnitConverter::convertDouble( fAttrDouble, rValue, eSrcUnit, MAP_100TH_MM ) ) + sal_Int16 const eSrcUnit( ::sax::Converter::GetUnitFromString( + rValue, util::MeasureUnit::MM_100TH) ); + if (::sax::Converter::convertDouble(fAttrDouble, rValue, eSrcUnit, + util::MeasureUnit::MM_100TH)) { beans::PropertyValue aProp; aProp.Name = EASGet( eDestProp ); @@ -164,8 +166,9 @@ void GetEnum( std::vector< com::sun::star::beans::PropertyValue >& rDest, void GetDoublePercentage( std::vector< com::sun::star::beans::PropertyValue >& rDest, const rtl::OUString& rValue, const EnhancedCustomShapeTokenEnum eDestProp ) { - MapUnit eSrcUnit = SvXMLExportHelper::GetUnitFromString( rValue, MAP_100TH_MM ); - if ( eSrcUnit == MAP_RELATIVE ) + sal_Int16 const eSrcUnit = ::sax::Converter::GetUnitFromString( + rValue, util::MeasureUnit::MM_100TH); + if (util::MeasureUnit::PERCENT == eSrcUnit) { rtl_math_ConversionStatus eStatus; double fAttrDouble = ::rtl::math::stringToDouble( rValue, @@ -410,7 +413,7 @@ sal_Bool GetNextParameter( com::sun::star::drawing::EnhancedCustomShapeParameter if ( bE || bDot ) { double fAttrDouble; - if ( SvXMLUnitConverter::convertDouble( fAttrDouble, aNumber ) ) + if (::sax::Converter::convertDouble(fAttrDouble, aNumber)) rParameter.Value <<= fAttrDouble; else bValid = sal_False; @@ -418,7 +421,7 @@ sal_Bool GetNextParameter( com::sun::star::drawing::EnhancedCustomShapeParameter else { sal_Int32 nValue; - if ( SvXMLUnitConverter::convertNumber( nValue, aNumber ) ) + if (::sax::Converter::convertNumber(nValue, aNumber)) rParameter.Value <<= nValue; else bValid = sal_False; @@ -457,7 +460,7 @@ void GetDoubleSequence( std::vector< com::sun::star::beans::PropertyValue >& rDe { double fAttrDouble; rtl::OUString aToken( rValue.getToken( 0, ',', nIndex ) ); - if ( !SvXMLUnitConverter::convertDouble( fAttrDouble, aToken ) ) + if (!::sax::Converter::convertDouble( fAttrDouble, aToken )) break; else vDirection.push_back( fAttrDouble ); @@ -889,10 +892,13 @@ void XMLEnhancedCustomShapeContext::StartElement( const uno::Reference< xml::sax if ( GetNextParameter( rDepth, nIndex, rValue ) ) { // try to catch the unit for the depth - MapUnit eSrcUnit( SvXMLExportHelper::GetUnitFromString( rValue, MAP_100TH_MM ) ); + sal_Int16 const eSrcUnit( + ::sax::Converter::GetUnitFromString( + rValue, util::MeasureUnit::MM_100TH)); rtl::OUStringBuffer aUnitStr; - double fFactor = SvXMLExportHelper::GetConversionFactor( aUnitStr, MAP_100TH_MM, eSrcUnit ); + double fFactor = ::sax::Converter::GetConversionFactor( + aUnitStr, util::MeasureUnit::MM_100TH, eSrcUnit); if ( ( fFactor != 1.0 ) && ( fFactor != 0.0 ) ) { double fDepth(0.0); @@ -1006,7 +1012,7 @@ void XMLEnhancedCustomShapeContext::StartElement( const uno::Reference< xml::sax break; case EAS_path_stretchpoint_x : { - if ( SvXMLUnitConverter::convertNumber( nAttrNumber, rValue ) ) + if (::sax::Converter::convertNumber(nAttrNumber, rValue)) { beans::PropertyValue aProp; aProp.Name = EASGet( EAS_StretchX ); @@ -1017,7 +1023,7 @@ void XMLEnhancedCustomShapeContext::StartElement( const uno::Reference< xml::sax break; case EAS_path_stretchpoint_y : { - if ( SvXMLUnitConverter::convertNumber( nAttrNumber, rValue ) ) + if (::sax::Converter::convertNumber(nAttrNumber, rValue)) { beans::PropertyValue aProp; aProp.Name = EASGet( EAS_StretchY ); diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 15fba1a45f64..5a8b16d4ab49 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -69,6 +69,9 @@ #include <com/sun/star/beans/XPropertySetInfo.hpp> #include <com/sun/star/drawing/ConnectorType.hpp> #include <com/sun/star/drawing/HomogenMatrix3.hpp> + +#include <sax/tools/converter.hxx> + #include "PropertySetMerger.hxx" #include <xmloff/families.hxx> #include "ximpstyl.hxx" @@ -1199,14 +1202,14 @@ void SdXMLEllipseShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl if( IsXMLToken( rLocalName, XML_START_ANGLE ) ) { double dStartAngle; - if( SvXMLUnitConverter::convertDouble( dStartAngle, rValue ) ) + if (::sax::Converter::convertDouble( dStartAngle, rValue )) mnStartAngle = (sal_Int32)(dStartAngle * 100.0); return; } if( IsXMLToken( rLocalName, XML_END_ANGLE ) ) { double dEndAngle; - if( SvXMLUnitConverter::convertDouble( dEndAngle, rValue ) ) + if (::sax::Converter::convertDouble( dEndAngle, rValue )) mnEndAngle = (sal_Int32)(dEndAngle * 100.0); return; } diff --git a/xmloff/source/forms/controlpropertyhdl.cxx b/xmloff/source/forms/controlpropertyhdl.cxx index 8823e7623765..3b89eee6ea93 100644 --- a/xmloff/source/forms/controlpropertyhdl.cxx +++ b/xmloff/source/forms/controlpropertyhdl.cxx @@ -32,6 +32,9 @@ #include <com/sun/star/awt/TextAlign.hpp> #include <com/sun/star/awt/FontWidth.hpp> #include <com/sun/star/awt/FontEmphasisMark.hpp> + +#include <sax/tools/converter.hxx> + #include <xmloff/xmltypes.hxx> #include "xmloff/NamedBoolPropertyHdl.hxx" #include "formenums.hxx" @@ -238,7 +241,6 @@ namespace xmloff SvXMLTokenEnumerator aTokens(_rStrImpValue); sal_uInt16 nStyle = 1; - Color aColor; while ( aTokens.getNextToken(sToken) // have a new token && (0 != sToken.getLength()) // really have a new token @@ -258,9 +260,10 @@ namespace xmloff // try interpreting it as color value if ( m_eFacet == COLOR ) { - if ( SvXMLUnitConverter::convertColor( aColor, sToken ) ) + sal_Int32 nColor(0); + if (::sax::Converter::convertColor( nColor, sToken )) { - _rValue <<= (sal_Int32)aColor.GetColor(); + _rValue <<= nColor; return sal_True; } } @@ -289,7 +292,7 @@ namespace xmloff sal_Int32 nBorderColor = 0; if ( _rValue >>= nBorderColor ) { - SvXMLUnitConverter::convertColor( aOut, Color( nBorderColor ) ); + ::sax::Converter::convertColor(aOut, nBorderColor); bSuccess = sal_True; } } @@ -349,8 +352,8 @@ namespace xmloff sal_Bool ORotationAngleHandler::importXML( const ::rtl::OUString& _rStrImpValue, Any& _rValue, const SvXMLUnitConverter& ) const { double fValue; - sal_Bool bSucces = - SvXMLUnitConverter::convertDouble(fValue, _rStrImpValue); + bool const bSucces = + ::sax::Converter::convertDouble(fValue, _rStrImpValue); if (bSucces) { fValue *= 10; @@ -369,7 +372,7 @@ namespace xmloff if (bSuccess) { rtl::OUStringBuffer sValue; - SvXMLUnitConverter::convertDouble(sValue, ((double)fAngle) / 10); + ::sax::Converter::convertDouble(sValue, ((double)fAngle) / 10); _rStrExpValue = sValue.makeStringAndClear(); } diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx index ca97ad0d6d47..ca3b8c65390c 100644 --- a/xmloff/source/forms/elementexport.cxx +++ b/xmloff/source/forms/elementexport.cxx @@ -57,6 +57,7 @@ #include <com/sun/star/awt/ImagePosition.hpp> /** === end UNO includes === **/ +#include <sax/tools/converter.hxx> #include <tools/wintypes.hxx> // for check states #include <xmloff/txtprmap.hxx> #include <com/sun/star/form/binding/XBindableValue.hpp> @@ -1339,7 +1340,7 @@ namespace xmloff // the string for "true" ::rtl::OUString sTrue; ::rtl::OUStringBuffer sBuffer; - m_rContext.getGlobalContext().GetMM100UnitConverter().convertBool(sBuffer, sal_True); + ::sax::Converter::convertBool(sBuffer, true); sTrue = sBuffer.makeStringAndClear(); // loop through both lists ('til the maximum of both lengths) diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx index 6fc8d17bef62..678fd2023a6e 100644 --- a/xmloff/source/forms/elementimport.cxx +++ b/xmloff/source/forms/elementimport.cxx @@ -55,6 +55,7 @@ #include <com/sun/star/beans/PropertyAttribute.hpp> /** === end UNO includes === **/ +#include <sax/tools/converter.hxx> #include <tools/urlobj.hxx> #include <tools/diagnose_ex.h> #include <tools/time.hxx> @@ -84,6 +85,7 @@ namespace xmloff using namespace ::com::sun::star::util; using namespace ::com::sun::star::text; using namespace ::comphelper; + using ::com::sun::star::xml::sax::XAttributeList; #define PROPID_VALUE 1 #define PROPID_CURRENT_VALUE 2 @@ -179,7 +181,7 @@ namespace xmloff } //--------------------------------------------------------------------- - void OElementImport::StartElement(const Reference< sax::XAttributeList >& _rxAttrList) + void OElementImport::StartElement(const Reference< XAttributeList >& _rxAttrList) { ENTER_LOG_CONTEXT( "xmloff::OElementImport - importing one element" ); @@ -212,7 +214,7 @@ namespace xmloff //--------------------------------------------------------------------- SvXMLImportContext* OElementImport::CreateChildContext(sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName, - const Reference< sax::XAttributeList >& _rxAttrList) + const Reference< XAttributeList >& _rxAttrList) { if( token::IsXMLToken(_rLocalName, token::XML_EVENT_LISTENERS) && (XML_NAMESPACE_OFFICE == _nPrefix)) return new OFormEventsImportContext(m_rFormImport.getGlobalContext(), _nPrefix, _rLocalName, *this); @@ -726,7 +728,7 @@ namespace xmloff } //--------------------------------------------------------------------- - void OControlImport::addOuterAttributes(const Reference< sax::XAttributeList >& _rxOuterAttribs) + void OControlImport::addOuterAttributes(const Reference< XAttributeList >& _rxOuterAttribs) { OSL_ENSURE(!m_xOuterAttributes.is(), "OControlImport::addOuterAttributes: already have these attributes!"); m_xOuterAttributes = _rxOuterAttribs; @@ -831,7 +833,7 @@ namespace xmloff } //--------------------------------------------------------------------- - void OControlImport::StartElement(const Reference< sax::XAttributeList >& _rxAttrList) + void OControlImport::StartElement(const Reference< XAttributeList >& _rxAttrList) { ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > xAttributes; if( m_xOuterAttributes.is() ) @@ -970,7 +972,7 @@ namespace xmloff // Both properties are allowed to have a double or a string value, // so first try to convert the string into a number double nValue; - if (GetImport().GetMM100UnitConverter().convertDouble(nValue, sValue)) + if (::sax::Converter::convertDouble(nValue, sValue)) _rPropValue.Value <<= nValue; else _rPropValue.Value <<= sValue; @@ -1180,7 +1182,7 @@ namespace xmloff } //--------------------------------------------------------------------- - void OImagePositionImport::StartElement(const Reference< sax::XAttributeList >& _rxAttrList) + void OImagePositionImport::StartElement(const Reference< XAttributeList >& _rxAttrList) { OControlImport::StartElement( _rxAttrList ); @@ -1214,7 +1216,7 @@ namespace xmloff } //--------------------------------------------------------------------- - void OReferredControlImport::StartElement(const Reference< sax::XAttributeList >& _rxAttrList) + void OReferredControlImport::StartElement(const Reference< XAttributeList >& _rxAttrList) { OControlImport::StartElement(_rxAttrList); @@ -1363,7 +1365,7 @@ namespace xmloff } //--------------------------------------------------------------------- - void OButtonImport::StartElement(const Reference< sax::XAttributeList >& _rxAttrList) + void OButtonImport::StartElement(const Reference< XAttributeList >& _rxAttrList) { OURLReferenceImport::StartElement(_rxAttrList); @@ -1388,14 +1390,14 @@ namespace xmloff { if ( _rLocalName.equalsAscii( OAttributeMetaData::getSpecialAttributeName( SCA_STEP_SIZE ) ) ) { - GetImport().GetMM100UnitConverter().convertNumber( m_nStepSizeValue, _rValue ); + ::sax::Converter::convertNumber( m_nStepSizeValue, _rValue ); return true; } return OControlImport::handleAttribute( _nNamespaceKey, _rLocalName, _rValue ); } //--------------------------------------------------------------------- - void OValueRangeImport::StartElement( const Reference< sax::XAttributeList >& _rxAttrList ) + void OValueRangeImport::StartElement( const Reference< XAttributeList >& _rxAttrList ) { OControlImport::StartElement( _rxAttrList ); @@ -1423,7 +1425,7 @@ namespace xmloff //--------------------------------------------------------------------- SvXMLImportContext* OTextLikeImport::CreateChildContext( sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName, - const Reference< sax::XAttributeList >& _rxAttrList ) + const Reference< XAttributeList >& _rxAttrList ) { if ( ( XML_NAMESPACE_TEXT == _nPrefix ) && _rLocalName.equalsIgnoreAsciiCaseAscii( "p" ) ) { @@ -1463,7 +1465,7 @@ namespace xmloff } //--------------------------------------------------------------------- - void OTextLikeImport::StartElement(const Reference< sax::XAttributeList >& _rxAttrList) + void OTextLikeImport::StartElement(const Reference< XAttributeList >& _rxAttrList) { OControlImport::StartElement(_rxAttrList); @@ -1618,7 +1620,7 @@ namespace xmloff //--------------------------------------------------------------------- SvXMLImportContext* OListAndComboImport::CreateChildContext(sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName, - const Reference< sax::XAttributeList >& _rxAttrList) + const Reference< XAttributeList >& _rxAttrList) { // is it the "option" sub tag of a listbox ? static const ::rtl::OUString s_sOptionElementName(RTL_CONSTASCII_USTRINGPARAM("option")); @@ -1635,7 +1637,7 @@ namespace xmloff } //--------------------------------------------------------------------- - void OListAndComboImport::StartElement(const Reference< sax::XAttributeList >& _rxAttrList) + void OListAndComboImport::StartElement(const Reference< XAttributeList >& _rxAttrList) { m_bLinkWithIndexes = sal_False; @@ -1833,7 +1835,7 @@ namespace xmloff } //--------------------------------------------------------------------- - void OListOptionImport::StartElement(const Reference< sax::XAttributeList >& _rxAttrList) + void OListOptionImport::StartElement(const Reference< XAttributeList >& _rxAttrList) { // the label and the value const SvXMLNamespaceMap& rMap = GetImport().GetNamespaceMap(); @@ -1877,14 +1879,16 @@ namespace xmloff GetPrefix(), ::rtl::OUString::createFromAscii(OAttributeMetaData::getCommonControlAttributeName(CCA_SELECTED))); // propagate the selected flag - bool bSelected; - GetImport().GetMM100UnitConverter().convertBool(bSelected, _rxAttrList->getValueByName(sSelectedAttribute)); + bool bSelected(false); + ::sax::Converter::convertBool(bSelected, + _rxAttrList->getValueByName(sSelectedAttribute)); if (bSelected) m_xListBoxImport->implSelectCurrentItem(); // same for the default selected - bool bDefaultSelected; - GetImport().GetMM100UnitConverter().convertBool(bDefaultSelected, _rxAttrList->getValueByName(sDefaultSelectedAttribute)); + bool bDefaultSelected(false); + ::sax::Converter::convertBool(bDefaultSelected, + _rxAttrList->getValueByName(sDefaultSelectedAttribute)); if (bDefaultSelected) m_xListBoxImport->implDefaultSelectCurrentItem(); @@ -1903,7 +1907,7 @@ namespace xmloff } //--------------------------------------------------------------------- - void OComboItemImport::StartElement(const Reference< sax::XAttributeList >& _rxAttrList) + void OComboItemImport::StartElement(const Reference< XAttributeList >& _rxAttrList) { const ::rtl::OUString sLabelAttributeName = GetImport().GetNamespaceMap().GetQNameByKey( GetPrefix(), ::rtl::OUString::createFromAscii(OAttributeMetaData::getCommonControlAttributeName(CCA_LABEL))); @@ -1927,7 +1931,7 @@ namespace xmloff } //--------------------------------------------------------------------- SvXMLImportContext* OColumnWrapperImport::CreateChildContext(sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName, - const Reference< sax::XAttributeList >&) + const Reference< XAttributeList >&) { OControlImport* pReturn = implCreateChildContext(_nPrefix, _rLocalName, OElementNameMap::getElementType(_rLocalName)); if (pReturn) @@ -1938,7 +1942,7 @@ namespace xmloff return pReturn; } //--------------------------------------------------------------------- - void OColumnWrapperImport::StartElement(const Reference< sax::XAttributeList >& _rxAttrList) + void OColumnWrapperImport::StartElement(const Reference< XAttributeList >& _rxAttrList) { OSL_ENSURE(!m_xOwnAttributes.is(), "OColumnWrapperImport::StartElement: aready have the cloned list!"); @@ -1946,7 +1950,7 @@ namespace xmloff Reference< XCloneable > xCloneList(_rxAttrList, UNO_QUERY); OSL_ENSURE(xCloneList.is(), "OColumnWrapperImport::StartElement: AttributeList not cloneable!"); if ( xCloneList.is() ) - m_xOwnAttributes = Reference< sax::XAttributeList >(xCloneList->createClone(), UNO_QUERY); + m_xOwnAttributes = Reference< XAttributeList >(xCloneList->createClone(), UNO_QUERY); OSL_ENSURE(m_xOwnAttributes.is(), "OColumnWrapperImport::StartElement: no cloned list!"); } @@ -2015,7 +2019,7 @@ namespace xmloff //--------------------------------------------------------------------- SvXMLImportContext* OFormImport::CreateChildContext(sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName, - const Reference< sax::XAttributeList >& _rxAttrList) + const Reference< XAttributeList >& _rxAttrList) { if( token::IsXMLToken(_rLocalName, token::XML_FORM) ) return new OFormImport( m_rFormImport, *this, _nPrefix, _rLocalName, @@ -2033,7 +2037,7 @@ namespace xmloff } //--------------------------------------------------------------------- - void OFormImport::StartElement(const Reference< sax::XAttributeList >& _rxAttrList) + void OFormImport::StartElement(const Reference< XAttributeList >& _rxAttrList) { m_rFormImport.enterEventContext(); OFormImport_Base::StartElement(_rxAttrList); @@ -2109,7 +2113,7 @@ namespace xmloff do { // extract the current element - nNextSep = SvXMLUnitConverter::indexOfComma( + nNextSep = ::sax::Converter::indexOfComma( _rValue, nElementStart); if (-1 == nNextSep) nNextSep = nLength; diff --git a/xmloff/source/forms/formattributes.cxx b/xmloff/source/forms/formattributes.cxx index e65f3c0bf488..0213329ecf30 100644 --- a/xmloff/source/forms/formattributes.cxx +++ b/xmloff/source/forms/formattributes.cxx @@ -28,7 +28,11 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" + #include "formattributes.hxx" + +#include <sax/tools/converter.hxx> + #include "xmloff/xmlnmspe.hxx" #include <xmloff/xmluconv.hxx> #include <rtl/ustrbuf.hxx> @@ -281,7 +285,7 @@ namespace xmloff const sal_Bool _bAttributeDefault, const sal_Bool _bInverseSemantics) { ::rtl::OUStringBuffer aDefault; - SvXMLUnitConverter::convertBool(aDefault, _bAttributeDefault); + ::sax::Converter::convertBool(aDefault, _bAttributeDefault); AttributeAssignment& aAssignment = implAdd(_pAttributeName, _rPropertyName, ::getBooleanCppuType(), aDefault.makeStringAndClear()); aAssignment.bInverseSemantics = _bInverseSemantics; } @@ -292,7 +296,7 @@ namespace xmloff const sal_Int16 _nAttributeDefault) { ::rtl::OUStringBuffer aDefault; - SvXMLUnitConverter::convertNumber(aDefault, (sal_Int32)_nAttributeDefault); + ::sax::Converter::convertNumber(aDefault, (sal_Int32)_nAttributeDefault); implAdd(_pAttributeName, _rPropertyName, ::getCppuType( static_cast< sal_Int16* >(NULL) ), aDefault.makeStringAndClear()); } @@ -302,7 +306,7 @@ namespace xmloff const sal_Int32 _nAttributeDefault) { ::rtl::OUStringBuffer aDefault; - SvXMLUnitConverter::convertNumber( aDefault, _nAttributeDefault ); + ::sax::Converter::convertNumber( aDefault, _nAttributeDefault ); implAdd( _pAttributeName, _rPropertyName, ::getCppuType( static_cast< sal_Int32* >(NULL) ), aDefault.makeStringAndClear() ); } diff --git a/xmloff/source/forms/handler/vcl_date_handler.cxx b/xmloff/source/forms/handler/vcl_date_handler.cxx index ef854e3b0105..a24609fc72d1 100644 --- a/xmloff/source/forms/handler/vcl_date_handler.cxx +++ b/xmloff/source/forms/handler/vcl_date_handler.cxx @@ -30,8 +30,12 @@ #include "vcl_date_handler.hxx" #include "xmloff/xmluconv.hxx" +#include <rtl/ustrbuf.hxx> + #include <com/sun/star/util/DateTime.hpp> +#include <sax/tools/converter.hxx> + #include <tools/diagnose_ex.h> #include <tools/date.hxx> @@ -90,7 +94,7 @@ namespace xmloff else { // compatibility format, before we wrote those values in XML-schema compatible form - if ( !SvXMLUnitConverter::convertNumber( nVCLDate, i_attributeValue ) ) + if (!::sax::Converter::convertNumber(nVCLDate, i_attributeValue)) { OSL_ENSURE( false, "VCLDateHandler::getPropertyValues: unknown date format (no XML-schema date, no legacy integer)!" ); return false; diff --git a/xmloff/source/forms/handler/vcl_time_handler.cxx b/xmloff/source/forms/handler/vcl_time_handler.cxx index b5b729986e82..837c533cc2e7 100644 --- a/xmloff/source/forms/handler/vcl_time_handler.cxx +++ b/xmloff/source/forms/handler/vcl_time_handler.cxx @@ -30,8 +30,12 @@ #include "vcl_time_handler.hxx" #include "xmloff/xmluconv.hxx" +#include <rtl/ustrbuf.hxx> + #include <com/sun/star/util/DateTime.hpp> +#include <sax/tools/converter.hxx> + #include <tools/diagnose_ex.h> #include <tools/time.hxx> @@ -91,7 +95,7 @@ namespace xmloff else { // compatibility format, before we wrote those values in XML-schema compatible form - if ( !SvXMLUnitConverter::convertNumber( nVCLTime, i_attributeValue ) ) + if (!::sax::Converter::convertNumber(nVCLTime, i_attributeValue)) { OSL_ENSURE( false, "VCLTimeHandler::getPropertyValues: unknown time format (no XML-schema time, no legacy integer)!" ); return false; diff --git a/xmloff/source/forms/officeforms.cxx b/xmloff/source/forms/officeforms.cxx index 614ca54796bd..a7832e8387bf 100644 --- a/xmloff/source/forms/officeforms.cxx +++ b/xmloff/source/forms/officeforms.cxx @@ -28,8 +28,11 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" + #include "officeforms.hxx" -#include <xmloff/xmluconv.hxx> + +#include <sax/tools/converter.hxx> + #include <xmloff/xmltoken.hxx> #include "xmloff/xmlnmspe.hxx" #include <xmloff/xmlexp.hxx> @@ -49,6 +52,7 @@ namespace xmloff using namespace ::com::sun::star::frame; using namespace ::com::sun::star::xml; using ::xmloff::token::XML_FORMS; + using ::com::sun::star::xml::sax::XAttributeList; //========================================================================= //= OFormsRootImport @@ -67,13 +71,13 @@ namespace xmloff //------------------------------------------------------------------------- SvXMLImportContext* OFormsRootImport::CreateChildContext( sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName, - const Reference< sax::XAttributeList>& xAttrList ) + const Reference< XAttributeList>& xAttrList ) { return GetImport().GetFormImport()->createContext( _nPrefix, _rLocalName, xAttrList ); } //------------------------------------------------------------------------- - void OFormsRootImport::implImportBool(const Reference< sax::XAttributeList >& _rxAttributes, OfficeFormsAttributes _eAttribute, + void OFormsRootImport::implImportBool(const Reference< XAttributeList >& _rxAttributes, OfficeFormsAttributes _eAttribute, const Reference< XPropertySet >& _rxProps, const Reference< XPropertySetInfo >& _rxPropInfo, const ::rtl::OUString& _rPropName, sal_Bool _bDefault) { @@ -85,15 +89,17 @@ namespace xmloff // get and convert the value ::rtl::OUString sAttributeValue = _rxAttributes->getValueByName(sCompleteAttributeName); bool bValue = _bDefault; - GetImport().GetMM100UnitConverter().convertBool(bValue, sAttributeValue); + ::sax::Converter::convertBool(bValue, sAttributeValue); // set the property if (_rxPropInfo->hasPropertyByName(_rPropName)) - _rxProps->setPropertyValue(_rPropName, ::cppu::bool2any(bValue)); + { + _rxProps->setPropertyValue(_rPropName, makeAny(bValue)); + } } //------------------------------------------------------------------------- - void OFormsRootImport::StartElement( const Reference< sax::XAttributeList >& _rxAttrList ) + void OFormsRootImport::StartElement( const Reference< XAttributeList >& _rxAttrList ) { ENTER_LOG_CONTEXT( "xmloff::OFormsRootImport - importing the complete tree" ); SvXMLImportContext::StartElement( _rxAttrList ); @@ -155,7 +161,7 @@ namespace xmloff // convert into a string ::rtl::OUStringBuffer aValue; - _rExp.GetMM100UnitConverter().convertBool(aValue, bValue); + ::sax::Converter::convertBool(aValue, bValue); // add the attribute _rExp.AddAttribute( diff --git a/xmloff/source/forms/propertyexport.cxx b/xmloff/source/forms/propertyexport.cxx index 577405723a15..13d770e7e2b3 100644 --- a/xmloff/source/forms/propertyexport.cxx +++ b/xmloff/source/forms/propertyexport.cxx @@ -36,6 +36,7 @@ #include "xmloff/xmlnmspe.hxx" #include <xmloff/xmluconv.hxx> #include <xmloff/families.hxx> +#include <sax/tools/converter.hxx> #include <osl/diagnose.h> #include <rtl/strbuf.hxx> #include <com/sun/star/beans/PropertyAttribute.hpp> @@ -77,9 +78,9 @@ namespace xmloff { // caching ::rtl::OUStringBuffer aBuffer; - m_rContext.getGlobalContext().GetMM100UnitConverter().convertBool(aBuffer, sal_True); + ::sax::Converter::convertBool(aBuffer, true); m_sValueTrue = aBuffer.makeStringAndClear(); - m_rContext.getGlobalContext().GetMM100UnitConverter().convertBool(aBuffer, sal_False); + ::sax::Converter::convertBool(aBuffer, false); m_sValueFalse = aBuffer.makeStringAndClear(); OSL_ENSURE(m_xPropertyInfo.is(), "OPropertyExport::OPropertyExport: need an XPropertySetInfo!"); @@ -338,7 +339,7 @@ namespace xmloff { // let the formatter of the export context build a string ::rtl::OUStringBuffer sBuffer; - m_rContext.getGlobalContext().GetMM100UnitConverter().convertNumber(sBuffer, (sal_Int32)nCurrentValue); + ::sax::Converter::convertNumber(sBuffer, (sal_Int32)nCurrentValue); AddAttribute(_nNamespaceKey, _pAttributeName, sBuffer.makeStringAndClear()); } @@ -362,7 +363,7 @@ namespace xmloff { // let the formatter of the export context build a string ::rtl::OUStringBuffer sBuffer; - m_rContext.getGlobalContext().GetMM100UnitConverter().convertNumber( sBuffer, nCurrentValue ); + ::sax::Converter::convertNumber( sBuffer, nCurrentValue ); AddAttribute( _nNamespaceKey, _pAttributeName, sBuffer.makeStringAndClear() ); } @@ -560,7 +561,7 @@ namespace xmloff break; case TypeClass_DOUBLE: // let the unit converter format is as string - m_rContext.getGlobalContext().GetMM100UnitConverter().convertDouble(aBuffer, getDouble(_rValue)); + ::sax::Converter::convertDouble(aBuffer, getDouble(_rValue)); break; case TypeClass_BOOLEAN: aBuffer = getBOOL(_rValue) ? m_sValueTrue : m_sValueFalse; @@ -569,7 +570,7 @@ namespace xmloff case TypeClass_SHORT: case TypeClass_LONG: // let the unit converter format is as string - m_rContext.getGlobalContext().GetMM100UnitConverter().convertNumber(aBuffer, getINT32(_rValue)); + ::sax::Converter::convertNumber(aBuffer, getINT32(_rValue)); break; case TypeClass_HYPER: // TODO @@ -580,7 +581,7 @@ namespace xmloff // convert it into an int32 sal_Int32 nValue = 0; ::cppu::enum2int(nValue, _rValue); - m_rContext.getGlobalContext().GetMM100UnitConverter().convertNumber(aBuffer, nValue); + ::sax::Converter::convertNumber(aBuffer, nValue); } break; default: @@ -619,7 +620,7 @@ namespace xmloff break; } // let the unit converter format is as string - m_rContext.getGlobalContext().GetMM100UnitConverter().convertDouble(aBuffer, fValue); + ::sax::Converter::convertDouble(aBuffer, fValue); } break; } diff --git a/xmloff/source/forms/propertyimport.cxx b/xmloff/source/forms/propertyimport.cxx index 28d6ce7f7bba..e25411bb2db4 100644 --- a/xmloff/source/forms/propertyimport.cxx +++ b/xmloff/source/forms/propertyimport.cxx @@ -28,7 +28,11 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" + #include "propertyimport.hxx" + +#include <sax/tools/converter.hxx> + #include <xmloff/xmlimp.hxx> #include <xmloff/xmluconv.hxx> #include <xmloff/nmspmap.hxx> @@ -60,6 +64,7 @@ namespace xmloff using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::xml; + using ::com::sun::star::xml::sax::XAttributeList; // NO using namespace ...util !!! // need a tools Date/Time/DateTime below, which would conflict with the uno types then @@ -115,7 +120,7 @@ Any PropertyConversion::convertString( SvXMLImport& _rImporter, const ::com::sun #if OSL_DEBUG_LEVEL > 0 sal_Bool bSuccess = #endif - _rImporter.GetMM100UnitConverter().convertBool(bValue, _rReadCharacters); + ::sax::Converter::convertBool(bValue, _rReadCharacters); OSL_ENSURE(bSuccess, ::rtl::OStringBuffer("PropertyConversion::convertString: could not convert \""). append(::rtl::OUStringToOString(_rReadCharacters, RTL_TEXTENCODING_ASCII_US)). @@ -131,7 +136,7 @@ Any PropertyConversion::convertString( SvXMLImport& _rImporter, const ::com::sun #if OSL_DEBUG_LEVEL > 0 sal_Bool bSuccess = #endif - _rImporter.GetMM100UnitConverter().convertNumber(nValue, _rReadCharacters); + ::sax::Converter::convertNumber(nValue, _rReadCharacters); OSL_ENSURE(bSuccess, ::rtl::OStringBuffer("PropertyConversion::convertString: could not convert \""). append(::rtl::OUStringToOString(_rReadCharacters, RTL_TEXTENCODING_ASCII_US)). @@ -172,7 +177,7 @@ Any PropertyConversion::convertString( SvXMLImport& _rImporter, const ::com::sun #if OSL_DEBUG_LEVEL > 0 sal_Bool bSuccess = #endif - _rImporter.GetMM100UnitConverter().convertDouble(nValue, _rReadCharacters); + ::sax::Converter::convertDouble(nValue, _rReadCharacters); OSL_ENSURE(bSuccess, ::rtl::OStringBuffer("PropertyConversion::convertString: could not convert \""). append(::rtl::OUStringToOString(_rReadCharacters, RTL_TEXTENCODING_ASCII_US)). @@ -200,7 +205,7 @@ Any PropertyConversion::convertString( SvXMLImport& _rImporter, const ::com::sun #if OSL_DEBUG_LEVEL > 0 sal_Bool bSuccess = #endif - _rImporter.GetMM100UnitConverter().convertDouble(nValue, _rReadCharacters); + ::sax::Converter::convertDouble(nValue, _rReadCharacters); OSL_ENSURE(bSuccess, ::rtl::OStringBuffer("PropertyConversion::convertString: could not convert \""). append(::rtl::OUStringToOString(_rReadCharacters, RTL_TEXTENCODING_ASCII_US)). @@ -288,7 +293,7 @@ OPropertyImport::OPropertyImport(OFormLayerXMLImport_Impl& _rImport, sal_uInt16 //--------------------------------------------------------------------- SvXMLImportContext* OPropertyImport::CreateChildContext(sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName, - const Reference< sax::XAttributeList >& _rxAttrList) + const Reference< XAttributeList >& _rxAttrList) { if( token::IsXMLToken( _rLocalName, token::XML_PROPERTIES) ) { @@ -305,7 +310,7 @@ SvXMLImportContext* OPropertyImport::CreateChildContext(sal_uInt16 _nPrefix, con } //--------------------------------------------------------------------- -void OPropertyImport::StartElement(const Reference< sax::XAttributeList >& _rxAttrList) +void OPropertyImport::StartElement(const Reference< XAttributeList >& _rxAttrList) { OSL_ENSURE(_rxAttrList.is(), "OPropertyImport::StartElement: invalid attribute list!"); const sal_Int32 nAttributeCount = _rxAttrList->getLength(); @@ -392,7 +397,7 @@ OPropertyElementsContext::OPropertyElementsContext(SvXMLImport& _rImport, sal_uI //--------------------------------------------------------------------- SvXMLImportContext* OPropertyElementsContext::CreateChildContext(sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName, - const Reference< sax::XAttributeList >&) + const Reference< XAttributeList >&) { if( token::IsXMLToken( _rLocalName, token::XML_PROPERTY ) ) { @@ -413,7 +418,7 @@ SvXMLImportContext* OPropertyElementsContext::CreateChildContext(sal_uInt16 _nPr #if OSL_DEBUG_LEVEL > 0 //--------------------------------------------------------------------- - void OPropertyElementsContext::StartElement(const Reference< sax::XAttributeList >& _rxAttrList) + void OPropertyElementsContext::StartElement(const Reference< XAttributeList >& _rxAttrList) { OSL_ENSURE(0 == _rxAttrList->getLength(), "OPropertyElementsContext::StartElement: the form:properties element should not have attributes!"); SvXMLImportContext::StartElement(_rxAttrList); @@ -441,7 +446,7 @@ OSinglePropertyContext::OSinglePropertyContext(SvXMLImport& _rImport, sal_uInt16 //--------------------------------------------------------------------- SvXMLImportContext* OSinglePropertyContext::CreateChildContext(sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName, - const Reference< sax::XAttributeList >&) + const Reference< XAttributeList >&) { OSL_FAIL(::rtl::OStringBuffer("OSinglePropertyContext::CreateChildContext: unknown child element (\""). append(::rtl::OUStringToOString(_rLocalName, RTL_TEXTENCODING_ASCII_US)). @@ -450,7 +455,7 @@ SvXMLImportContext* OSinglePropertyContext::CreateChildContext(sal_uInt16 _nPref } //--------------------------------------------------------------------- -void OSinglePropertyContext::StartElement(const Reference< sax::XAttributeList >& _rxAttrList) +void OSinglePropertyContext::StartElement(const Reference< XAttributeList >& _rxAttrList) { ::com::sun::star::beans::PropertyValue aPropValue; // the property the instance imports currently ::com::sun::star::uno::Type aPropType; // the type of the property the instance imports currently @@ -519,7 +524,7 @@ OListPropertyContext::OListPropertyContext( SvXMLImport& _rImport, sal_uInt16 _n } //--------------------------------------------------------------------- -void OListPropertyContext::StartElement( const Reference< sax::XAttributeList >& _rxAttrList ) +void OListPropertyContext::StartElement( const Reference< XAttributeList >& _rxAttrList ) { sal_Int32 nAttributeCount = _rxAttrList->getLength(); @@ -578,7 +583,7 @@ void OListPropertyContext::EndElement() } //--------------------------------------------------------------------- -SvXMLImportContext* OListPropertyContext::CreateChildContext( sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName, const Reference< sax::XAttributeList >& /*_rxAttrList*/ ) +SvXMLImportContext* OListPropertyContext::CreateChildContext( sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName, const Reference< XAttributeList >& /*_rxAttrList*/ ) { if ( token::IsXMLToken( _rLocalName, token::XML_LIST_VALUE ) ) { @@ -605,7 +610,7 @@ OListValueContext::OListValueContext( SvXMLImport& _rImport, sal_uInt16 _nPrefix } //--------------------------------------------------------------------- -void OListValueContext::StartElement( const Reference< sax::XAttributeList >& _rxAttrList ) +void OListValueContext::StartElement( const Reference< XAttributeList >& _rxAttrList ) { const sal_Int32 nAttributeCount = _rxAttrList->getLength(); diff --git a/xmloff/source/style/DashStyle.cxx b/xmloff/source/style/DashStyle.cxx index 97f187b5178e..c81b22880fa7 100644 --- a/xmloff/source/style/DashStyle.cxx +++ b/xmloff/source/style/DashStyle.cxx @@ -28,8 +28,12 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" + #include <com/sun/star/drawing/DashStyle.hpp> #include <com/sun/star/drawing/LineDash.hpp> + +#include <sax/tools/converter.hxx> + #include "xmloff/DashStyle.hxx" #include <xmloff/attrlist.hxx> #include <xmloff/nmspmap.hxx> @@ -156,7 +160,7 @@ sal_Bool XMLDashStyleImport::importXML( if( rStrValue.indexOf( sal_Unicode('%') ) != -1 ) // its a percentage { bIsRel = sal_True; - rUnitConverter.convertPercent( aLineDash.DotLen, rStrValue ); + ::sax::Converter::convertPercent(aLineDash.DotLen, rStrValue); } else { @@ -174,7 +178,7 @@ sal_Bool XMLDashStyleImport::importXML( if( rStrValue.indexOf( sal_Unicode('%') ) != -1 ) // its a percentage { bIsRel = sal_True; - rUnitConverter.convertPercent( aLineDash.DashLen, rStrValue ); + ::sax::Converter::convertPercent(aLineDash.DashLen, rStrValue); } else { @@ -188,7 +192,7 @@ sal_Bool XMLDashStyleImport::importXML( if( rStrValue.indexOf( sal_Unicode('%') ) != -1 ) // its a percentage { bIsRel = sal_True; - rUnitConverter.convertPercent( aLineDash.Distance, rStrValue ); + ::sax::Converter::convertPercent(aLineDash.Distance, rStrValue); } else { @@ -274,7 +278,7 @@ sal_Bool XMLDashStyleExport::exportXML( // dashes length if( bIsRel ) { - rUnitConverter.convertPercent( aOut, aLineDash.DotLen ); + ::sax::Converter::convertPercent(aOut, aLineDash.DotLen); } else { @@ -295,7 +299,7 @@ sal_Bool XMLDashStyleExport::exportXML( // dashes length if( bIsRel ) { - rUnitConverter.convertPercent( aOut, aLineDash.DashLen ); + ::sax::Converter::convertPercent(aOut, aLineDash.DashLen); } else { @@ -309,7 +313,7 @@ sal_Bool XMLDashStyleExport::exportXML( // distance if( bIsRel ) { - rUnitConverter.convertPercent( aOut, aLineDash.Distance ); + ::sax::Converter::convertPercent( aOut, aLineDash.Distance ); } else { diff --git a/xmloff/source/style/DrawAspectHdl.cxx b/xmloff/source/style/DrawAspectHdl.cxx index 754e22b27d47..b916a0513807 100644 --- a/xmloff/source/style/DrawAspectHdl.cxx +++ b/xmloff/source/style/DrawAspectHdl.cxx @@ -28,11 +28,20 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" + +#include "DrawAspectHdl.hxx" + #include <com/sun/star/uno/Any.hxx> + #include <rtl/ustrbuf.hxx> -#include <xmloff/xmluconv.hxx> + +#include <tools/solar.h> + +#include <sax/tools/converter.hxx> + +#include <xmloff/xmlement.hxx> #include <xmloff/xmltoken.hxx> -#include "DrawAspectHdl.hxx" + using ::rtl::OUString; using ::rtl::OUStringBuffer; @@ -63,7 +72,7 @@ sal_Bool DrawAspectHdl::importXML( const OUString& rStrImpValue, uno::Any& rValu { sal_Int64 nAspect = 0; - SvXMLUnitConverter::convertNumber64( nAspect, rStrImpValue ); + ::sax::Converter::convertNumber64( nAspect, rStrImpValue ); rValue <<= nAspect; return nAspect > 0; diff --git a/xmloff/source/style/GradientStyle.cxx b/xmloff/source/style/GradientStyle.cxx index c468f2907d1e..24b28ab924ba 100644 --- a/xmloff/source/style/GradientStyle.cxx +++ b/xmloff/source/style/GradientStyle.cxx @@ -28,8 +28,13 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" + #include "xmloff/GradientStyle.hxx" + #include <com/sun/star/awt/Gradient.hpp> + +#include <sax/tools/converter.hxx> + #include <xmloff/attrlist.hxx> #include <xmloff/nmspmap.hxx> #include <xmloff/xmluconv.hxx> @@ -165,46 +170,42 @@ sal_Bool XMLGradientStyleImport::importXML( } break; case XML_TOK_GRADIENT_CX: - SvXMLUnitConverter::convertPercent( nTmpValue, rStrValue ); + ::sax::Converter::convertPercent( nTmpValue, rStrValue ); aGradient.XOffset = static_cast< sal_Int16 >( nTmpValue ); break; case XML_TOK_GRADIENT_CY: - SvXMLUnitConverter::convertPercent( nTmpValue, rStrValue ); + ::sax::Converter::convertPercent( nTmpValue, rStrValue ); aGradient.YOffset = static_cast< sal_Int16 >( nTmpValue ); break; case XML_TOK_GRADIENT_STARTCOLOR: { - Color aColor; - bHasStartColor = SvXMLUnitConverter::convertColor( aColor, rStrValue ); - if( bHasStartColor ) - aGradient.StartColor = (sal_Int32)( aColor.GetColor() ); + bHasStartColor = ::sax::Converter::convertColor( + aGradient.StartColor, rStrValue); } break; case XML_TOK_GRADIENT_ENDCOLOR: { - Color aColor; - bHasStartColor = SvXMLUnitConverter::convertColor( aColor, rStrValue ); - if( bHasStartColor ) - aGradient.EndColor = (sal_Int32)( aColor.GetColor() ); + bHasStartColor = ::sax::Converter::convertColor( + aGradient.EndColor, rStrValue); } break; case XML_TOK_GRADIENT_STARTINT: - SvXMLUnitConverter::convertPercent( nTmpValue, rStrValue ); + ::sax::Converter::convertPercent( nTmpValue, rStrValue ); aGradient.StartIntensity = static_cast< sal_Int16 >( nTmpValue ); break; case XML_TOK_GRADIENT_ENDINT: - SvXMLUnitConverter::convertPercent( nTmpValue, rStrValue ); + ::sax::Converter::convertPercent( nTmpValue, rStrValue ); aGradient.EndIntensity = static_cast< sal_Int16 >( nTmpValue ); break; case XML_TOK_GRADIENT_ANGLE: { sal_Int32 nValue; - SvXMLUnitConverter::convertNumber( nValue, rStrValue, 0, 3600 ); + ::sax::Converter::convertNumber( nValue, rStrValue, 0, 3600 ); aGradient.Angle = sal_Int16( nValue ); } break; case XML_TOK_GRADIENT_BORDER: - SvXMLUnitConverter::convertPercent( nTmpValue, rStrValue ); + ::sax::Converter::convertPercent( nTmpValue, rStrValue ); aGradient.Border = static_cast< sal_Int16 >( nTmpValue ); break; @@ -284,49 +285,44 @@ sal_Bool XMLGradientStyleExport::exportXML( if( aGradient.Style != awt::GradientStyle_LINEAR && aGradient.Style != awt::GradientStyle_AXIAL ) { - SvXMLUnitConverter::convertPercent( aOut, aGradient.XOffset ); + ::sax::Converter::convertPercent(aOut, aGradient.XOffset); aStrValue = aOut.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_CX, aStrValue ); - - SvXMLUnitConverter::convertPercent( aOut, aGradient.YOffset ); + ::sax::Converter::convertPercent(aOut, aGradient.YOffset); aStrValue = aOut.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_CY, aStrValue ); } - Color aColor; - // Color start - aColor.SetColor( aGradient.StartColor ); - SvXMLUnitConverter::convertColor( aOut, aColor ); + ::sax::Converter::convertColor(aOut, aGradient.StartColor); aStrValue = aOut.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_START_COLOR, aStrValue ); // Color end - aColor.SetColor( aGradient.EndColor ); - SvXMLUnitConverter::convertColor( aOut, aColor ); + ::sax::Converter::convertColor(aOut, aGradient.EndColor); aStrValue = aOut.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_END_COLOR, aStrValue ); // Intensity start - SvXMLUnitConverter::convertPercent( aOut, aGradient.StartIntensity ); + ::sax::Converter::convertPercent(aOut, aGradient.StartIntensity); aStrValue = aOut.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_START_INTENSITY, aStrValue ); // Intensity end - SvXMLUnitConverter::convertPercent( aOut, aGradient.EndIntensity ); + ::sax::Converter::convertPercent(aOut, aGradient.EndIntensity); aStrValue = aOut.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_END_INTENSITY, aStrValue ); // Angle if( aGradient.Style != awt::GradientStyle_RADIAL ) { - SvXMLUnitConverter::convertNumber( aOut, sal_Int32( aGradient.Angle ) ); + ::sax::Converter::convertNumber(aOut, sal_Int32(aGradient.Angle)); aStrValue = aOut.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_GRADIENT_ANGLE, aStrValue ); } // Border - SvXMLUnitConverter::convertPercent( aOut, aGradient.Border ); + ::sax::Converter::convertPercent( aOut, aGradient.Border ); aStrValue = aOut.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_GRADIENT_BORDER, aStrValue ); diff --git a/xmloff/source/style/HatchStyle.cxx b/xmloff/source/style/HatchStyle.cxx index ded1ad105cb7..2a0be91b6e87 100644 --- a/xmloff/source/style/HatchStyle.cxx +++ b/xmloff/source/style/HatchStyle.cxx @@ -28,8 +28,13 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" + #include "xmloff/HatchStyle.hxx" + #include <com/sun/star/drawing/Hatch.hpp> + +#include <sax/tools/converter.hxx> + #include <xmloff/nmspmap.hxx> #include <xmloff/xmluconv.hxx> #include "xmloff/xmlnmspe.hxx" @@ -145,10 +150,8 @@ sal_Bool XMLHatchStyleImport::importXML( break; case XML_TOK_HATCH_COLOR: { - Color aColor; - bHasColor = rUnitConverter.convertColor( aColor, rStrValue ); - if( bHasColor ) - aHatch.Color = (sal_Int32)( aColor.GetColor() ); + bHasColor = ::sax::Converter::convertColor( + aHatch.Color, rStrValue); } break; case XML_TOK_HATCH_DISTANCE: @@ -157,7 +160,7 @@ sal_Bool XMLHatchStyleImport::importXML( case XML_TOK_HATCH_ROTATION: { sal_Int32 nValue; - rUnitConverter.convertNumber( nValue, rStrValue, 0, 3600 ); + ::sax::Converter::convertNumber(nValue, rStrValue, 0, 3600); aHatch.Angle = sal_Int16( nValue ); } break; @@ -235,7 +238,7 @@ sal_Bool XMLHatchStyleExport::exportXML( rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_STYLE, aStrValue ); // Color - rUnitConverter.convertColor( aOut, Color( aHatch.Color ) ); + ::sax::Converter::convertColor(aOut, aHatch.Color); aStrValue = aOut.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_COLOR, aStrValue ); @@ -245,7 +248,7 @@ sal_Bool XMLHatchStyleExport::exportXML( rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_HATCH_DISTANCE, aStrValue ); // Angle - rUnitConverter.convertNumber( aOut, sal_Int32( aHatch.Angle ) ); + ::sax::Converter::convertNumber(aOut, sal_Int32(aHatch.Angle)); aStrValue = aOut.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_ROTATION, aStrValue ); diff --git a/xmloff/source/style/PageMasterPropHdl.cxx b/xmloff/source/style/PageMasterPropHdl.cxx index 4fb090f32662..e1bac4f60d08 100644 --- a/xmloff/source/style/PageMasterPropHdl.cxx +++ b/xmloff/source/style/PageMasterPropHdl.cxx @@ -28,7 +28,11 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" + #include "PageMasterPropHdl.hxx" + +#include <sax/tools/converter.hxx> + #include <xmloff/xmltoken.hxx> #include <xmloff/xmluconv.hxx> #include <xmloff/xmlnumi.hxx> @@ -259,7 +263,7 @@ sal_Bool XMLPMPropHdl_PaperTrayNumber::importXML( else { sal_Int32 nPaperTray; - if( SvXMLUnitConverter::convertNumber( nPaperTray, rStrImpValue, 0 ) ) + if (::sax::Converter::convertNumber( nPaperTray, rStrImpValue, 0 )) { rValue <<= nPaperTray; bRet = sal_True; @@ -284,7 +288,7 @@ sal_Bool XMLPMPropHdl_PaperTrayNumber::exportXML( else { OUStringBuffer aBuffer; - SvXMLUnitConverter::convertNumber( aBuffer, nPaperTray ); + ::sax::Converter::convertNumber( aBuffer, nPaperTray ); rStrExpValue = aBuffer.makeStringAndClear(); } bRet = sal_True; diff --git a/xmloff/source/style/TransGradientStyle.cxx b/xmloff/source/style/TransGradientStyle.cxx index cf0ab56d0225..1dcd0c8c951a 100644 --- a/xmloff/source/style/TransGradientStyle.cxx +++ b/xmloff/source/style/TransGradientStyle.cxx @@ -28,8 +28,13 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" + #include "TransGradientStyle.hxx" + #include <com/sun/star/awt/Gradient.hpp> + +#include <sax/tools/converter.hxx> + #include <xmloff/attrlist.hxx> #include <xmloff/nmspmap.hxx> #include <xmloff/xmluconv.hxx> @@ -158,17 +163,17 @@ sal_Bool XMLTransGradientStyleImport::importXML( } break; case XML_TOK_GRADIENT_CX: - SvXMLUnitConverter::convertPercent( nTmpValue, rStrValue ); + ::sax::Converter::convertPercent( nTmpValue, rStrValue ); aGradient.XOffset = sal::static_int_cast< sal_Int16 >(nTmpValue); break; case XML_TOK_GRADIENT_CY: - SvXMLUnitConverter::convertPercent( nTmpValue, rStrValue ); + ::sax::Converter::convertPercent( nTmpValue, rStrValue ); aGradient.YOffset = sal::static_int_cast< sal_Int16 >(nTmpValue); break; case XML_TOK_GRADIENT_START: { sal_Int32 aStartTransparency; - SvXMLUnitConverter::convertPercent( aStartTransparency, rStrValue ); + ::sax::Converter::convertPercent( aStartTransparency, rStrValue ); sal_uInt8 n = sal::static_int_cast< sal_uInt8 >( ( (100 - aStartTransparency) * 255 ) / 100 ); @@ -180,7 +185,7 @@ sal_Bool XMLTransGradientStyleImport::importXML( case XML_TOK_GRADIENT_END: { sal_Int32 aEndTransparency; - SvXMLUnitConverter::convertPercent( aEndTransparency, rStrValue ); + ::sax::Converter::convertPercent( aEndTransparency, rStrValue ); sal_uInt8 n = sal::static_int_cast< sal_uInt8 >( ( (100 - aEndTransparency) * 255 ) / 100 ); @@ -192,12 +197,12 @@ sal_Bool XMLTransGradientStyleImport::importXML( case XML_TOK_GRADIENT_ANGLE: { sal_Int32 nValue; - SvXMLUnitConverter::convertNumber( nValue, rStrValue, 0, 3600 ); + ::sax::Converter::convertNumber( nValue, rStrValue, 0, 3600 ); aGradient.Angle = sal_Int16( nValue ); } break; case XML_TOK_GRADIENT_BORDER: - SvXMLUnitConverter::convertPercent( nTmpValue, rStrValue ); + ::sax::Converter::convertPercent( nTmpValue, rStrValue ); aGradient.Border = sal::static_int_cast< sal_Int16 >(nTmpValue); break; @@ -275,11 +280,11 @@ sal_Bool XMLTransGradientStyleExport::exportXML( if( aGradient.Style != awt::GradientStyle_LINEAR && aGradient.Style != awt::GradientStyle_AXIAL ) { - SvXMLUnitConverter::convertPercent( aOut, aGradient.XOffset ); + ::sax::Converter::convertPercent(aOut, aGradient.XOffset); aStrValue = aOut.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_CX, aStrValue ); - SvXMLUnitConverter::convertPercent( aOut, aGradient.YOffset ); + ::sax::Converter::convertPercent(aOut, aGradient.YOffset); aStrValue = aOut.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_CY, aStrValue ); } @@ -290,27 +295,28 @@ sal_Bool XMLTransGradientStyleExport::exportXML( // Transparency start aColor.SetColor( aGradient.StartColor ); sal_Int32 aStartValue = 100 - (sal_Int32)(((aColor.GetRed() + 1) * 100) / 255); - SvXMLUnitConverter::convertPercent( aOut, aStartValue ); + ::sax::Converter::convertPercent( aOut, aStartValue ); aStrValue = aOut.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_START, aStrValue ); // Transparency end aColor.SetColor( aGradient.EndColor ); sal_Int32 aEndValue = 100 - (sal_Int32)(((aColor.GetRed() + 1) * 100) / 255); - SvXMLUnitConverter::convertPercent( aOut, aEndValue ); + ::sax::Converter::convertPercent( aOut, aEndValue ); aStrValue = aOut.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_END, aStrValue ); // Angle if( aGradient.Style != awt::GradientStyle_RADIAL ) { - SvXMLUnitConverter::convertNumber( aOut, sal_Int32( aGradient.Angle ) ); + ::sax::Converter::convertNumber( + aOut, sal_Int32(aGradient.Angle)); aStrValue = aOut.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_GRADIENT_ANGLE, aStrValue ); } // Border - SvXMLUnitConverter::convertPercent( aOut, aGradient.Border ); + ::sax::Converter::convertPercent( aOut, aGradient.Border ); aStrValue = aOut.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_GRADIENT_BORDER, aStrValue ); diff --git a/xmloff/source/style/XMLBackgroundImageContext.cxx b/xmloff/source/style/XMLBackgroundImageContext.cxx index 4f3bd37d8a21..35ca481b92db 100644 --- a/xmloff/source/style/XMLBackgroundImageContext.cxx +++ b/xmloff/source/style/XMLBackgroundImageContext.cxx @@ -28,8 +28,13 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" -#include <tools/debug.hxx> + #include <com/sun/star/io/XOutputStream.hpp> + +#include <tools/debug.hxx> + +#include <sax/tools/converter.hxx> + #include <xmloff/xmltkmap.hxx> #include <xmloff/xmluconv.hxx> #include "xmloff/xmlnmspe.hxx" @@ -221,7 +226,7 @@ void XMLBackgroundImageContext::ProcessAttrs( else if( -1 != aToken.indexOf( sal_Unicode('%') ) ) { sal_Int32 nPrc = 50; - if( SvXMLUnitConverter::convertPercent( nPrc, aToken ) ) + if (::sax::Converter::convertPercent( nPrc, aToken )) { if( !bHori ) { @@ -321,7 +326,7 @@ void XMLBackgroundImageContext::ProcessAttrs( { sal_Int32 nTmp; // convert from percent and clip - if( SvXMLUnitConverter::convertPercent( nTmp, rValue ) ) + if (::sax::Converter::convertPercent( nTmp, rValue )) { if( (nTmp >= 0) && (nTmp <= 100) ) nTransparency = static_cast<sal_Int8>( 100-nTmp ); diff --git a/xmloff/source/style/XMLBackgroundImageExport.cxx b/xmloff/source/style/XMLBackgroundImageExport.cxx index adeb55009ea4..46d861fa4176 100644 --- a/xmloff/source/style/XMLBackgroundImageExport.cxx +++ b/xmloff/source/style/XMLBackgroundImageExport.cxx @@ -28,14 +28,16 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" + #include <com/sun/star/style/GraphicLocation.hpp> +#include <sax/tools/converter.hxx> + #include <xmloff/xmlnmspe.hxx> #include <xmloff/xmltoken.hxx> #include <rtl/ustrbuf.hxx> #include <xmloff/xmlexp.hxx> #include "XMLBackgroundImageExport.hxx" -#include <xmloff/xmluconv.hxx> using ::rtl::OUString; using ::rtl::OUStringBuffer; @@ -157,7 +159,7 @@ void XMLBackgroundImageExport::exportXML( const Any& rURL, if( (*pTransparency) >>= nTransparency ) { OUStringBuffer aTransOut; - SvXMLUnitConverter::convertPercent( aTransOut, 100-nTransparency ); + ::sax::Converter::convertPercent(aTransOut, 100-nTransparency); GetExport().AddAttribute( XML_NAMESPACE_DRAW, XML_OPACITY, aTransOut.makeStringAndClear() ); } diff --git a/xmloff/source/style/XMLBitmapRepeatOffsetPropertyHandler.cxx b/xmloff/source/style/XMLBitmapRepeatOffsetPropertyHandler.cxx index 6f7143d62da3..0d1bb476cf51 100644 --- a/xmloff/source/style/XMLBitmapRepeatOffsetPropertyHandler.cxx +++ b/xmloff/source/style/XMLBitmapRepeatOffsetPropertyHandler.cxx @@ -30,6 +30,7 @@ #include "precompiled_xmloff.hxx" #include <xmloff/xmltoken.hxx> #include <xmloff/xmluconv.hxx> +#include <sax/tools/converter.hxx> #include <rtl/ustrbuf.hxx> #include <com/sun/star/uno/Any.hxx> #include "XMLBitmapRepeatOffsetPropertyHandler.hxx" @@ -66,7 +67,7 @@ sal_Bool XMLBitmapRepeatOffsetPropertyHandler::importXML( if( aTokenEnum.getNextToken( aToken ) ) { sal_Int32 nValue; - if( SvXMLUnitConverter::convertPercent( nValue, aToken ) ) + if (::sax::Converter::convertPercent( nValue, aToken )) { if( aTokenEnum.getNextToken( aToken ) ) { @@ -93,7 +94,7 @@ sal_Bool XMLBitmapRepeatOffsetPropertyHandler::exportXML( sal_Int32 nValue = 0; if( rValue >>= nValue ) { - SvXMLUnitConverter::convertPercent( aOut, nValue ); + ::sax::Converter::convertPercent( aOut, nValue ); aOut.append( sal_Unicode( ' ' ) ); aOut.append( mbX ? msHorizontal : msVertical ); rStrExpValue = aOut.makeStringAndClear(); diff --git a/xmloff/source/style/XMLFillBitmapSizePropertyHandler.cxx b/xmloff/source/style/XMLFillBitmapSizePropertyHandler.cxx index ac23035e9683..6f1363751214 100644 --- a/xmloff/source/style/XMLFillBitmapSizePropertyHandler.cxx +++ b/xmloff/source/style/XMLFillBitmapSizePropertyHandler.cxx @@ -28,11 +28,13 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" -#include <com/sun/star/uno/Any.hxx> -#include <xmloff/xmluconv.hxx> -#include <rtl/ustrbuf.hxx> + #include "XMLFillBitmapSizePropertyHandler.hxx" +#include <rtl/ustrbuf.hxx> +#include <com/sun/star/uno/Any.hxx> #include <comphelper/extract.hxx> +#include <sax/tools/converter.hxx> +#include <xmloff/xmluconv.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -58,7 +60,7 @@ sal_Bool XMLFillBitmapSizePropertyHandler::importXML( if( rStrImpValue.indexOf( sal_Unicode('%') ) != -1 ) { - bRet = rUnitConverter.convertPercent( nValue, rStrImpValue ); + bRet = ::sax::Converter::convertPercent( nValue, rStrImpValue ); nValue *= -1; } else @@ -84,7 +86,7 @@ sal_Bool XMLFillBitmapSizePropertyHandler::exportXML( { if( nValue < 0 ) { - rUnitConverter.convertPercent( aOut, -nValue ); + ::sax::Converter::convertPercent( aOut, -nValue ); } else { diff --git a/xmloff/source/style/XMLFootnoteSeparatorExport.cxx b/xmloff/source/style/XMLFootnoteSeparatorExport.cxx index a7f5e0c1bf3a..f8200a89cf94 100644 --- a/xmloff/source/style/XMLFootnoteSeparatorExport.cxx +++ b/xmloff/source/style/XMLFootnoteSeparatorExport.cxx @@ -28,8 +28,13 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" + #include "XMLFootnoteSeparatorExport.hxx" + #include <tools/debug.hxx> + +#include <sax/tools/converter.hxx> + #include <xmloff/xmlexp.hxx> #include "xmloff/xmlnmspe.hxx" #include <xmloff/xmluconv.hxx> @@ -172,12 +177,12 @@ void XMLFootnoteSeparatorExport::exportXML( } // relative line width - SvXMLUnitConverter::convertPercent(sBuf, nLineRelWidth); + ::sax::Converter::convertPercent(sBuf, nLineRelWidth); rExport.AddAttribute(XML_NAMESPACE_STYLE, XML_REL_WIDTH, sBuf.makeStringAndClear()); // color - rExport.GetMM100UnitConverter().convertColor(sBuf, nLineColor); + ::sax::Converter::convertColor(sBuf, nLineColor); rExport.AddAttribute(XML_NAMESPACE_STYLE, XML_COLOR, sBuf.makeStringAndClear()); diff --git a/xmloff/source/style/XMLFootnoteSeparatorImport.cxx b/xmloff/source/style/XMLFootnoteSeparatorImport.cxx index 4c579c78bed5..a9f2d6d43d37 100644 --- a/xmloff/source/style/XMLFootnoteSeparatorImport.cxx +++ b/xmloff/source/style/XMLFootnoteSeparatorImport.cxx @@ -28,14 +28,19 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" + #include "XMLFootnoteSeparatorImport.hxx" -#ifndef _RTL_USTRING #include <rtl/ustring.hxx> -#endif + #include <com/sun/star/uno/Reference.h> #include <com/sun/star/xml/sax/XAttributeList.hpp> #include <com/sun/star/text/HorizontalAdjust.hpp> + +#include <tools/debug.hxx> + +#include <sax/tools/converter.hxx> + #include <xmloff/xmlimp.hxx> #include <xmloff/xmltoken.hxx> #include <xmloff/xmluconv.hxx> @@ -45,8 +50,6 @@ #include <xmloff/maptype.hxx> #include <xmloff/PageMasterStyleMap.hxx> -#include <tools/debug.hxx> -#include <tools/color.hxx> #include <vector> @@ -144,14 +147,15 @@ void XMLFootnoteSeparatorImport::StartElement( } else if (IsXMLToken( sLocalName, XML_REL_WIDTH )) { - if (SvXMLUnitConverter::convertPercent(nTmp, sAttrValue)) + if (::sax::Converter::convertPercent(nTmp, sAttrValue)) nLineRelWidth = (sal_uInt8)nTmp; } else if (IsXMLToken( sLocalName, XML_COLOR )) { - Color aColor; - if (SvXMLUnitConverter::convertColor(aColor, sAttrValue)) - nLineColor = (sal_Int32)aColor.GetColor(); + if (::sax::Converter::convertColor(nTmp, sAttrValue)) + { + nLineColor = nTmp; + } } else if (IsXMLToken( sLocalName, XML_LINE_STYLE )) { diff --git a/xmloff/source/style/XMLPercentOrMeasurePropertyHandler.cxx b/xmloff/source/style/XMLPercentOrMeasurePropertyHandler.cxx index b3f147cbbdcb..85f5691b44f1 100644 --- a/xmloff/source/style/XMLPercentOrMeasurePropertyHandler.cxx +++ b/xmloff/source/style/XMLPercentOrMeasurePropertyHandler.cxx @@ -28,10 +28,17 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" -#include <tools/debug.hxx> -#include <com/sun/star/uno/Any.hxx> -#include <rtl/ustrbuf.hxx> + #include "XMLPercentOrMeasurePropertyHandler.hxx" + +#include <rtl/ustrbuf.hxx> + +#include <com/sun/star/uno/Any.hxx> + +#include <tools/debug.hxx> + +#include <sax/tools/converter.hxx> + #include <xmloff/xmluconv.hxx> using namespace ::com::sun::star; @@ -61,7 +68,7 @@ sal_Bool XMLPercentOrMeasurePropertyHandler::importXML( if( mbPercent ) { - if( !rUnitConverter.convertPercent( nValue, rStrImpValue ) ) + if (!::sax::Converter::convertPercent( nValue, rStrImpValue )) return sal_False; } else @@ -87,7 +94,7 @@ sal_Bool XMLPercentOrMeasurePropertyHandler::exportXML( if( mbPercent ) { - rUnitConverter.convertPercent( aOut, nValue ); + ::sax::Converter::convertPercent( aOut, nValue ); } else { diff --git a/xmloff/source/style/backhdl.cxx b/xmloff/source/style/backhdl.cxx index e6743dd9609e..4115114713ea 100644 --- a/xmloff/source/style/backhdl.cxx +++ b/xmloff/source/style/backhdl.cxx @@ -32,6 +32,7 @@ #include <backhdl.hxx> #include <xmloff/xmltoken.hxx> #include <xmloff/xmluconv.hxx> +#include <sax/tools/converter.hxx> #include <com/sun/star/uno/Any.hxx> #include <rtl/ustrbuf.hxx> @@ -83,7 +84,7 @@ sal_Bool XMLBackGraphicPositionPropHdl::importXML( const OUString& rStrImpValue, else if( -1 != aToken.indexOf( sal_Unicode('%') ) ) { sal_Int32 nPrc = 50; - if( SvXMLUnitConverter::convertPercent( nPrc, aToken ) ) + if (::sax::Converter::convertPercent( nPrc, aToken )) { if( !bHori ) { diff --git a/xmloff/source/style/bordrhdl.cxx b/xmloff/source/style/bordrhdl.cxx index 9181827e31c9..bc9423621d90 100644 --- a/xmloff/source/style/bordrhdl.cxx +++ b/xmloff/source/style/bordrhdl.cxx @@ -29,8 +29,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" - #include <bordrhdl.hxx> +#include <sax/tools/converter.hxx> #include <xmloff/xmltoken.hxx> #include <xmloff/xmluconv.hxx> #include <rtl/ustrbuf.hxx> @@ -219,7 +219,7 @@ sal_Bool XMLBorderHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue sal_uInt16 nStyle = USHRT_MAX; sal_uInt16 nWidth = 0; sal_uInt16 nNamedWidth = USHRT_MAX; - Color aColor; + sal_Int32 nColor; sal_Int32 nTemp; while( aTokens.getNextToken( aToken ) && aToken.getLength() != 0 ) @@ -236,7 +236,7 @@ sal_Bool XMLBorderHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue { bHasStyle = sal_True; } - else if( !bHasColor && rUnitConverter.convertColor( aColor, aToken ) ) + else if (!bHasColor && ::sax::Converter::convertColor(nColor, aToken)) { bHasColor = sal_True; } @@ -298,7 +298,9 @@ sal_Bool XMLBorderHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue // set color if( bHasColor ) - aBorderLine.Color = (sal_Int32)aColor.GetRGBColor(); + { + aBorderLine.Color = nColor; + } rValue <<= aBorderLine; return sal_True; @@ -363,7 +365,7 @@ sal_Bool XMLBorderHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue aOut.append( sal_Unicode( ' ' ) ); - SvXMLUnitConverter::convertColor( aOut, aBorderLine.Color ); + ::sax::Converter::convertColor( aOut, aBorderLine.Color ); } rStrExpValue = aOut.makeStringAndClear(); diff --git a/xmloff/source/style/chrhghdl.cxx b/xmloff/source/style/chrhghdl.cxx index 7581029c3bb2..67c025951956 100644 --- a/xmloff/source/style/chrhghdl.cxx +++ b/xmloff/source/style/chrhghdl.cxx @@ -29,13 +29,17 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" - #include <chrhghdl.hxx> -#include <xmloff/xmluconv.hxx> -#include "xmlehelp.hxx" + #include <rtl/ustrbuf.hxx> + #include <com/sun/star/uno/Any.hxx> +#include <sax/tools/converter.hxx> + +#include <xmloff/xmluconv.hxx> +#include "xmlehelp.hxx" + using ::rtl::OUString; using ::rtl::OUStringBuffer; @@ -61,8 +65,10 @@ sal_Bool XMLCharHeightHdl::importXML( const OUString& rStrImpValue, uno::Any& rV if( rStrImpValue.indexOf( sal_Unicode('%') ) == -1 ) { double fSize; - MapUnit eSrcUnit = SvXMLExportHelper::GetUnitFromString( rStrImpValue, MAP_POINT ); - if( SvXMLUnitConverter::convertDouble( fSize, rStrImpValue, eSrcUnit, MAP_POINT )) + sal_Int16 const eSrcUnit = ::sax::Converter::GetUnitFromString( + rStrImpValue, util::MeasureUnit::POINT ); + if (::sax::Converter::convertDouble(fSize, rStrImpValue, + eSrcUnit, util::MeasureUnit::POINT)) { rValue <<= (float)fSize; return sal_True; @@ -79,7 +85,8 @@ sal_Bool XMLCharHeightHdl::exportXML( OUString& rStrExpValue, const uno::Any& rV float fSize = 0; if( rValue >>= fSize ) { - SvXMLUnitConverter::convertDouble( aOut, (double)fSize, sal_True, MAP_POINT, MAP_POINT ); + ::sax::Converter::convertDouble(aOut, (double)fSize, true, + util::MeasureUnit::POINT, util::MeasureUnit::POINT); aOut.append( sal_Unicode('p')); aOut.append( sal_Unicode('t')); } @@ -103,7 +110,7 @@ sal_Bool XMLCharHeightPropHdl::importXML( const OUString& rStrImpValue, uno::Any if( rStrImpValue.indexOf( sal_Unicode('%') ) != -1 ) { sal_Int32 nPrc = 100; - if( SvXMLUnitConverter::convertPercent( nPrc, rStrImpValue ) ) + if (::sax::Converter::convertPercent( nPrc, rStrImpValue )) { rValue <<= (sal_Int16)nPrc; return sal_True; @@ -120,7 +127,7 @@ sal_Bool XMLCharHeightPropHdl::exportXML( OUString& rStrExpValue, const uno::Any sal_Int16 nValue = sal_Int16(); if( rValue >>= nValue ) { - SvXMLUnitConverter::convertPercent( aOut, nValue ); + ::sax::Converter::convertPercent( aOut, nValue ); } rStrExpValue = aOut.makeStringAndClear(); diff --git a/xmloff/source/style/escphdl.cxx b/xmloff/source/style/escphdl.cxx index f0bbd43f793b..0743d8e268e3 100644 --- a/xmloff/source/style/escphdl.cxx +++ b/xmloff/source/style/escphdl.cxx @@ -29,8 +29,9 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" - #include <escphdl.hxx> + +#include <sax/tools/converter.hxx> #include <xmloff/xmltoken.hxx> #include <xmloff/xmluconv.hxx> #include <rtl/ustrbuf.hxx> @@ -78,7 +79,7 @@ sal_Bool XMLEscapementPropHdl::importXML( const OUString& rStrImpValue, uno::Any else { sal_Int32 nNewEsc; - if( !SvXMLUnitConverter::convertPercent( nNewEsc, aToken ) ) + if (!::sax::Converter::convertPercent( nNewEsc, aToken )) return sal_False; nVal = (sal_Int16) nNewEsc; @@ -105,7 +106,7 @@ sal_Bool XMLEscapementPropHdl::exportXML( OUString& rStrExpValue, const uno::Any } else { - SvXMLUnitConverter::convertPercent( aOut, nValue ); + ::sax::Converter::convertPercent( aOut, nValue ); } } @@ -138,15 +139,18 @@ sal_Bool XMLEscapementHeightPropHdl::importXML( const OUString& rStrImpValue, un if( aTokens.getNextToken( aToken ) ) { sal_Int32 nNewProp; - if( !SvXMLUnitConverter::convertPercent( nNewProp, aToken ) ) + if (!::sax::Converter::convertPercent( nNewProp, aToken )) return sal_False; nProp = (sal_Int8)nNewProp; } else { sal_Int32 nEscapementPosition=0; - if( SvXMLUnitConverter::convertPercent( nEscapementPosition, aToken ) && nEscapementPosition==0 ) + if (::sax::Converter::convertPercent( nEscapementPosition, aToken ) + && (nEscapementPosition == 0)) + { nProp = 100; //if escapement position is zero and no escapement height is given the default height should be 100percent and not something smaller (#i91800#) + } else nProp = (sal_Int8) DFLT_ESC_PROP; } @@ -165,7 +169,7 @@ sal_Bool XMLEscapementHeightPropHdl::exportXML( OUString& rStrExpValue, const un if( rStrExpValue.getLength() ) aOut.append( sal_Unicode(' ')); - SvXMLUnitConverter::convertPercent( aOut, nValue ); + ::sax::Converter::convertPercent( aOut, nValue ); } rStrExpValue = aOut.makeStringAndClear(); diff --git a/xmloff/source/style/fonthdl.cxx b/xmloff/source/style/fonthdl.cxx index 03f0ccfb69ee..e68ca8e633c9 100644 --- a/xmloff/source/style/fonthdl.cxx +++ b/xmloff/source/style/fonthdl.cxx @@ -30,6 +30,9 @@ #include "precompiled_xmloff.hxx" #include <fonthdl.hxx> + +#include <sax/tools/converter.hxx> + #include <xmloff/xmltoken.hxx> #include <xmloff/xmluconv.hxx> #include <rtl/ustrbuf.hxx> @@ -85,7 +88,7 @@ sal_Bool XMLFontFamilyNamePropHdl::importXML( const OUString& rStrImpValue, uno: do { sal_Int32 nFirst = nPos; - nPos = SvXMLUnitConverter::indexOfComma( rStrImpValue, nPos ); + nPos = ::sax::Converter::indexOfComma( rStrImpValue, nPos ); sal_Int32 nLast = (-1 == nPos ? rStrImpValue.getLength() : nPos); if( nLast > 0 ) nLast--; diff --git a/xmloff/source/style/lspachdl.cxx b/xmloff/source/style/lspachdl.cxx index 27fa7582cf46..7a2e86a70f4e 100644 --- a/xmloff/source/style/lspachdl.cxx +++ b/xmloff/source/style/lspachdl.cxx @@ -33,6 +33,7 @@ #include <lspachdl.hxx> #include <xmloff/xmltoken.hxx> #include <xmloff/xmluconv.hxx> +#include <sax/tools/converter.hxx> #include <rtl/ustrbuf.hxx> #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/style/LineSpacing.hpp> @@ -68,7 +69,7 @@ sal_Bool XMLLineHeightHdl::importXML( const OUString& rStrImpValue, uno::Any& rV if( -1 != rStrImpValue.indexOf( sal_Unicode( '%' ) ) ) { aLSp.Mode = style::LineSpacingMode::PROP; - if(!rUnitConverter.convertPercent( nTemp, rStrImpValue )) + if (!::sax::Converter::convertPercent( nTemp, rStrImpValue )) return sal_False; aLSp.Height = sal::static_int_cast< sal_Int16 >(nTemp); } @@ -102,7 +103,7 @@ sal_Bool XMLLineHeightHdl::exportXML( OUString& rStrExpValue, const uno::Any& rV if( style::LineSpacingMode::PROP == aLSp.Mode ) { - rUnitConverter.convertPercent( aOut, aLSp.Height ); + ::sax::Converter::convertPercent( aOut, aLSp.Height ); } else { diff --git a/xmloff/source/style/shadwhdl.cxx b/xmloff/source/style/shadwhdl.cxx index 03fcb8a4eaf9..43a3bc1a3c89 100644 --- a/xmloff/source/style/shadwhdl.cxx +++ b/xmloff/source/style/shadwhdl.cxx @@ -34,6 +34,8 @@ // -- #include <com/sun/star/table/ShadowFormat.hpp> +#include <tools/color.hxx> +#include <sax/tools/converter.hxx> #include <xmloff/xmluconv.hxx> #include <xmloff/xmltoken.hxx> @@ -75,10 +77,12 @@ sal_Bool XMLShadowPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rV } else if( !bColorFound && aToken.compareToAscii( "#", 1 ) == 0 ) { - bRet = rUnitConverter.convertColor( aColor, aToken ); + sal_Int32 nColor(0); + bRet = ::sax::Converter::convertColor( nColor, aToken ); if( !bRet ) return sal_False; + aColor.SetColor(nColor); bColorFound = sal_True; } else if( !bOffsetFound ) @@ -160,7 +164,7 @@ sal_Bool XMLShadowPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rV nX *= aShadow.ShadowWidth; nY *= aShadow.ShadowWidth; - rUnitConverter.convertColor( aOut, aShadow.Color ); + ::sax::Converter::convertColor( aOut, aShadow.Color ); aOut.append( sal_Unicode(' ') ); rUnitConverter.convertMeasure( aOut, nX ); diff --git a/xmloff/source/style/weighhdl.cxx b/xmloff/source/style/weighhdl.cxx index 9955d446e66f..90b82ce2414c 100644 --- a/xmloff/source/style/weighhdl.cxx +++ b/xmloff/source/style/weighhdl.cxx @@ -28,9 +28,12 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" + #include <weighhdl.hxx> + +#include <sax/tools/converter.hxx> + #include <xmloff/xmltoken.hxx> -#include <xmloff/xmluconv.hxx> #include <tools/fontenum.hxx> #include <tools/solar.h> @@ -99,7 +102,7 @@ sal_Bool XMLFontWeightPropHdl::importXML( const OUString& rStrImpValue, Any& rVa else { sal_Int32 nTemp; - bRet = SvXMLUnitConverter::convertNumber( nTemp, rStrImpValue, 100, 900 ); + bRet = ::sax::Converter::convertNumber(nTemp, rStrImpValue, 100, 900); if( bRet ) nWeight = sal::static_int_cast< sal_uInt16 >(nTemp); } @@ -166,7 +169,7 @@ sal_Bool XMLFontWeightPropHdl::exportXML( OUString& rStrExpValue, const Any& rVa else if( 700 == nWeight ) aOut.append( GetXMLToken(XML_WEIGHT_BOLD) ); else - SvXMLUnitConverter::convertNumber( aOut, (sal_Int32)nWeight ); + ::sax::Converter::convertNumber( aOut, (sal_Int32)nWeight ); rStrExpValue = aOut.makeStringAndClear(); } diff --git a/xmloff/source/style/xmlbahdl.cxx b/xmloff/source/style/xmlbahdl.cxx index af4fcaba8f3c..4602e53e8584 100644 --- a/xmloff/source/style/xmlbahdl.cxx +++ b/xmloff/source/style/xmlbahdl.cxx @@ -28,8 +28,11 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" -#include <tools/debug.hxx> + #include <xmlbahdl.hxx> + +#include <tools/debug.hxx> +#include <sax/tools/converter.hxx> #include <xmloff/xmluconv.hxx> #include <com/sun/star/uno/Any.hxx> #include <xmloff/xmltoken.hxx> @@ -105,10 +108,8 @@ XMLNumberPropHdl::~XMLNumberPropHdl() sal_Bool XMLNumberPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& ) const { - sal_Bool bRet = sal_False; - sal_Int32 nValue = 0; - bRet = SvXMLUnitConverter::convertNumber( nValue, rStrImpValue ); + bool bRet = ::sax::Converter::convertNumber( nValue, rStrImpValue ); lcl_xmloff_setAny( rValue, nValue, nBytes ); return bRet; @@ -122,7 +123,7 @@ sal_Bool XMLNumberPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, if( lcl_xmloff_getAny( rValue, nValue, nBytes ) ) { - SvXMLUnitConverter::convertNumber( aOut, nValue ); + ::sax::Converter::convertNumber( aOut, nValue ); rStrExpValue = aOut.makeStringAndClear(); bRet = sal_True; @@ -163,7 +164,7 @@ sal_Bool XMLNumberNonePropHdl::importXML( const OUString& rStrImpValue, Any& rVa } else { - bRet = SvXMLUnitConverter::convertNumber( nValue, rStrImpValue ); + bRet = ::sax::Converter::convertNumber( nValue, rStrImpValue ); } lcl_xmloff_setAny( rValue, nValue, nBytes ); @@ -185,7 +186,7 @@ sal_Bool XMLNumberNonePropHdl::exportXML( OUString& rStrExpValue, const Any& rVa } else { - SvXMLUnitConverter::convertNumber( aOut, nValue ); + ::sax::Converter::convertNumber( aOut, nValue ); } rStrExpValue = aOut.makeStringAndClear(); @@ -246,10 +247,8 @@ XMLBoolPropHdl::~XMLBoolPropHdl() sal_Bool XMLBoolPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& ) const { - sal_Bool bRet = sal_False; - - bool bValue; - bRet = SvXMLUnitConverter::convertBool( bValue, rStrImpValue ); + bool bValue(false); + bool const bRet = ::sax::Converter::convertBool( bValue, rStrImpValue ); rValue <<= sal_Bool(bValue); return bRet; @@ -263,7 +262,7 @@ sal_Bool XMLBoolPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, c if (rValue >>= bValue) { - SvXMLUnitConverter::convertBool( aOut, bValue ); + ::sax::Converter::convertBool( aOut, bValue ); rStrExpValue = aOut.makeStringAndClear(); bRet = sal_True; @@ -284,10 +283,8 @@ XMLNBoolPropHdl::~XMLNBoolPropHdl() sal_Bool XMLNBoolPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& ) const { - sal_Bool bRet = sal_False; - - bool bValue; - bRet = SvXMLUnitConverter::convertBool( bValue, rStrImpValue ); + bool bValue(false); + bool const bRet = ::sax::Converter::convertBool( bValue, rStrImpValue ); rValue <<= sal_Bool(!bValue); return bRet; @@ -301,7 +298,7 @@ sal_Bool XMLNBoolPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, if (rValue >>= bValue) { - SvXMLUnitConverter::convertBool( aOut, !bValue ); + ::sax::Converter::convertBool( aOut, !bValue ); rStrExpValue = aOut.makeStringAndClear(); bRet = sal_True; @@ -322,10 +319,8 @@ XMLPercentPropHdl::~XMLPercentPropHdl() sal_Bool XMLPercentPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& ) const { - sal_Bool bRet = sal_False; - sal_Int32 nValue = 0; - bRet = SvXMLUnitConverter::convertPercent( nValue, rStrImpValue ); + bool const bRet = ::sax::Converter::convertPercent( nValue, rStrImpValue ); lcl_xmloff_setAny( rValue, nValue, nBytes ); return bRet; @@ -339,7 +334,7 @@ sal_Bool XMLPercentPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue if( lcl_xmloff_getAny( rValue, nValue, nBytes ) ) { - SvXMLUnitConverter::convertPercent( aOut, nValue ); + ::sax::Converter::convertPercent( aOut, nValue ); rStrExpValue = aOut.makeStringAndClear(); bRet = sal_True; @@ -366,7 +361,7 @@ sal_Bool XMLDoublePercentPropHdl::importXML( const OUString& rStrImpValue, Any& else { sal_Int32 nValue = 0; - bRet = SvXMLUnitConverter::convertPercent( nValue, rStrImpValue ); + bRet = ::sax::Converter::convertPercent( nValue, rStrImpValue ); fValue = ((double)nValue) / 100.0; } rValue <<= fValue; @@ -387,7 +382,7 @@ sal_Bool XMLDoublePercentPropHdl::exportXML( OUString& rStrExpValue, const Any& sal_Int32 nValue = (sal_Int32)fValue; OUStringBuffer aOut; - SvXMLUnitConverter::convertPercent( aOut, nValue ); + ::sax::Converter::convertPercent( aOut, nValue ); rStrExpValue = aOut.makeStringAndClear(); bRet = sal_True; @@ -409,10 +404,8 @@ XMLNegPercentPropHdl::~XMLNegPercentPropHdl() sal_Bool XMLNegPercentPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& ) const { - sal_Bool bRet = sal_False; - sal_Int32 nValue = 0; - bRet = SvXMLUnitConverter::convertPercent( nValue, rStrImpValue ); + bool const bRet = ::sax::Converter::convertPercent( nValue, rStrImpValue ); lcl_xmloff_setAny( rValue, 100-nValue, nBytes ); return bRet; @@ -426,7 +419,7 @@ sal_Bool XMLNegPercentPropHdl::exportXML( OUString& rStrExpValue, const Any& rVa if( lcl_xmloff_getAny( rValue, nValue, nBytes ) ) { - SvXMLUnitConverter::convertPercent( aOut, 100-nValue ); + ::sax::Converter::convertPercent( aOut, 100-nValue ); rStrExpValue = aOut.makeStringAndClear(); bRet = sal_True; @@ -487,7 +480,6 @@ XMLColorPropHdl::~XMLColorPropHdl() sal_Bool XMLColorPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& ) const { sal_Bool bRet = sal_False; - Color aColor; const OUString astrHSL( RTL_CONSTASCII_USTRINGPARAM( "hsl" ) ); if( rStrImpValue.matchIgnoreAsciiCase( astrHSL ) ) @@ -511,8 +503,9 @@ sal_Bool XMLColorPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, } else { - bRet = SvXMLUnitConverter::convertColor( aColor, rStrImpValue ); - rValue <<= (sal_Int32)( aColor.GetColor() ); + sal_Int32 nColor(0); + bRet = ::sax::Converter::convertColor( nColor, rStrImpValue ); + rValue <<= nColor; } return bRet; @@ -521,15 +514,12 @@ sal_Bool XMLColorPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, sal_Bool XMLColorPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, const SvXMLUnitConverter& ) const { sal_Bool bRet = sal_False; - Color aColor; sal_Int32 nColor = 0; OUStringBuffer aOut; if( rValue >>= nColor ) { - aColor.SetColor( nColor ); - - SvXMLUnitConverter::convertColor( aOut, aColor ); + ::sax::Converter::convertColor( aOut, nColor ); rStrExpValue = aOut.makeStringAndClear(); bRet = sal_True; @@ -621,8 +611,8 @@ XMLDoublePropHdl::~XMLDoublePropHdl() sal_Bool XMLDoublePropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& ) const { - double fDblValue; - sal_Bool bRet = SvXMLUnitConverter::convertDouble( fDblValue, rStrImpValue ); + double fDblValue(0.0); + bool const bRet = ::sax::Converter::convertDouble(fDblValue, rStrImpValue); rValue <<= fDblValue; return bRet; } @@ -636,7 +626,7 @@ sal_Bool XMLDoublePropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, if( rValue >>= fValue ) { OUStringBuffer aOut; - SvXMLUnitConverter::convertDouble( aOut, fValue ); + ::sax::Converter::convertDouble( aOut, fValue ); rStrExpValue = aOut.makeStringAndClear(); bRet = sal_True; } @@ -668,9 +658,9 @@ sal_Bool XMLColorTransparentPropHdl::importXML( const OUString& rStrImpValue, An if( rStrImpValue != sTransparent ) { - Color aColor; - bRet = SvXMLUnitConverter::convertColor( aColor, rStrImpValue ); - rValue <<= (sal_Int32)( aColor.GetColor() ); + sal_Int32 nColor(0); + bRet = ::sax::Converter::convertColor( nColor, rStrImpValue ); + rValue <<= nColor; } return bRet; @@ -685,9 +675,8 @@ sal_Bool XMLColorTransparentPropHdl::exportXML( OUString& rStrExpValue, const An bRet = sal_False; else if( rValue >>= nColor ) { - Color aColor( nColor ); OUStringBuffer aOut; - SvXMLUnitConverter::convertColor( aOut, aColor ); + ::sax::Converter::convertColor( aOut, nColor ); rStrExpValue = aOut.makeStringAndClear(); bRet = sal_True; @@ -766,10 +755,9 @@ sal_Bool XMLColorAutoPropHdl::importXML( const OUString& rStrImpValue, Any& rVal sal_Int32 nColor = 0; if( !(rValue >>= nColor) || -1 != nColor ) { - Color aColor; - bRet = SvXMLUnitConverter::convertColor( aColor, rStrImpValue ); + bRet = ::sax::Converter::convertColor( nColor, rStrImpValue ); if( bRet ) - rValue <<= (sal_Int32)( aColor.GetColor() ); + rValue <<= nColor; } return bRet; @@ -782,9 +770,8 @@ sal_Bool XMLColorAutoPropHdl::exportXML( OUString& rStrExpValue, const Any& rVal sal_Int32 nColor = 0; if( (rValue >>= nColor) && -1 != nColor ) { - Color aColor( nColor ); OUStringBuffer aOut; - SvXMLUnitConverter::convertColor( aOut, aColor ); + ::sax::Converter::convertColor( aOut, nColor ); rStrExpValue = aOut.makeStringAndClear(); bRet = sal_True; @@ -809,10 +796,9 @@ XMLIsAutoColorPropHdl::~XMLIsAutoColorPropHdl() sal_Bool XMLIsAutoColorPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& ) const { - bool bValue; - // An auto color overrides any other color set! - sal_Bool bRet = SvXMLUnitConverter::convertBool( bValue, rStrImpValue ); + bool bValue; + bool const bRet = ::sax::Converter::convertBool( bValue, rStrImpValue ); if( bRet && bValue ) rValue <<= (sal_Int32)-1; @@ -827,7 +813,7 @@ sal_Bool XMLIsAutoColorPropHdl::exportXML( OUString& rStrExpValue, const Any& rV if( (rValue >>= nColor) && -1 == nColor ) { OUStringBuffer aOut; - SvXMLUnitConverter::convertBool( aOut, sal_True ); + ::sax::Converter::convertBool( aOut, true ); rStrExpValue = aOut.makeStringAndClear(); bRet = sal_True; @@ -877,7 +863,7 @@ sal_Bool XMLNumberWithoutZeroPropHdl::importXML( const SvXMLUnitConverter& ) const { sal_Int32 nValue = 0; - sal_Bool bRet = SvXMLUnitConverter::convertNumber( nValue, rStrImpValue ); + bool const bRet = ::sax::Converter::convertNumber( nValue, rStrImpValue ); if( bRet ) lcl_xmloff_setAny( rValue, nValue, nBytes ); return bRet; @@ -893,7 +879,7 @@ sal_Bool XMLNumberWithoutZeroPropHdl::exportXML( OUString& rStrExpValue, const A if( bRet ) { OUStringBuffer aBuffer; - SvXMLUnitConverter::convertNumber( aBuffer, nValue ); + ::sax::Converter::convertNumber( aBuffer, nValue ); rStrExpValue = aBuffer.makeStringAndClear(); } @@ -914,7 +900,7 @@ sal_Bool XMLNumberWithAutoInsteadZeroPropHdl::importXML( const SvXMLUnitConverter& ) const { sal_Int32 nValue = 0; - sal_Bool bRet = SvXMLUnitConverter::convertNumber( nValue, rStrImpValue ); + bool bRet = ::sax::Converter::convertNumber( nValue, rStrImpValue ); if( bRet ) lcl_xmloff_setAny( rValue, nValue, 2 ); else if( rStrImpValue == GetXMLToken( XML_AUTO ) ) @@ -936,7 +922,7 @@ sal_Bool XMLNumberWithAutoInsteadZeroPropHdl::exportXML( OUString& rStrExpValue, else { OUStringBuffer aBuffer; - SvXMLUnitConverter::convertNumber( aBuffer, nValue ); + ::sax::Converter::convertNumber( aBuffer, nValue ); rStrExpValue = aBuffer.makeStringAndClear(); } diff --git a/xmloff/source/style/xmlnume.cxx b/xmloff/source/style/xmlnume.cxx index 6ff60f002d39..115c813712fd 100644 --- a/xmloff/source/style/xmlnume.cxx +++ b/xmloff/source/style/xmlnume.cxx @@ -48,6 +48,8 @@ #include <tools/debug.hxx> +#include <sax/tools/converter.hxx> + #include <xmloff/nmspmap.hxx> #include "xmloff/xmlnmspe.hxx" #include <xmloff/xmltoken.hxx> @@ -612,14 +614,13 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel, // fo:color = "#..." if( bHasColor ) { - const Color aColor( nColor ); - if( aColor.GetColor() == 0xffffffff ) + if (0xffffffff == static_cast<sal_uInt32>(nColor)) { GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_USE_WINDOW_FONT_COLOR, XML_TRUE ); } else { - SvXMLUnitConverter::convertColor( sBuffer, aColor ); + ::sax::Converter::convertColor( sBuffer, nColor ); GetExport().AddAttribute( XML_NAMESPACE_FO, XML_COLOR, sBuffer.makeStringAndClear() ); } @@ -627,7 +628,7 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel, // fo:height="...%" if( nBullRelSize ) { - GetExport().GetMM100UnitConverter().convertPercent( sTmp, nBullRelSize ); + ::sax::Converter::convertPercent( sTmp, nBullRelSize ); GetExport().AddAttribute( XML_NAMESPACE_FO, XML_FONT_SIZE, sTmp.makeStringAndClear() ); } diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx index f6998557ba2d..f17116c5cb60 100644 --- a/xmloff/source/style/xmlnumfe.cxx +++ b/xmloff/source/style/xmlnumfe.cxx @@ -43,12 +43,13 @@ #include <unotools/charclass.hxx> #include <com/sun/star/lang/Locale.hpp> #include <rtl/ustrbuf.hxx> +#include <tools/color.hxx> +#include <sax/tools/converter.hxx> #include <com/sun/star/i18n/NativeNumberXmlAttributes.hpp> #include <xmloff/xmlnumfe.hxx> #include "xmloff/xmlnmspe.hxx" -#include <xmloff/xmluconv.hxx> #include <xmloff/attrlist.hxx> #include <xmloff/nmspmap.hxx> #include <xmloff/families.hxx> @@ -400,7 +401,7 @@ void SvXMLNumFmtExport::WriteColorElement_Impl( const Color& rColor ) FinishTextElement_Impl(); OUStringBuffer aColStr( 7 ); - SvXMLUnitConverter::convertColor( aColStr, rColor ); + ::sax::Converter::convertColor( aColStr, rColor.GetColor() ); rExport.AddAttribute( XML_NAMESPACE_FO, XML_COLOR, aColStr.makeStringAndClear() ); @@ -612,7 +613,7 @@ void SvXMLNumFmtExport::WriteNumberElement_Impl( double fFactor = ::rtl::math::pow10Exp( 1.0, 3 * nTrailingThousands ); OUStringBuffer aFactStr; - SvXMLUnitConverter::convertDouble( aFactStr, fFactor ); + ::sax::Converter::convertDouble( aFactStr, fFactor ); rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_DISPLAY_FACTOR, aFactStr.makeStringAndClear() ); } diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index a09c88233066..d428e78fa0d7 100644 --- a/xmloff/source/style/xmlnumfi.cxx +++ b/xmloff/source/style/xmlnumfi.cxx @@ -41,6 +41,8 @@ #include <tools/debug.hxx> #include <rtl/ustrbuf.hxx> +#include <sax/tools/converter.hxx> + #include <xmloff/xmlnumfi.hxx> #include <xmloff/xmltkmap.hxx> #include "xmloff/xmlnmspe.hxx" @@ -221,7 +223,7 @@ public: class SvXMLNumFmtPropContext : public SvXMLImportContext { SvXMLNumFormatContext& rParent; - Color aColor; + sal_Int32 m_nColor; sal_Bool bColSet; public: @@ -688,7 +690,9 @@ SvXMLNumFmtPropContext::SvXMLNumFmtPropContext( SvXMLImport& rImport, OUString aLocalName; sal_uInt16 nPrefix = rImport.GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); if ( nPrefix == XML_NAMESPACE_FO && IsXMLToken( aLocalName, XML_COLOR ) ) - bColSet = SvXMLUnitConverter::convertColor( aColor, sValue ); + { + bColSet = ::sax::Converter::convertColor( m_nColor, sValue ); + } } } @@ -711,7 +715,7 @@ void SvXMLNumFmtPropContext::Characters( const rtl::OUString& ) void SvXMLNumFmtPropContext::EndElement() { if (bColSet) - rParent.AddColor( aColor ); + rParent.AddColor( m_nColor ); } //------------------------------------------------------------------------- @@ -739,7 +743,7 @@ SvXMLNumFmtEmbeddedTextContext::SvXMLNumFmtEmbeddedTextContext( SvXMLImport& rIm sal_uInt16 nPrefix = rImport.GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); if ( nPrefix == XML_NAMESPACE_NUMBER && IsXMLToken( aLocalName, XML_POSITION ) ) { - if ( SvXMLUnitConverter::convertNumber( nAttrVal, sValue, 0 ) ) + if (::sax::Converter::convertNumber( nAttrVal, sValue, 0 )) nTextPosition = nAttrVal; } } @@ -937,7 +941,7 @@ SvXMLNumFmtElementContext::SvXMLNumFmtElementContext( SvXMLImport& rImport, { OUString sLanguage, sCountry; sal_Int32 nAttrVal; - bool bAttrBool; + bool bAttrBool(false); sal_uInt16 nAttrEnum; double fAttrDouble; @@ -955,19 +959,19 @@ SvXMLNumFmtElementContext::SvXMLNumFmtElementContext( SvXMLImport& rImport, switch (nToken) { case XML_TOK_ELEM_ATTR_DECIMAL_PLACES: - if ( SvXMLUnitConverter::convertNumber( nAttrVal, sValue, 0 ) ) + if (::sax::Converter::convertNumber( nAttrVal, sValue, 0 )) aNumInfo.nDecimals = nAttrVal; break; case XML_TOK_ELEM_ATTR_MIN_INTEGER_DIGITS: - if ( SvXMLUnitConverter::convertNumber( nAttrVal, sValue, 0 ) ) + if (::sax::Converter::convertNumber( nAttrVal, sValue, 0 )) aNumInfo.nInteger = nAttrVal; break; case XML_TOK_ELEM_ATTR_GROUPING: - if ( SvXMLUnitConverter::convertBool( bAttrBool, sValue ) ) + if (::sax::Converter::convertBool( bAttrBool, sValue )) aNumInfo.bGrouping = bAttrBool; break; case XML_TOK_ELEM_ATTR_DISPLAY_FACTOR: - if ( SvXMLUnitConverter::convertDouble( fAttrDouble, sValue ) ) + if (::sax::Converter::convertDouble( fAttrDouble, sValue )) aNumInfo.fDisplayFactor = fAttrDouble; break; case XML_TOK_ELEM_ATTR_DECIMAL_REPLACEMENT: @@ -977,15 +981,15 @@ SvXMLNumFmtElementContext::SvXMLNumFmtElementContext( SvXMLImport& rImport, aNumInfo.bVarDecimals = sal_True; // empty replacement string: variable decimals break; case XML_TOK_ELEM_ATTR_MIN_EXPONENT_DIGITS: - if ( SvXMLUnitConverter::convertNumber( nAttrVal, sValue, 0 ) ) + if (::sax::Converter::convertNumber( nAttrVal, sValue, 0 )) aNumInfo.nExpDigits = nAttrVal; break; case XML_TOK_ELEM_ATTR_MIN_NUMERATOR_DIGITS: - if ( SvXMLUnitConverter::convertNumber( nAttrVal, sValue, 0 ) ) + if (::sax::Converter::convertNumber( nAttrVal, sValue, 0 )) aNumInfo.nNumerDigits = nAttrVal; break; case XML_TOK_ELEM_ATTR_MIN_DENOMINATOR_DIGITS: - if ( SvXMLUnitConverter::convertNumber( nAttrVal, sValue, 0 ) ) + if (::sax::Converter::convertNumber( nAttrVal, sValue, 0 )) aNumInfo.nDenomDigits = nAttrVal; break; case XML_TOK_ELEM_ATTR_LANGUAGE: @@ -999,7 +1003,7 @@ SvXMLNumFmtElementContext::SvXMLNumFmtElementContext( SvXMLImport& rImport, bLong = (sal_Bool) nAttrEnum; break; case XML_TOK_ELEM_ATTR_TEXTUAL: - if ( SvXMLUnitConverter::convertBool( bAttrBool, sValue ) ) + if (::sax::Converter::convertBool( bAttrBool, sValue )) bTextual = bAttrBool; break; case XML_TOK_ELEM_ATTR_CALENDAR: @@ -1296,7 +1300,7 @@ SvXMLNumFormatContext::SvXMLNumFormatContext( SvXMLImport& rImport, { OUString sLanguage, sCountry; ::com::sun::star::i18n::NativeNumberXmlAttributes aNatNumAttr; - bool bAttrBool; + bool bAttrBool(false); sal_uInt16 nAttrEnum; sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; @@ -1323,7 +1327,7 @@ SvXMLNumFormatContext::SvXMLNumFormatContext( SvXMLImport& rImport, sFormatTitle = sValue; break; case XML_TOK_STYLE_ATTR_AUTOMATIC_ORDER: - if ( SvXMLUnitConverter::convertBool( bAttrBool, sValue ) ) + if (::sax::Converter::convertBool( bAttrBool, sValue )) bAutoOrder = bAttrBool; break; case XML_TOK_STYLE_ATTR_FORMAT_SOURCE: @@ -1331,13 +1335,13 @@ SvXMLNumFormatContext::SvXMLNumFormatContext( SvXMLImport& rImport, bFromSystem = (sal_Bool) nAttrEnum; break; case XML_TOK_STYLE_ATTR_TRUNCATE_ON_OVERFLOW: - if ( SvXMLUnitConverter::convertBool( bAttrBool, sValue ) ) + if (::sax::Converter::convertBool( bAttrBool, sValue )) bTruncate = bAttrBool; break; case XML_TOK_STYLE_ATTR_VOLATILE: // volatile formats can be removed after importing // if not used in other styles - if ( SvXMLUnitConverter::convertBool( bAttrBool, sValue ) ) + if (::sax::Converter::convertBool( bAttrBool, sValue )) bRemoveAfterUse = bAttrBool; break; case XML_TOK_STYLE_ATTR_TRANSL_FORMAT: @@ -2117,7 +2121,7 @@ void SvXMLNumFormatContext::AddCondition( const rtl::OUString& rCondition, const aMyConditions.push_back(aCondition); } -void SvXMLNumFormatContext::AddColor( const Color& rColor ) +void SvXMLNumFormatContext::AddColor( sal_uInt32 const nColor ) { SvNumberFormatter* pFormatter = pData->GetNumberFormatter(); if (!pFormatter) @@ -2125,7 +2129,7 @@ void SvXMLNumFormatContext::AddColor( const Color& rColor ) OUStringBuffer aColName; for ( sal_uInt16 i=0; i<XML_NUMF_COLORCOUNT; i++ ) - if ( rColor == aNumFmtStdColors[i] ) + if (nColor == aNumFmtStdColors[i]) { aColName = OUString( pFormatter->GetKeyword( nFormatLang, sal::static_int_cast< sal_uInt16 >(NF_KEY_FIRSTCOLOR + i) ) ); break; diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx index eaa7e8cd76fd..70b522a44569 100644 --- a/xmloff/source/style/xmlnumi.cxx +++ b/xmloff/source/style/xmlnumi.cxx @@ -48,6 +48,8 @@ #include <tools/debug.hxx> #include <tools/fontenum.hxx> +#include <sax/tools/converter.hxx> + #include <xmloff/xmltkmap.hxx> #include <xmloff/nmspmap.hxx> #include "xmloff/xmlnmspe.hxx" @@ -232,7 +234,7 @@ class SvxXMLListLevelStyleContext_Impl : public SvXMLImportContext sal_Unicode cBullet; sal_Int16 nRelSize; - Color aColor; + sal_Int32 m_nColor; sal_Int16 ePosAndSpaceMode; sal_Int16 eLabelFollowedBy; @@ -246,7 +248,8 @@ class SvxXMLListLevelStyleContext_Impl : public SvXMLImportContext sal_Bool bHasColor : 1; void SetRelSize( sal_Int16 nRel ) { nRelSize = nRel; } - void SetColor( sal_Int32 _aColor ) { aColor = _aColor; bHasColor = sal_True; } + void SetColor( sal_Int32 nColor ) + { m_nColor = nColor; bHasColor = sal_True; } void SetSpaceBefore( sal_Int32 nSet ) { nSpaceBefore = nSet; } void SetMinLabelWidth( sal_Int32 nSet ) { nMinLabelWidth = nSet; } void SetMinLabelDist( sal_Int32 nSet ) { nMinLabelDist = nSet; } @@ -327,7 +330,7 @@ SvxXMLListLevelStyleContext_Impl::SvxXMLListLevelStyleContext_Impl( , eImageVertOrient(0) , cBullet( 0 ) , nRelSize(0) -, aColor( 0 ) +, m_nColor(0) , ePosAndSpaceMode( PositionAndSpaceMode::LABEL_WIDTH_AND_POSITION ) , eLabelFollowedBy( LabelFollow::LISTTAB ) , nListtabStopPosition( 0 ) @@ -658,7 +661,7 @@ Sequence<beans::PropertyValue> SvxXMLListLevelStyleContext_Impl::GetProperties( if( !bImage && bHasColor ) { pProps[nPos].Name = OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_BULLET_COLOR )); - pProps[nPos++].Value <<= (sal_Int32)aColor.GetColor(); + pProps[nPos++].Value <<= m_nColor; } DBG_ASSERT( nPos == nCount, "array under/overflow" ); @@ -820,9 +823,11 @@ SvxXMLListLevelStyleAttrContext_Impl::SvxXMLListLevelStyleAttrContext_Impl( break; case XML_TOK_STYLE_ATTRIBUTES_ATTR_COLOR: { - Color aColor; - if( SvXMLUnitConverter::convertColor( aColor, rValue ) ) - rListLevel.SetColor( (sal_Int32)aColor.GetColor() ); + sal_Int32 nColor(0); + if (::sax::Converter::convertColor( nColor, rValue )) + { + rListLevel.SetColor( nColor ); + } } break; case XML_TOK_STYLE_ATTRIBUTES_ATTR_WINDOW_FONT_COLOR: @@ -832,7 +837,7 @@ SvxXMLListLevelStyleAttrContext_Impl::SvxXMLListLevelStyleAttrContext_Impl( } break; case XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_SIZE: - if(SvXMLUnitConverter::convertPercent( nVal, rValue ) ) + if (::sax::Converter::convertPercent( nVal, rValue )) rListLevel.SetRelSize( (sal_Int16)nVal ); break; case XML_TOK_STYLE_ATTRIBUTES_ATTR_POSITION_AND_SPACE_MODE: diff --git a/xmloff/source/text/XMLCalculationSettingsContext.cxx b/xmloff/source/text/XMLCalculationSettingsContext.cxx index f1aae0bfafee..23000383949c 100644 --- a/xmloff/source/text/XMLCalculationSettingsContext.cxx +++ b/xmloff/source/text/XMLCalculationSettingsContext.cxx @@ -28,14 +28,18 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" + #include <XMLCalculationSettingsContext.hxx> + #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/text/XTextDocument.hpp> + +#include <sax/tools/converter.hxx> + #include <xmloff/xmlimp.hxx> #include <xmloff/nmspmap.hxx> #include "xmloff/xmlnmspe.hxx" #include <xmloff/xmltoken.hxx> -#include <xmloff/xmluconv.hxx> using ::rtl::OUString; @@ -68,7 +72,7 @@ XMLCalculationSettingsContext::XMLCalculationSettingsContext( SvXMLImport& rImpo if ( IsXMLToken( aLocalName, XML_NULL_YEAR ) ) { sal_Int32 nTemp; - GetImport().GetMM100UnitConverter().convertNumber(nTemp, sValue); + ::sax::Converter::convertNumber(nTemp, sValue); nYear= static_cast <sal_Int16> (nTemp); } } diff --git a/xmloff/source/text/XMLChangedRegionImportContext.cxx b/xmloff/source/text/XMLChangedRegionImportContext.cxx index ef7341bf81f4..64528971e731 100644 --- a/xmloff/source/text/XMLChangedRegionImportContext.cxx +++ b/xmloff/source/text/XMLChangedRegionImportContext.cxx @@ -33,6 +33,9 @@ #include <com/sun/star/uno/Reference.h> #include <com/sun/star/util/DateTime.hpp> #include <com/sun/star/text/XTextCursor.hpp> + +#include <sax/tools/converter.hxx> + #include <xmloff/xmlimp.hxx> #include "xmloff/xmlnmspe.hxx" #include <xmloff/nmspmap.hxx> @@ -95,8 +98,8 @@ void XMLChangedRegionImportContext::StartElement( } else if( IsXMLToken( sLocalName, XML_MERGE_LAST_PARAGRAPH ) ) { - bool bTmp; - if( SvXMLUnitConverter::convertBool(bTmp, sValue) ) + bool bTmp(false); + if (::sax::Converter::convertBool(bTmp, sValue)) { bMergeLastPara = bTmp; } diff --git a/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx b/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx index ae3bd1aa8290..a1987dc8f851 100644 --- a/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx +++ b/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx @@ -28,13 +28,16 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" + #include "XMLFootnoteConfigurationImportContext.hxx" -#ifndef _RTL_USTRING #include <rtl/ustring.hxx> -#endif #include <rtl/ustrbuf.hxx> + #include <tools/debug.hxx> + +#include <sax/tools/converter.hxx> + #include <xmloff/nmspmap.hxx> #include "xmloff/xmlnmspe.hxx" #include <xmloff/xmltoken.hxx> @@ -264,7 +267,7 @@ void XMLFootnoteConfigurationImportContext::StartElement( case XML_TOK_FTNCONFIG_OFFSET: { sal_Int32 nTmp; - if (SvXMLUnitConverter::convertNumber(nTmp, sValue)) + if (::sax::Converter::convertNumber(nTmp, sValue)) { nOffset = (sal_uInt16)nTmp; } diff --git a/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx b/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx index ec18fdc9e2eb..319398e12cab 100644 --- a/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx +++ b/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx @@ -29,10 +29,13 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" - #include "XMLIndexAlphabeticalSourceContext.hxx" + #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/container/XIndexReplace.hpp> + +#include <sax/tools/converter.hxx> + #include "XMLIndexTemplateContext.hxx" #include "XMLIndexTitleTemplateContext.hxx" #include "XMLIndexTOCStylesContext.hxx" @@ -109,7 +112,7 @@ void XMLIndexAlphabeticalSourceContext::ProcessAttribute( enum IndexSourceParamEnum eParam, const OUString& rValue) { - bool bTmp; + bool bTmp(false); switch (eParam) { @@ -125,55 +128,55 @@ void XMLIndexAlphabeticalSourceContext::ProcessAttribute( break; case XML_TOK_INDEXSOURCE_IGNORE_CASE: - if (SvXMLUnitConverter::convertBool(bTmp, rValue)) + if (::sax::Converter::convertBool(bTmp, rValue)) { bCaseSensitive = !bTmp; } break; case XML_TOK_INDEXSOURCE_SEPARATORS: - if (SvXMLUnitConverter::convertBool(bTmp, rValue)) + if (::sax::Converter::convertBool(bTmp, rValue)) { bSeparators = bTmp; } break; case XML_TOK_INDEXSOURCE_COMBINE_ENTRIES: - if (SvXMLUnitConverter::convertBool(bTmp, rValue)) + if (::sax::Converter::convertBool(bTmp, rValue)) { bCombineEntries = bTmp; } break; case XML_TOK_INDEXSOURCE_COMBINE_WITH_DASH: - if (SvXMLUnitConverter::convertBool(bTmp, rValue)) + if (::sax::Converter::convertBool(bTmp, rValue)) { bCombineDash = bTmp; } break; case XML_TOK_INDEXSOURCE_KEYS_AS_ENTRIES: - if (SvXMLUnitConverter::convertBool(bTmp, rValue)) + if (::sax::Converter::convertBool(bTmp, rValue)) { bEntry = bTmp; } break; case XML_TOK_INDEXSOURCE_COMBINE_WITH_PP: - if (SvXMLUnitConverter::convertBool(bTmp, rValue)) + if (::sax::Converter::convertBool(bTmp, rValue)) { bCombinePP = bTmp; } break; case XML_TOK_INDEXSOURCE_CAPITALIZE: - if (SvXMLUnitConverter::convertBool(bTmp, rValue)) + if (::sax::Converter::convertBool(bTmp, rValue)) { bUpperCase = bTmp; } break; case XML_TOK_INDEXSOURCE_COMMA_SEPARATED: - if (SvXMLUnitConverter::convertBool(bTmp, rValue)) + if (::sax::Converter::convertBool(bTmp, rValue)) { bCommaSeparated = bTmp; } diff --git a/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx b/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx index 0f9f5edad3d0..c3b571c027b7 100644 --- a/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx +++ b/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx @@ -39,6 +39,7 @@ #include "xmloff/xmlnmspe.hxx" #include <xmloff/xmltoken.hxx> #include <xmloff/xmluconv.hxx> +#include <sax/tools/converter.hxx> #include <tools/debug.hxx> #include <rtl/ustring.hxx> #include <com/sun/star/beans/XPropertySet.hpp> @@ -124,16 +125,16 @@ void XMLIndexBibliographyConfigurationContext::ProcessAttribute( } else if( IsXMLToken(sLocalName, XML_NUMBERED_ENTRIES) ) { - bool bTmp; - if( SvXMLUnitConverter::convertBool(bTmp, sValue) ) + bool bTmp(false); + if (::sax::Converter::convertBool(bTmp, sValue)) { bNumberedEntries = bTmp; } } else if( IsXMLToken(sLocalName, XML_SORT_BY_POSITION) ) { - bool bTmp; - if (SvXMLUnitConverter::convertBool(bTmp, sValue)) + bool bTmp(false); + if (::sax::Converter::convertBool(bTmp, sValue)) { bSortByPosition = bTmp; } @@ -185,8 +186,8 @@ SvXMLImportContext *XMLIndexBibliographyConfigurationContext::CreateChildContext } else if ( IsXMLToken( sLocalName, XML_SORT_ASCENDING ) ) { - bool bTmp; - if (SvXMLUnitConverter::convertBool( + bool bTmp(false); + if (::sax::Converter::convertBool( bTmp, xAttrList->getValueByIndex(nAttr))) { bSort = bTmp; diff --git a/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx b/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx index 2462ca195a04..1aa206d5ccb0 100644 --- a/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx +++ b/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx @@ -29,8 +29,12 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" - #include "XMLIndexChapterInfoEntryContext.hxx" + +#include <com/sun/star/text/ChapterFormat.hpp> + +#include <sax/tools/converter.hxx> + #include "XMLIndexTemplateContext.hxx" #include <xmloff/xmlictxt.hxx> #include <xmloff/xmlimp.hxx> @@ -39,7 +43,6 @@ #include "xmloff/xmlnmspe.hxx" #include <xmloff/xmltoken.hxx> #include <xmloff/xmluconv.hxx> -#include <com/sun/star/text/ChapterFormat.hpp> using namespace ::com::sun::star::text; @@ -123,8 +126,8 @@ void XMLIndexChapterInfoEntryContext::StartElement( else if ( IsXMLToken( sLocalName, XML_OUTLINE_LEVEL ) ) { sal_Int32 nTmp; - - if (SvXMLUnitConverter::convertNumber(nTmp, xAttrList->getValueByIndex(nAttr))) + if (::sax::Converter::convertNumber(nTmp, + xAttrList->getValueByIndex(nAttr))) { //control on range is carried out in the UNO level nOutlineLevel = static_cast<sal_uInt16>(nTmp); diff --git a/xmloff/source/text/XMLIndexMarkExport.cxx b/xmloff/source/text/XMLIndexMarkExport.cxx index 55f925733429..0eaaca42ae62 100644 --- a/xmloff/source/text/XMLIndexMarkExport.cxx +++ b/xmloff/source/text/XMLIndexMarkExport.cxx @@ -34,10 +34,10 @@ #include <rtl/ustrbuf.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XPropertySetInfo.hpp> +#include <sax/tools/converter.hxx> #include <xmloff/xmltoken.hxx> #include "xmloff/xmlnmspe.hxx" #include <xmloff/xmlexp.hxx> -#include <xmloff/xmluconv.hxx> using namespace ::xmloff::token; @@ -189,7 +189,7 @@ void XMLIndexMarkExport::ExportTOCMarkAttributes( Any aAny = rPropSet->getPropertyValue(sLevel); aAny >>= nLevel; OUStringBuffer sBuf; - SvXMLUnitConverter::convertNumber(sBuf, (sal_Int32)nLevel + 1); + ::sax::Converter::convertNumber(sBuf, static_cast<sal_Int32>(nLevel + 1)); rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_OUTLINE_LEVEL, sBuf.makeStringAndClear()); } diff --git a/xmloff/source/text/XMLIndexObjectSourceContext.cxx b/xmloff/source/text/XMLIndexObjectSourceContext.cxx index 1bf18ec7cb0a..c3e59482982d 100644 --- a/xmloff/source/text/XMLIndexObjectSourceContext.cxx +++ b/xmloff/source/text/XMLIndexObjectSourceContext.cxx @@ -29,10 +29,17 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" - #include "XMLIndexObjectSourceContext.hxx" + +#include <rtl/ustring.hxx> + #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/container/XIndexReplace.hpp> + +#include <tools/debug.hxx> + +#include <sax/tools/converter.hxx> + #include "XMLIndexTemplateContext.hxx" #include "XMLIndexTitleTemplateContext.hxx" #include "XMLIndexTOCStylesContext.hxx" @@ -42,9 +49,6 @@ #include "xmloff/xmlnmspe.hxx" #include <xmloff/nmspmap.hxx> #include <xmloff/xmltoken.hxx> -#include <xmloff/xmluconv.hxx> -#include <tools/debug.hxx> -#include <rtl/ustring.hxx> using ::rtl::OUString; @@ -99,40 +103,40 @@ void XMLIndexObjectSourceContext::ProcessAttribute( enum IndexSourceParamEnum eParam, const OUString& rValue) { + bool bTmp(false); + switch (eParam) { - bool bTmp; - case XML_TOK_INDEXSOURCE_USE_OTHER_OBJECTS: - if (SvXMLUnitConverter::convertBool(bTmp, rValue)) + if (::sax::Converter::convertBool(bTmp, rValue)) { bUseOtherObjects = bTmp; } break; case XML_TOK_INDEXSOURCE_USE_SHEET: - if (SvXMLUnitConverter::convertBool(bTmp, rValue)) + if (::sax::Converter::convertBool(bTmp, rValue)) { bUseCalc = bTmp; } break; case XML_TOK_INDEXSOURCE_USE_CHART: - if (SvXMLUnitConverter::convertBool(bTmp, rValue)) + if (::sax::Converter::convertBool(bTmp, rValue)) { bUseChart = bTmp; } break; case XML_TOK_INDEXSOURCE_USE_DRAW: - if (SvXMLUnitConverter::convertBool(bTmp, rValue)) + if (::sax::Converter::convertBool(bTmp, rValue)) { bUseDraw = bTmp; } break; case XML_TOK_INDEXSOURCE_USE_MATH: - if (SvXMLUnitConverter::convertBool(bTmp, rValue)) + if (::sax::Converter::convertBool(bTmp, rValue)) { bUseMath = bTmp; } diff --git a/xmloff/source/text/XMLIndexSourceBaseContext.cxx b/xmloff/source/text/XMLIndexSourceBaseContext.cxx index 849ffa0b2b0e..dfa7f047d1d4 100644 --- a/xmloff/source/text/XMLIndexSourceBaseContext.cxx +++ b/xmloff/source/text/XMLIndexSourceBaseContext.cxx @@ -42,7 +42,7 @@ #include "xmloff/xmlnmspe.hxx" #include <xmloff/nmspmap.hxx> #include <xmloff/xmltoken.hxx> -#include <xmloff/xmluconv.hxx> +#include <sax/tools/converter.hxx> #include <tools/debug.hxx> #include <rtl/ustring.hxx> @@ -216,8 +216,8 @@ void XMLIndexSourceBaseContext::ProcessAttribute( case XML_TOK_INDEXSOURCE_RELATIVE_TABS: { - bool bTmp; - if (SvXMLUnitConverter::convertBool(bTmp, rValue)) + bool bTmp(false); + if (::sax::Converter::convertBool(bTmp, rValue)) { bRelativeTabs = bTmp; } diff --git a/xmloff/source/text/XMLIndexTOCContext.cxx b/xmloff/source/text/XMLIndexTOCContext.cxx index 4bc15ecebd86..39d24a0e8656 100644 --- a/xmloff/source/text/XMLIndexTOCContext.cxx +++ b/xmloff/source/text/XMLIndexTOCContext.cxx @@ -38,6 +38,7 @@ #include <com/sun/star/text/XTextSection.hpp> #include <com/sun/star/text/XRelativeTextContentInsert.hpp> #include <com/sun/star/beans/XPropertySet.hpp> +#include <sax/tools/converter.hxx> #include "XMLIndexTOCSourceContext.hxx" #include "XMLIndexObjectSourceContext.hxx" #include "XMLIndexAlphabeticalSourceContext.hxx" @@ -166,9 +167,9 @@ void XMLIndexTOCContext::StartElement( } else if ( IsXMLToken( sLocalName, XML_PROTECTED ) ) { - bool bTmp; - if ( SvXMLUnitConverter::convertBool( - bTmp, xAttrList->getValueByIndex(nAttr) ) ) + bool bTmp(false); + if (::sax::Converter::convertBool( + bTmp, xAttrList->getValueByIndex(nAttr))) { bProtected = bTmp; } diff --git a/xmloff/source/text/XMLIndexTOCSourceContext.cxx b/xmloff/source/text/XMLIndexTOCSourceContext.cxx index 46404a9cd6ca..1356696a579c 100644 --- a/xmloff/source/text/XMLIndexTOCSourceContext.cxx +++ b/xmloff/source/text/XMLIndexTOCSourceContext.cxx @@ -33,6 +33,7 @@ #include "XMLIndexTOCSourceContext.hxx" #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/container/XIndexReplace.hpp> +#include <sax/tools/converter.hxx> #include "XMLIndexTemplateContext.hxx" #include "XMLIndexTitleTemplateContext.hxx" #include "XMLIndexTOCStylesContext.hxx" @@ -42,7 +43,6 @@ #include "xmloff/xmlnmspe.hxx" #include <xmloff/nmspmap.hxx> #include <xmloff/xmltoken.hxx> -#include <xmloff/xmluconv.hxx> #include <tools/debug.hxx> #include <rtl/ustring.hxx> @@ -104,7 +104,7 @@ void XMLIndexTOCSourceContext::ProcessAttribute( else { sal_Int32 nTmp; - if (SvXMLUnitConverter::convertNumber( + if (::sax::Converter::convertNumber( nTmp, rValue, 1, GetImport().GetTextImport()-> GetChapterNumbering()->getCount())) { @@ -116,8 +116,8 @@ void XMLIndexTOCSourceContext::ProcessAttribute( case XML_TOK_INDEXSOURCE_USE_OUTLINE_LEVEL: { - bool bTmp; - if (SvXMLUnitConverter::convertBool(bTmp, rValue)) + bool bTmp(false); + if (::sax::Converter::convertBool(bTmp, rValue)) { bUseOutline = bTmp; } @@ -127,8 +127,8 @@ void XMLIndexTOCSourceContext::ProcessAttribute( case XML_TOK_INDEXSOURCE_USE_INDEX_MARKS: { - bool bTmp; - if (SvXMLUnitConverter::convertBool(bTmp, rValue)) + bool bTmp(false); + if (::sax::Converter::convertBool(bTmp, rValue)) { bUseMarks = bTmp; } @@ -137,8 +137,8 @@ void XMLIndexTOCSourceContext::ProcessAttribute( case XML_TOK_INDEXSOURCE_USE_INDEX_SOURCE_STYLES: { - bool bTmp; - if (SvXMLUnitConverter::convertBool(bTmp, rValue)) + bool bTmp(false); + if (::sax::Converter::convertBool(bTmp, rValue)) { bUseParagraphStyles = bTmp; } diff --git a/xmloff/source/text/XMLIndexTOCStylesContext.cxx b/xmloff/source/text/XMLIndexTOCStylesContext.cxx index 4dec88afc16a..45a44015deca 100644 --- a/xmloff/source/text/XMLIndexTOCStylesContext.cxx +++ b/xmloff/source/text/XMLIndexTOCStylesContext.cxx @@ -39,7 +39,7 @@ #include "xmloff/xmlnmspe.hxx" #include <xmloff/nmspmap.hxx> #include <xmloff/xmltoken.hxx> -#include <xmloff/xmluconv.hxx> +#include <sax/tools/converter.hxx> #include <com/sun/star/uno/Sequence.hxx> #include <tools/debug.hxx> #include <rtl/ustring.hxx> @@ -91,7 +91,7 @@ void XMLIndexTOCStylesContext::StartElement( (IsXMLToken(sLocalName, XML_OUTLINE_LEVEL)) ) { sal_Int32 nTmp; - if (SvXMLUnitConverter::convertNumber( + if (::sax::Converter::convertNumber( nTmp, xAttrList->getValueByIndex(nAttr), 1, GetImport().GetTextImport()->GetChapterNumbering()-> getCount())) diff --git a/xmloff/source/text/XMLIndexTabStopEntryContext.cxx b/xmloff/source/text/XMLIndexTabStopEntryContext.cxx index ff70425d0711..a6654f74c01e 100644 --- a/xmloff/source/text/XMLIndexTabStopEntryContext.cxx +++ b/xmloff/source/text/XMLIndexTabStopEntryContext.cxx @@ -29,8 +29,10 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" - #include "XMLIndexTabStopEntryContext.hxx" + +#include <sax/tools/converter.hxx> + #include "XMLIndexTemplateContext.hxx" #include <xmloff/xmlictxt.hxx> #include <xmloff/xmlimp.hxx> @@ -114,8 +116,8 @@ void XMLIndexTabStopEntryContext::StartElement( // #i21237# else if ( IsXMLToken( sLocalName, XML_WITH_TAB ) ) { - bool bTmp; - if (SvXMLUnitConverter::convertBool(bTmp, sAttr)) + bool bTmp(false); + if (::sax::Converter::convertBool(bTmp, sAttr)) bWithTab = bTmp; } // else: unknown style: attribute -> ignore diff --git a/xmloff/source/text/XMLIndexTableSourceContext.cxx b/xmloff/source/text/XMLIndexTableSourceContext.cxx index 783c18e5590f..34cae7a0fd74 100644 --- a/xmloff/source/text/XMLIndexTableSourceContext.cxx +++ b/xmloff/source/text/XMLIndexTableSourceContext.cxx @@ -29,12 +29,14 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" - #include "XMLIndexTableSourceContext.hxx" + #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/container/XIndexReplace.hpp> - #include <com/sun/star/text/ReferenceFieldPart.hpp> + +#include <sax/tools/converter.hxx> + #include "XMLIndexTemplateContext.hxx" #include "XMLIndexTitleTemplateContext.hxx" #include "XMLIndexTOCStylesContext.hxx" @@ -104,12 +106,12 @@ void XMLIndexTableSourceContext::ProcessAttribute( enum IndexSourceParamEnum eParam, const OUString& rValue) { - bool bTmp; + bool bTmp(false); switch (eParam) { case XML_TOK_INDEXSOURCE_USE_CAPTION: - if (SvXMLUnitConverter::convertBool(bTmp, rValue)) + if (::sax::Converter::convertBool(bTmp, rValue)) { bUseCaption = bTmp; } diff --git a/xmloff/source/text/XMLIndexUserSourceContext.cxx b/xmloff/source/text/XMLIndexUserSourceContext.cxx index fd5be90bb89f..8a9054fba3a0 100644 --- a/xmloff/source/text/XMLIndexUserSourceContext.cxx +++ b/xmloff/source/text/XMLIndexUserSourceContext.cxx @@ -33,6 +33,7 @@ #include "XMLIndexUserSourceContext.hxx" #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/container/XIndexReplace.hpp> +#include <sax/tools/converter.hxx> #include "XMLIndexTemplateContext.hxx" #include "XMLIndexTitleTemplateContext.hxx" #include "XMLIndexTOCStylesContext.hxx" @@ -42,7 +43,6 @@ #include "xmloff/xmlnmspe.hxx" #include <xmloff/nmspmap.hxx> #include <xmloff/xmltoken.hxx> -#include <xmloff/xmluconv.hxx> #include <tools/debug.hxx> #include <rtl/ustring.hxx> @@ -108,54 +108,54 @@ void XMLIndexUserSourceContext::ProcessAttribute( enum IndexSourceParamEnum eParam, const OUString& rValue) { - bool bTmp; + bool bTmp(false); switch (eParam) { case XML_TOK_INDEXSOURCE_USE_INDEX_MARKS: - if (SvXMLUnitConverter::convertBool(bTmp, rValue)) + if (::sax::Converter::convertBool(bTmp, rValue)) { bUseMarks = bTmp; } break; case XML_TOK_INDEXSOURCE_USE_OBJECTS: - if (SvXMLUnitConverter::convertBool(bTmp, rValue)) + if (::sax::Converter::convertBool(bTmp, rValue)) { bUseObjects = bTmp; } break; case XML_TOK_INDEXSOURCE_USE_GRAPHICS: - if (SvXMLUnitConverter::convertBool(bTmp, rValue)) + if (::sax::Converter::convertBool(bTmp, rValue)) { bUseGraphic = bTmp; } break; case XML_TOK_INDEXSOURCE_USE_TABLES: - if (SvXMLUnitConverter::convertBool(bTmp, rValue)) + if (::sax::Converter::convertBool(bTmp, rValue)) { bUseTables = bTmp; } break; case XML_TOK_INDEXSOURCE_USE_FRAMES: - if (SvXMLUnitConverter::convertBool(bTmp, rValue)) + if (::sax::Converter::convertBool(bTmp, rValue)) { bUseFrames = bTmp; } break; case XML_TOK_INDEXSOURCE_COPY_OUTLINE_LEVELS: - if (SvXMLUnitConverter::convertBool(bTmp, rValue)) + if (::sax::Converter::convertBool(bTmp, rValue)) { bUseLevelFromSource = bTmp; } break; case XML_TOK_INDEXSOURCE_USE_INDEX_SOURCE_STYLES: - if (SvXMLUnitConverter::convertBool(bTmp, rValue)) + if (::sax::Converter::convertBool(bTmp, rValue)) { bUseLevelParagraphStyles = bTmp; } diff --git a/xmloff/source/text/XMLLineNumberingExport.cxx b/xmloff/source/text/XMLLineNumberingExport.cxx index 021314e36599..2e40898b2ddb 100644 --- a/xmloff/source/text/XMLLineNumberingExport.cxx +++ b/xmloff/source/text/XMLLineNumberingExport.cxx @@ -32,6 +32,7 @@ #include "com/sun/star/beans/XPropertySet.hpp" #include "com/sun/star/text/XLineNumberingProperties.hpp" #include <com/sun/star/style/LineNumberPosition.hpp> +#include <sax/tools/converter.hxx> #include <xmloff/xmlexp.hxx> #include <xmloff/xmluconv.hxx> #include "xmloff/xmlnmspe.hxx" @@ -176,7 +177,7 @@ void XMLLineNumberingExport::Export() sal_Int16 nLineInterval = 0; aAny >>= nLineInterval; OUStringBuffer sBuf; - SvXMLUnitConverter::convertNumber(sBuf, + ::sax::Converter::convertNumber(sBuf, (sal_Int32)nLineInterval); rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_INCREMENT, sBuf.makeStringAndClear()); @@ -196,7 +197,7 @@ void XMLLineNumberingExport::Export() aAny = xLineNumbering->getPropertyValue(sSeparatorInterval); sal_Int16 nLineDistance = 0; aAny >>= nLineDistance; - SvXMLUnitConverter::convertNumber(sBuf, + ::sax::Converter::convertNumber(sBuf, (sal_Int32)nLineDistance); rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_INCREMENT, sBuf.makeStringAndClear()); diff --git a/xmloff/source/text/XMLLineNumberingImportContext.cxx b/xmloff/source/text/XMLLineNumberingImportContext.cxx index c48cb8f58409..1378a3d856a6 100644 --- a/xmloff/source/text/XMLLineNumberingImportContext.cxx +++ b/xmloff/source/text/XMLLineNumberingImportContext.cxx @@ -34,6 +34,7 @@ #include "com/sun/star/text/XLineNumberingProperties.hpp" #include <com/sun/star/style/LineNumberPosition.hpp> #include <com/sun/star/style/NumberingType.hpp> +#include <sax/tools/converter.hxx> #include <xmloff/xmlimp.hxx> #include <xmloff/xmluconv.hxx> #include "xmloff/xmlnmspe.hxx" @@ -139,7 +140,7 @@ void XMLLineNumberingImportContext::ProcessAttribute( enum LineNumberingToken eToken, OUString sValue) { - bool bTmp; + bool bTmp(false); sal_Int32 nTmp; switch (eToken) @@ -149,28 +150,28 @@ void XMLLineNumberingImportContext::ProcessAttribute( break; case XML_TOK_LINENUMBERING_NUMBER_LINES: - if (SvXMLUnitConverter::convertBool(bTmp, sValue)) + if (::sax::Converter::convertBool(bTmp, sValue)) { bNumberLines = bTmp; } break; case XML_TOK_LINENUMBERING_COUNT_EMPTY_LINES: - if (SvXMLUnitConverter::convertBool(bTmp, sValue)) + if (::sax::Converter::convertBool(bTmp, sValue)) { bCountEmptyLines = bTmp; } break; case XML_TOK_LINENUMBERING_COUNT_IN_TEXT_BOXES: - if (SvXMLUnitConverter::convertBool(bTmp, sValue)) + if (::sax::Converter::convertBool(bTmp, sValue)) { bCountInFloatingFrames = bTmp; } break; case XML_TOK_LINENUMBERING_RESTART_NUMBERING: - if (SvXMLUnitConverter::convertBool(bTmp, sValue)) + if (::sax::Converter::convertBool(bTmp, sValue)) { bRestartNumbering = bTmp; } @@ -213,7 +214,7 @@ void XMLLineNumberingImportContext::ProcessAttribute( } case XML_TOK_LINENUMBERING_INCREMENT: - if (SvXMLUnitConverter::convertNumber(nTmp, sValue, 0)) + if (::sax::Converter::convertNumber(nTmp, sValue, 0)) { nIncrement = (sal_Int16)nTmp; } diff --git a/xmloff/source/text/XMLLineNumberingSeparatorImportContext.cxx b/xmloff/source/text/XMLLineNumberingSeparatorImportContext.cxx index adc7a3230d4c..b2b47401a7a8 100644 --- a/xmloff/source/text/XMLLineNumberingSeparatorImportContext.cxx +++ b/xmloff/source/text/XMLLineNumberingSeparatorImportContext.cxx @@ -28,13 +28,15 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" + #include "XMLLineNumberingSeparatorImportContext.hxx" + +#include <sax/tools/converter.hxx> #include "XMLLineNumberingImportContext.hxx" #include <xmloff/xmlimp.hxx> #include <xmloff/nmspmap.hxx> #include "xmloff/xmlnmspe.hxx" #include <xmloff/xmltoken.hxx> -#include <xmloff/xmluconv.hxx> using namespace ::com::sun::star::uno; @@ -75,7 +77,7 @@ void XMLLineNumberingSeparatorImportContext::StartElement( IsXMLToken(sLocalName, XML_INCREMENT) ) { sal_Int32 nTmp; - if (SvXMLUnitConverter::convertNumber( + if (::sax::Converter::convertNumber( nTmp, xAttrList->getValueByIndex(i), 0)) { rLineNumberingContext.SetSeparatorIncrement((sal_Int16)nTmp); diff --git a/xmloff/source/text/XMLSectionExport.cxx b/xmloff/source/text/XMLSectionExport.cxx index dba56113123c..d26a5b8e0e93 100644 --- a/xmloff/source/text/XMLSectionExport.cxx +++ b/xmloff/source/text/XMLSectionExport.cxx @@ -53,6 +53,9 @@ #include <com/sun/star/text/XTextFieldsSupplier.hpp> #include <com/sun/star/text/XChapterNumberingSupplier.hpp> #include <com/sun/star/text/ChapterFormat.hpp> //i90246 + +#include <sax/tools/converter.hxx> + #include <xmloff/xmltoken.hxx> #include "xmloff/xmlnmspe.hxx" #include <xmloff/families.hxx> @@ -475,7 +478,7 @@ void XMLSectionExport::ExportRegularSectionStart( if (aPassword.getLength() > 0) { OUStringBuffer aBuffer; - SvXMLUnitConverter::encodeBase64(aBuffer, aPassword); + ::sax::Converter::encodeBase64(aBuffer, aPassword); GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_PROTECTION_KEY, aBuffer.makeStringAndClear()); } @@ -584,7 +587,7 @@ void XMLSectionExport::ExportTableOfContentStart( if( rPropertySet->getPropertyValue(sLevel) >>= nLevel ) { OUStringBuffer sBuffer; - SvXMLUnitConverter::convertNumber(sBuffer, (sal_Int32)nLevel); + ::sax::Converter::convertNumber(sBuffer, (sal_Int32)nLevel); GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_OUTLINE_LEVEL, sBuffer.makeStringAndClear()); @@ -1581,7 +1584,7 @@ void XMLSectionExport::ExportLevelParagraphStyles( // level attribute; we count 1..10; API 0..9 OUStringBuffer sBuf; sal_Int32 nLevelPlusOne = nLevel + 1; - SvXMLUnitConverter::convertNumber(sBuf, nLevelPlusOne); + ::sax::Converter::convertNumber(sBuf, nLevelPlusOne); GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_OUTLINE_LEVEL, sBuf.makeStringAndClear()); diff --git a/xmloff/source/text/XMLSectionFootnoteConfigExport.cxx b/xmloff/source/text/XMLSectionFootnoteConfigExport.cxx index a420ebb13f8f..a864d59bfd25 100644 --- a/xmloff/source/text/XMLSectionFootnoteConfigExport.cxx +++ b/xmloff/source/text/XMLSectionFootnoteConfigExport.cxx @@ -32,6 +32,7 @@ #include <xmloff/xmlexp.hxx> #include <xmloff/xmlprmap.hxx> #include <com/sun/star/style/NumberingType.hpp> +#include <sax/tools/converter.hxx> #include <xmloff/maptype.hxx> #include <xmloff/txtprmap.hxx> @@ -156,7 +157,7 @@ void XMLSectionFootnoteConfigExport::exportXML( if (bNumRestart) { // restart number is stored as 0.., but interpreted as 1.. - SvXMLUnitConverter::convertNumber(sBuf, + ::sax::Converter::convertNumber(sBuf, (sal_Int32)(nNumRestartAt+1)); rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_START_VALUE, sBuf.makeStringAndClear()); diff --git a/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx b/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx index 6e699017c374..3e67a6d881aa 100644 --- a/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx +++ b/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx @@ -36,6 +36,7 @@ #include <com/sun/star/uno/Reference.h> #include <com/sun/star/xml/sax/XAttributeList.hpp> #include <com/sun/star/style/NumberingType.hpp> +#include <sax/tools/converter.hxx> #include <xmloff/xmlimp.hxx> #include <xmloff/xmltoken.hxx> #include <xmloff/xmluconv.hxx> @@ -107,7 +108,7 @@ void XMLSectionFootnoteConfigImport::StartElement( if (IsXMLToken(sLocalName, XML_START_VALUE)) { sal_Int32 nTmp; - if (SvXMLUnitConverter::convertNumber(nTmp, sAttrValue)) + if (::sax::Converter::convertNumber(nTmp, sAttrValue)) { nNumRestartAt = static_cast< sal_Int16 >( nTmp ) - 1; bNumRestart = sal_True; diff --git a/xmloff/source/text/XMLSectionImportContext.cxx b/xmloff/source/text/XMLSectionImportContext.cxx index 0058026d0dba..16d50d055ce0 100644 --- a/xmloff/source/text/XMLSectionImportContext.cxx +++ b/xmloff/source/text/XMLSectionImportContext.cxx @@ -37,8 +37,8 @@ #include <xmloff/nmspmap.hxx> #include "xmloff/xmlnmspe.hxx" #include <xmloff/xmltoken.hxx> -#include <xmloff/xmluconv.hxx> #include <xmloff/prstylei.hxx> +#include <sax/tools/converter.hxx> #include <com/sun/star/container/XNamed.hpp> #include <com/sun/star/uno/Reference.h> #include <com/sun/star/text/XTextContent.hpp> @@ -313,8 +313,8 @@ void XMLSectionImportContext::ProcessAttributes( break; case XML_TOK_SECTION_IS_HIDDEN: { - bool bTmp; - if (SvXMLUnitConverter::convertBool(bTmp, sAttr)) + bool bTmp(false); + if (::sax::Converter::convertBool(bTmp, sAttr)) { bIsCurrentlyVisible = !bTmp; bIsCurrentlyVisibleOK = sal_True; @@ -322,13 +322,13 @@ void XMLSectionImportContext::ProcessAttributes( } break; case XML_TOK_SECTION_PROTECTION_KEY: - SvXMLUnitConverter::decodeBase64(aSequence, sAttr); + ::sax::Converter::decodeBase64(aSequence, sAttr); bSequenceOK = sal_True; break; case XML_TOK_SECTION_PROTECT: { - bool bTmp; - if (SvXMLUnitConverter::convertBool(bTmp, sAttr)) + bool bTmp(false); + if (::sax::Converter::convertBool(bTmp, sAttr)) { bProtect = bTmp; } diff --git a/xmloff/source/text/XMLSectionSourceDDEImportContext.cxx b/xmloff/source/text/XMLSectionSourceDDEImportContext.cxx index 39a7d0095dd9..01f449d77628 100644 --- a/xmloff/source/text/XMLSectionSourceDDEImportContext.cxx +++ b/xmloff/source/text/XMLSectionSourceDDEImportContext.cxx @@ -37,7 +37,7 @@ #include <xmloff/nmspmap.hxx> #include "xmloff/xmlnmspe.hxx" #include <xmloff/xmltoken.hxx> -#include <xmloff/xmluconv.hxx> +#include <sax/tools/converter.hxx> #include <com/sun/star/uno/Reference.h> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XMultiPropertySet.hpp> @@ -129,8 +129,8 @@ void XMLSectionSourceDDEImportContext::StartElement( break; case XML_TOK_SECTION_IS_AUTOMATIC_UPDATE: { - bool bTmp; - if (SvXMLUnitConverter::convertBool( + bool bTmp(false); + if (::sax::Converter::convertBool( bTmp, xAttrList->getValueByIndex(nAttr))) { bAutomaticUpdate = bTmp; diff --git a/xmloff/source/text/XMLTextColumnsContext.cxx b/xmloff/source/text/XMLTextColumnsContext.cxx index a1bfa163711a..a6e3d52c946c 100644 --- a/xmloff/source/text/XMLTextColumnsContext.cxx +++ b/xmloff/source/text/XMLTextColumnsContext.cxx @@ -33,6 +33,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/style/VerticalAlignment.hpp> #include <com/sun/star/beans/XPropertySet.hpp> +#include <sax/tools/converter.hxx> #include <xmloff/xmltkmap.hxx> #include <xmloff/xmluconv.hxx> #include <xmloff/nmspmap.hxx> @@ -158,8 +159,8 @@ XMLTextColumnContext_Impl::XMLTextColumnContext_Impl( if( nPos != -1 && nPos+1 == rValue.getLength() ) { OUString sTmp( rValue.copy( 0, nPos ) ); - if( GetImport().GetMM100UnitConverter(). - convertNumber( nVal, sTmp, 0, USHRT_MAX ) ) + if (::sax::Converter::convertNumber( + nVal, sTmp, 0, USHRT_MAX)) aColumn.Width = nVal; } } @@ -249,17 +250,13 @@ XMLTextColumnSepContext_Impl::XMLTextColumnSepContext_Impl( nWidth = nVal; break; case XML_TOK_COLUMN_SEP_HEIGHT: - if( GetImport().GetMM100UnitConverter(). - convertPercent( nVal, rValue ) && + if (::sax::Converter::convertPercent( nVal, rValue ) && nVal >=1 && nVal <= 100 ) nHeight = (sal_Int8)nVal; break; case XML_TOK_COLUMN_SEP_COLOR: { - Color aColor; - if( GetImport().GetMM100UnitConverter(). - convertColor( aColor, rValue ) ) - nColor = (sal_Int32)aColor.GetColor(); + ::sax::Converter::convertColor( nColor, rValue ); } break; case XML_TOK_COLUMN_SEP_ALIGN: @@ -332,8 +329,7 @@ XMLTextColumnsContext::XMLTextColumnsContext( if( XML_NAMESPACE_FO == nPrefix ) { if( IsXMLToken( aLocalName, XML_COLUMN_COUNT ) && - GetImport().GetMM100UnitConverter(). - convertNumber( nVal, rValue, 0, SHRT_MAX ) ) + ::sax::Converter::convertNumber( nVal, rValue, 0, SHRT_MAX )) { nCount = (sal_Int16)nVal; } diff --git a/xmloff/source/text/XMLTextColumnsExport.cxx b/xmloff/source/text/XMLTextColumnsExport.cxx index a4c58f4651d9..18c4f74a2cb1 100644 --- a/xmloff/source/text/XMLTextColumnsExport.cxx +++ b/xmloff/source/text/XMLTextColumnsExport.cxx @@ -37,6 +37,7 @@ #include <com/sun/star/style/VerticalAlignment.hpp> #include <com/sun/star/beans/XPropertySet.hpp> +#include <sax/tools/converter.hxx> #include <xmloff/xmltoken.hxx> #include "xmloff/xmlnmspe.hxx" @@ -76,7 +77,7 @@ void XMLTextColumnsExport::exportXML( const Any& rAny ) sal_Int32 nCount = aColumns.getLength(); OUStringBuffer sValue; - GetExport().GetMM100UnitConverter().convertNumber( sValue, nCount ? nCount : 1 ); + ::sax::Converter::convertNumber( sValue, (nCount) ? nCount : 1 ); GetExport().AddAttribute( XML_NAMESPACE_FO, XML_COLUMN_COUNT, sValue.makeStringAndClear() ); @@ -120,8 +121,7 @@ void XMLTextColumnsExport::exportXML( const Any& rAny ) aAny = xPropSet->getPropertyValue( sSeparatorLineColor ); sal_Int32 nColor = 0; aAny >>= nColor; - GetExport().GetMM100UnitConverter().convertColor( sValue, - nColor ); + ::sax::Converter::convertColor( sValue, nColor ); GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_COLOR, sValue.makeStringAndClear() ); @@ -129,8 +129,7 @@ void XMLTextColumnsExport::exportXML( const Any& rAny ) aAny = xPropSet->getPropertyValue( sSeparatorLineRelativeHeight ); sal_Int8 nHeight = 0; aAny >>= nHeight; - GetExport().GetMM100UnitConverter().convertPercent( sValue, - nHeight ); + ::sax::Converter::convertPercent( sValue, nHeight ); GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_HEIGHT, sValue.makeStringAndClear() ); @@ -181,8 +180,7 @@ void XMLTextColumnsExport::exportXML( const Any& rAny ) while( nCount-- ) { // style:rel-width - GetExport().GetMM100UnitConverter().convertNumber( sValue, - pColumns->Width ); + ::sax::Converter::convertNumber( sValue, pColumns->Width ); sValue.append( (sal_Unicode)'*' ); GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_REL_WIDTH, sValue.makeStringAndClear() ); diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx index 58023ef5849e..0ba202c465ce 100644 --- a/xmloff/source/text/XMLTextFrameContext.cxx +++ b/xmloff/source/text/XMLTextFrameContext.cxx @@ -41,6 +41,7 @@ #include <com/sun/star/io/XOutputStream.hpp> #include <com/sun/star/text/HoriOrientation.hpp> #include <com/sun/star/text/VertOrientation.hpp> +#include <sax/tools/converter.hxx> #include <xmloff/xmlimp.hxx> #include <xmloff/xmltoken.hxx> #include "xmloff/xmlnmspe.hxx" @@ -908,8 +909,7 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl( case XML_TOK_TEXT_FRAME_ANCHOR_PAGE_NUMBER: { sal_Int32 nTmp; - if( GetImport().GetMM100UnitConverter(). - convertNumber( nTmp, rValue, 1, SHRT_MAX ) ) + if (::sax::Converter::convertNumber(nTmp, rValue, 1, SHRT_MAX)) nPage = (sal_Int16)nTmp; } break; @@ -924,8 +924,7 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl( if( rValue.indexOf( '%' ) != -1 ) { sal_Int32 nTmp; - GetImport().GetMM100UnitConverter().convertPercent( nTmp, - rValue ); + ::sax::Converter::convertPercent( nTmp, rValue ); nRelWidth = (sal_Int16)nTmp; } else @@ -942,8 +941,7 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl( else { sal_Int32 nTmp; - if( GetImport().GetMM100UnitConverter(). - convertPercent( nTmp, rValue ) ) + if (::sax::Converter::convertPercent( nTmp, rValue )) nRelWidth = (sal_Int16)nTmp; } break; @@ -951,8 +949,7 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl( if( rValue.indexOf( '%' ) != -1 ) { sal_Int32 nTmp; - GetImport().GetMM100UnitConverter().convertPercent( nTmp, - rValue ); + ::sax::Converter::convertPercent( nTmp, rValue ); nRelWidth = (sal_Int16)nTmp; } else @@ -967,8 +964,7 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl( if( rValue.indexOf( '%' ) != -1 ) { sal_Int32 nTmp; - GetImport().GetMM100UnitConverter().convertPercent( nTmp, - rValue ); + ::sax::Converter::convertPercent( nTmp, rValue ); nRelHeight = (sal_Int16)nTmp; } else @@ -990,8 +986,7 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl( else { sal_Int32 nTmp; - if( GetImport().GetMM100UnitConverter(). - convertPercent( nTmp, rValue ) ) + if (::sax::Converter::convertPercent( nTmp, rValue )) nRelHeight = (sal_Int16)nTmp; } break; @@ -999,8 +994,7 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl( if( rValue.indexOf( '%' ) != -1 ) { sal_Int32 nTmp; - GetImport().GetMM100UnitConverter().convertPercent( nTmp, - rValue ); + ::sax::Converter::convertPercent( nTmp, rValue ); nRelHeight = (sal_Int16)nTmp; } else @@ -1011,7 +1005,7 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl( bMinHeight = sal_True; break; case XML_TOK_TEXT_FRAME_Z_INDEX: - GetImport().GetMM100UnitConverter().convertNumber( nZIndex, rValue, -1 ); + ::sax::Converter::convertNumber( nZIndex, rValue, -1 ); break; case XML_TOK_TEXT_FRAME_NEXT_CHAIN_NAME: sNextName = rValue; @@ -1037,7 +1031,7 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl( sValue = sValue.copy( nRotateLen+1, nLen-(nRotateLen+2) ); sValue.trim(); sal_Int32 nVal; - if( GetImport().GetMM100UnitConverter().convertNumber( nVal, sValue ) ) + if (::sax::Converter::convertNumber( nVal, sValue )) nRotation = (sal_Int16)(nVal % 360 ); } } @@ -1219,8 +1213,7 @@ void XMLTextFrameContext_Impl::Characters( const OUString& rChars ) } Sequence< sal_Int8 > aBuffer( (sChars.getLength() / 4) * 3 ); sal_Int32 nCharsDecoded = - GetImport().GetMM100UnitConverter(). - decodeBase64SomeChars( aBuffer, sChars ); + ::sax::Converter::decodeBase64SomeChars( aBuffer, sChars ); xBase64Stream->writeBytes( aBuffer ); if( nCharsDecoded != sChars.getLength() ) sBase64CharsLeft = sChars.copy( nCharsDecoded ); diff --git a/xmloff/source/text/XMLTextFrameHyperlinkContext.cxx b/xmloff/source/text/XMLTextFrameHyperlinkContext.cxx index b63aa46ef4d9..f1622a93636a 100644 --- a/xmloff/source/text/XMLTextFrameHyperlinkContext.cxx +++ b/xmloff/source/text/XMLTextFrameHyperlinkContext.cxx @@ -28,11 +28,13 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" + +#include <sax/tools/converter.hxx> + #include <xmloff/xmlimp.hxx> #include <xmloff/nmspmap.hxx> #include "xmloff/xmlnmspe.hxx" #include <xmloff/xmltoken.hxx> -#include <xmloff/xmluconv.hxx> #include "XMLTextFrameContext.hxx" #include "XMLTextFrameHyperlinkContext.hxx" @@ -89,9 +91,8 @@ XMLTextFrameHyperlinkContext::XMLTextFrameHyperlinkContext( break; case XML_TOK_TEXT_HYPERLINK_SERVER_MAP: { - bool bTmp; - if( rImport.GetMM100UnitConverter().convertBool( bTmp, - rValue ) ) + bool bTmp(false); + if (::sax::Converter::convertBool( bTmp, rValue )) { bMap = bTmp; } diff --git a/xmloff/source/text/XMLTextShapeImportHelper.cxx b/xmloff/source/text/XMLTextShapeImportHelper.cxx index 21689e5fc8c2..17f359bbab36 100644 --- a/xmloff/source/text/XMLTextShapeImportHelper.cxx +++ b/xmloff/source/text/XMLTextShapeImportHelper.cxx @@ -31,6 +31,8 @@ #include <com/sun/star/text/XTextContent.hpp> #include <com/sun/star/text/TextContentAnchorType.hpp> +#include <sax/tools/converter.hxx> + #include <xmloff/xmlimp.hxx> #include <xmloff/txtimp.hxx> #include <xmloff/xmluconv.hxx> @@ -120,8 +122,7 @@ void XMLTextShapeImportHelper::addShape( case XML_TOK_TEXT_FRAME_ANCHOR_PAGE_NUMBER: { sal_Int32 nTmp; - if( rImport.GetMM100UnitConverter(). - convertNumber( nTmp, rValue, 1, SHRT_MAX ) ) + if (::sax::Converter::convertNumber(nTmp, rValue, 1, SHRT_MAX)) nPage = (sal_Int16)nTmp; } break; diff --git a/xmloff/source/text/XMLTrackedChangesImportContext.cxx b/xmloff/source/text/XMLTrackedChangesImportContext.cxx index 8af54c293ed2..11c04496a542 100644 --- a/xmloff/source/text/XMLTrackedChangesImportContext.cxx +++ b/xmloff/source/text/XMLTrackedChangesImportContext.cxx @@ -32,10 +32,10 @@ #include "XMLChangedRegionImportContext.hxx" #include <com/sun/star/uno/Reference.h> #include <com/sun/star/uno/Sequence.h> +#include <sax/tools/converter.hxx> #include <xmloff/xmlimp.hxx> #include "xmloff/xmlnmspe.hxx" #include <xmloff/nmspmap.hxx> -#include <xmloff/xmluconv.hxx> #include <xmloff/xmltoken.hxx> @@ -78,8 +78,8 @@ void XMLTrackedChangesImportContext::StartElement( { if ( IsXMLToken( sLocalName, XML_TRACK_CHANGES ) ) { - bool bTmp; - if( SvXMLUnitConverter::convertBool( + bool bTmp(false); + if (::sax::Converter::convertBool( bTmp, xAttrList->getValueByIndex(i)) ) { bTrackChanges = bTmp; diff --git a/xmloff/source/text/txtdrope.cxx b/xmloff/source/text/txtdrope.cxx index 3e469a9dc501..13d2bc0b0cf4 100644 --- a/xmloff/source/text/txtdrope.cxx +++ b/xmloff/source/text/txtdrope.cxx @@ -31,6 +31,7 @@ #include <tools/debug.hxx> #include <rtl/ustrbuf.hxx> #include <com/sun/star/style/DropCapFormat.hpp> +#include <sax/tools/converter.hxx> #include <xmloff/xmltoken.hxx> #include <xmloff/xmlexp.hxx> #include <xmloff/xmluconv.hxx> @@ -68,7 +69,7 @@ void XMLTextDropCapExport::exportXML( const Any& rAny, SvXMLUnitConverter& rUnitConv = rExport.GetMM100UnitConverter(); // style:lines - rUnitConv.convertNumber( sBuffer, (sal_Int32)aFormat.Lines ); + ::sax::Converter::convertNumber( sBuffer, (sal_Int32)aFormat.Lines ); rExport.AddAttribute( XML_NAMESPACE_STYLE, XML_LINES, sBuffer.makeStringAndClear() ); @@ -79,7 +80,7 @@ void XMLTextDropCapExport::exportXML( const Any& rAny, } else if( aFormat.Count > 1 ) { - rUnitConv.convertNumber( sBuffer, (sal_Int32)aFormat.Count ); + ::sax::Converter::convertNumber(sBuffer, (sal_Int32)aFormat.Count); sValue = sBuffer.makeStringAndClear(); } if( sValue.getLength() ) diff --git a/xmloff/source/text/txtdropi.cxx b/xmloff/source/text/txtdropi.cxx index 47cd1ec379d9..0bcae66af819 100644 --- a/xmloff/source/text/txtdropi.cxx +++ b/xmloff/source/text/txtdropi.cxx @@ -28,8 +28,13 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" -#include <com/sun/star/style/DropCapFormat.hpp> + #include "txtdropi.hxx" + +#include <com/sun/star/style/DropCapFormat.hpp> + +#include <sax/tools/converter.hxx> + #include <xmloff/xmltkmap.hxx> #include <xmloff/xmluconv.hxx> #include <xmloff/nmspmap.hxx> @@ -87,7 +92,7 @@ void XMLTextDropCapImportContext::ProcessAttrs( switch( aTokenMap.Get( nPrefix, aLocalName ) ) { case XML_TOK_DROP_LINES: - if( GetImport().GetMM100UnitConverter().convertNumber( nTmp, rValue, 0, 255 ) ) + if (::sax::Converter::convertNumber( nTmp, rValue, 0, 255 )) { aFormat.Lines = nTmp < 2 ? 0 : (sal_Int8)nTmp; } @@ -98,7 +103,7 @@ void XMLTextDropCapImportContext::ProcessAttrs( { bWholeWord = sal_True; } - else if( GetImport().GetMM100UnitConverter().convertNumber( nTmp, rValue, 1, 255 ) ) + else if (::sax::Converter::convertNumber( nTmp, rValue, 1, 255 )) { bWholeWord = sal_False; aFormat.Count = (sal_Int8)nTmp; diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx index 19f0b8aa2fdc..ca2cfe2245e6 100644 --- a/xmloff/source/text/txtfldi.cxx +++ b/xmloff/source/text/txtfldi.cxx @@ -69,6 +69,8 @@ #include <com/sun/star/util/XUpdatable.hpp> #include <com/sun/star/sdb/CommandType.hpp> +#include <sax/tools/converter.hxx> + #include <rtl/ustring.hxx> #include <rtl/ustrbuf.hxx> #include <rtl/math.hxx> @@ -714,9 +716,8 @@ void XMLSenderFieldImportContext::ProcessAttribute( if (XML_TOK_TEXTFIELD_FIXED == nAttrToken) { // set bVal - bool bVal; - bool bRet = GetImport().GetMM100UnitConverter(). - convertBool(bVal, sAttrValue); + bool bVal(false); + bool const bRet = ::sax::Converter::convertBool(bVal, sAttrValue); // set bFixed if successfull if (bRet) { @@ -930,7 +931,7 @@ void XMLPageNumberImportContext::ProcessAttribute( case XML_TOK_TEXTFIELD_PAGE_ADJUST: { sal_Int32 nTmp; - if (SvXMLUnitConverter::convertNumber(nTmp, sAttrValue)) + if (::sax::Converter::convertNumber(nTmp, sAttrValue)) { nPageAdjust = (sal_Int16)nTmp; } @@ -1133,8 +1134,8 @@ void XMLTimeFieldImportContext::ProcessAttribute( } case XML_TOK_TEXTFIELD_FIXED: { - bool bTmp; - if (SvXMLUnitConverter::convertBool(bTmp, sAttrValue)) + bool bTmp(false); + if (::sax::Converter::convertBool(bTmp, sAttrValue)) { bFixed = bTmp; } @@ -1553,7 +1554,7 @@ void XMLDatabaseSelectImportContext::ProcessAttribute( if (XML_TOK_TEXTFIELD_ROW_NUMBER == nAttrToken) { sal_Int32 nTmp; - if (SvXMLUnitConverter::convertNumber( nTmp, sAttrValue + if (::sax::Converter::convertNumber( nTmp, sAttrValue /* , nMin, nMax ??? */ )) { nNumber = nTmp; @@ -1617,7 +1618,7 @@ void XMLDatabaseNumberImportContext::ProcessAttribute( case XML_TOK_TEXTFIELD_VALUE: { sal_Int32 nTmp; - if (SvXMLUnitConverter::convertNumber( nTmp, sAttrValue )) + if (::sax::Converter::convertNumber( nTmp, sAttrValue )) { nValue = nTmp; bValueOK = sal_True; @@ -1684,8 +1685,8 @@ void XMLSimpleDocInfoImportContext::ProcessAttribute( { if (XML_TOK_TEXTFIELD_FIXED == nAttrToken) { - bool bTmp; - if (SvXMLUnitConverter::convertBool(bTmp, sAttrValue)) + bool bTmp(false); + if (::sax::Converter::convertBool(bTmp, sAttrValue)) { bFixed = bTmp; } @@ -1833,7 +1834,7 @@ void XMLRevisionDocInfoImportContext::PrepareField( else { sal_Int32 nTmp; - if (SvXMLUnitConverter::convertNumber(nTmp, GetContent())) + if (::sax::Converter::convertNumber(nTmp, GetContent())) { Any aAny; aAny <<= nTmp; @@ -2077,8 +2078,8 @@ void XMLHiddenParagraphImportContext::ProcessAttribute( } else if (XML_TOK_TEXTFIELD_IS_HIDDEN == nAttrToken) { - bool bTmp; - if (SvXMLUnitConverter::convertBool(bTmp, sAttrValue)) + bool bTmp(false); + if (::sax::Converter::convertBool(bTmp, sAttrValue)) { bIsHidden = bTmp; } @@ -2151,8 +2152,8 @@ void XMLConditionalTextImportContext::ProcessAttribute( break; case XML_TOK_TEXTFIELD_CURRENT_VALUE: { - bool bTmp; - if (SvXMLUnitConverter::convertBool(bTmp, sAttrValue)) + bool bTmp(false); + if (::sax::Converter::convertBool(bTmp, sAttrValue)) { bCurrentValue = bTmp; } @@ -2232,8 +2233,8 @@ void XMLHiddenTextImportContext::ProcessAttribute( break; case XML_TOK_TEXTFIELD_IS_HIDDEN: { - bool bTmp; - if (SvXMLUnitConverter::convertBool(bTmp, sAttrValue)) + bool bTmp(false); + if (::sax::Converter::convertBool(bTmp, sAttrValue)) { bIsHidden = bTmp; } @@ -2299,8 +2300,8 @@ void XMLFileNameImportContext::ProcessAttribute( { case XML_TOK_TEXTFIELD_FIXED: { - bool bTmp; - if (SvXMLUnitConverter::convertBool(bTmp, sAttrValue)) + bool bTmp(false); + if (::sax::Converter::convertBool(bTmp, sAttrValue)) { bFixed = bTmp; } @@ -2460,7 +2461,7 @@ void XMLChapterImportContext::ProcessAttribute( case XML_TOK_TEXTFIELD_OUTLINE_LEVEL: { sal_Int32 nTmp; - if (SvXMLUnitConverter::convertNumber( + if (::sax::Converter::convertNumber( nTmp, sAttrValue, 1, GetImport().GetTextImport()->GetChapterNumbering()->getCount() )) @@ -2681,8 +2682,8 @@ void XMLPageVarSetFieldImportContext::ProcessAttribute( { case XML_TOK_TEXTFIELD_ACTIVE: { - bool bTmp; - if (SvXMLUnitConverter::convertBool(bTmp, sAttrValue)) + bool bTmp(false); + if (::sax::Converter::convertBool(bTmp, sAttrValue)) { bActive = bTmp; } @@ -2690,7 +2691,7 @@ void XMLPageVarSetFieldImportContext::ProcessAttribute( case XML_TOK_TEXTFIELD_PAGE_ADJUST: { sal_Int32 nTmp; - if (SvXMLUnitConverter::convertNumber(nTmp, sAttrValue)) + if (::sax::Converter::convertNumber(nTmp, sAttrValue)) { nAdjust = (sal_Int16)nTmp; } @@ -3109,8 +3110,8 @@ void XMLDdeFieldDeclImportContext::StartElement( break; case XML_TOK_DDEFIELD_UPDATE: { - bool bTmp; - if ( SvXMLUnitConverter::convertBool( + bool bTmp(false); + if (::sax::Converter::convertBool( bTmp, xAttrList->getValueByIndex(i)) ) { bUpdate = bTmp; @@ -3956,8 +3957,8 @@ bool lcl_ProcessLabel( const SvXMLImport& rImport, } else if( IsXMLToken( sLocalName, XML_CURRENT_SELECTED ) ) { - bool bTmp; - if( SvXMLUnitConverter::convertBool( bTmp, sValue ) ) + bool bTmp(false); + if (::sax::Converter::convertBool( bTmp, sValue )) rIsSelected = bTmp; } } diff --git a/xmloff/source/text/txtftne.cxx b/xmloff/source/text/txtftne.cxx index 23ee992339a5..9b220cf409fd 100644 --- a/xmloff/source/text/txtftne.cxx +++ b/xmloff/source/text/txtftne.cxx @@ -51,6 +51,7 @@ #include <com/sun/star/text/XEndnotesSupplier.hpp> #include <com/sun/star/text/FootnoteNumbering.hpp> #include <com/sun/star/container/XNameReplace.hpp> +#include <sax/tools/converter.hxx> #include <xmloff/xmltoken.hxx> #include "xmloff/xmlnmspe.hxx" #include <xmloff/xmlnumfe.hxx> @@ -319,7 +320,7 @@ void XMLTextParagraphExport::exportTextFootnoteConfigurationHelper( aAny = rFootnoteConfig->getPropertyValue(sStartAt); sal_Int16 nOffset = 0; aAny >>= nOffset; - SvXMLUnitConverter::convertNumber(sBuffer, (sal_Int32)nOffset); + ::sax::Converter::convertNumber(sBuffer, (sal_Int32)nOffset); GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_START_VALUE, sBuffer.makeStringAndClear()); diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index ad6eaeee6315..b728f33ec87f 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -88,6 +88,9 @@ #include <com/sun/star/text/XEndnotesSupplier.hpp> #include <com/sun/star/drawing/XControlShape.hpp> #include <com/sun/star/util/DateTime.hpp> + +#include <sax/tools/converter.hxx> + #include "xmloff/xmlnmspe.hxx" #include <xmloff/xmlaustp.hxx> #include <xmloff/families.hxx> @@ -2517,8 +2520,7 @@ sal_Int32 XMLTextParagraphExport::addTextFrameAttributes( { sal_Int16 nPage = 0; rPropSet->getPropertyValue( sAnchorPageNo ) >>= nPage; - GetExport().GetMM100UnitConverter().convertNumber( sValue, - (sal_Int32)nPage ); + ::sax::Converter::convertNumber( sValue, (sal_Int32)nPage ); GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_ANCHOR_PAGE_NUMBER, sValue.makeStringAndClear() ); } @@ -2606,8 +2608,7 @@ sal_Int32 XMLTextParagraphExport::addTextFrameAttributes( "Got illegal relative width from API" ); if( nRelWidth > 0 ) { - GetExport().GetMM100UnitConverter().convertPercent( sValue, - nRelWidth ); + ::sax::Converter::convertPercent( sValue, nRelWidth ); GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_REL_WIDTH, sValue.makeStringAndClear() ); } @@ -2653,8 +2654,7 @@ sal_Int32 XMLTextParagraphExport::addTextFrameAttributes( } else if( nRelHeight > 0 ) { - GetExport().GetMM100UnitConverter().convertPercent( sValue, - nRelHeight ); + ::sax::Converter::convertPercent( sValue, nRelHeight ); if( SizeType::MIN == nSizeType ) GetExport().AddAttribute( XML_NAMESPACE_FO, XML_MIN_HEIGHT, sValue.makeStringAndClear() ); @@ -2670,8 +2670,7 @@ sal_Int32 XMLTextParagraphExport::addTextFrameAttributes( rPropSet->getPropertyValue( sZOrder ) >>= nZIndex; if( -1 != nZIndex ) { - GetExport().GetMM100UnitConverter().convertNumber( sValue, - nZIndex ); + ::sax::Converter::convertNumber( sValue, nZIndex ); GetExport().AddAttribute( XML_NAMESPACE_DRAW, XML_ZINDEX, sValue.makeStringAndClear() ); } @@ -2991,7 +2990,7 @@ void XMLTextParagraphExport::_exportTextGraphic( OUStringBuffer sRet( GetXMLToken(XML_ROTATE).getLength()+4 ); sRet.append( GetXMLToken(XML_ROTATE)); sRet.append( (sal_Unicode)'(' ); - GetExport().GetMM100UnitConverter().convertNumber( sRet, (sal_Int32)nVal ); + ::sax::Converter::convertNumber( sRet, (sal_Int32)nVal ); sRet.append( (sal_Unicode)')' ); GetExport().AddAttribute( XML_NAMESPACE_SVG, XML_TRANSFORM, sRet.makeStringAndClear() ); diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx index 7bb95f10be0b..91b0fcd1fad7 100644 --- a/xmloff/source/text/txtparai.cxx +++ b/xmloff/source/text/txtparai.cxx @@ -45,6 +45,7 @@ #include <com/sun/star/container/XEnumerationAccess.hpp> #include <com/sun/star/rdf/XMetadatable.hpp> +#include <sax/tools/converter.hxx> #include <xmloff/xmlictxt.hxx> #include <xmloff/xmlimp.hxx> @@ -54,7 +55,6 @@ #include <xmloff/txtimp.hxx> #include "txtparai.hxx" #include "txtfldi.hxx" -#include <xmloff/xmluconv.hxx> #include "XMLFootnoteImportContext.hxx" #include "XMLTextMarkImportContext.hxx" #include "XMLTextFrameContext.hxx" @@ -1377,7 +1377,7 @@ void XMLTOCMarkImportContext_Impl::ProcessAttribute( { // ouline level: set Level property sal_Int32 nTmp; - if ( SvXMLUnitConverter::convertNumber( nTmp, sValue ) + if (::sax::Converter::convertNumber( nTmp, sValue ) && nTmp >= 1 && nTmp < GetImport().GetTextImport()-> GetChapterNumbering()->getCount() ) @@ -1444,7 +1444,7 @@ void XMLUserIndexMarkImportContext_Impl::ProcessAttribute( { // ouline level: set Level property sal_Int32 nTmp; - if (SvXMLUnitConverter::convertNumber( + if (::sax::Converter::convertNumber( nTmp, sValue, 0, GetImport().GetTextImport()->GetChapterNumbering()->getCount())) { @@ -1542,9 +1542,9 @@ void XMLAlphaIndexMarkImportContext_Impl::ProcessAttribute( else if ( IsXMLToken( sLocalName, XML_MAIN_ENTRY ) ) { sal_Bool bMainEntry = sal_False; - bool bTmp; + bool bTmp(false); - if (SvXMLUnitConverter::convertBool(bTmp, sValue)) + if (::sax::Converter::convertBool(bTmp, sValue)) bMainEntry = bTmp; rPropSet->setPropertyValue(sMainEntry, uno::makeAny(bMainEntry)); @@ -1971,8 +1971,8 @@ XMLParaContext::XMLParaContext( break; case XML_TOK_TEXT_P_IS_LIST_HEADER: { - bool bBool; - if( SvXMLUnitConverter::convertBool( bBool, rValue ) ) + bool bBool(false); + if( ::sax::Converter::convertBool( bBool, rValue ) ) { bIsListHeader = bBool; } @@ -1980,8 +1980,8 @@ XMLParaContext::XMLParaContext( break; case XML_TOK_TEXT_P_RESTART_NUMBERING: { - bool bBool; - if (SvXMLUnitConverter::convertBool(bBool, rValue)) + bool bBool(false); + if (::sax::Converter::convertBool(bBool, rValue)) { bIsRestart = bBool; } diff --git a/xmloff/source/text/txtprhdl.cxx b/xmloff/source/text/txtprhdl.cxx index a430339fcadd..fb05f2173501 100644 --- a/xmloff/source/text/txtprhdl.cxx +++ b/xmloff/source/text/txtprhdl.cxx @@ -43,6 +43,7 @@ #include <com/sun/star/text/RubyAdjust.hpp> #include <com/sun/star/text/FontEmphasis.hpp> #include <com/sun/star/text/ParagraphVertAlign.hpp> +#include <sax/tools/converter.hxx> #include <xmloff/xmltypes.hxx> #include <xmloff/xmluconv.hxx> #include <xmloff/xmltoken.hxx> @@ -438,7 +439,7 @@ sal_Bool XMLParagraphOnlyPropHdl_Impl::importXML( if( ! IsXMLToken( rStrImpValue, XML_NO_LIMIT ) ) { sal_Int32 nValue = 0; - bRet = SvXMLUnitConverter::convertNumber( nValue, rStrImpValue ); + bRet = ::sax::Converter::convertNumber( nValue, rStrImpValue ); bVal = 1 == nValue; } @@ -1062,9 +1063,8 @@ sal_Bool XMLTextRelWidthHeightPropHdl_Impl::importXML( Any& rValue, const SvXMLUnitConverter& ) const { - sal_Bool bRet; sal_Int32 nValue; - bRet = SvXMLUnitConverter::convertPercent( nValue, rStrImpValue ); + bool const bRet = ::sax::Converter::convertPercent( nValue, rStrImpValue ); if( bRet ) rValue <<= (sal_Int16)nValue; @@ -1081,7 +1081,7 @@ sal_Bool XMLTextRelWidthHeightPropHdl_Impl::exportXML( if( (rValue >>= nValue) && nValue > 0 ) { OUStringBuffer aOut; - SvXMLUnitConverter::convertPercent( aOut, nValue ); + ::sax::Converter::convertPercent( aOut, nValue ); rStrExpValue = aOut.makeStringAndClear(); bRet = sal_True; @@ -1170,7 +1170,7 @@ sal_Bool XMLTextRotationAnglePropHdl_Impl::importXML( const SvXMLUnitConverter& ) const { sal_Int32 nValue; - sal_Bool bRet = SvXMLUnitConverter::convertNumber( nValue, rStrImpValue ); + bool const bRet = ::sax::Converter::convertNumber( nValue, rStrImpValue ); if( bRet ) { nValue = (nValue % 360 ); @@ -1199,7 +1199,7 @@ sal_Bool XMLTextRotationAnglePropHdl_Impl::exportXML( if( bRet ) { OUStringBuffer aOut; - SvXMLUnitConverter::convertNumber( aOut, nAngle / 10 ); + ::sax::Converter::convertNumber( aOut, nAngle / 10 ); rStrExpValue = aOut.makeStringAndClear(); } OSL_ENSURE( bRet, "illegal rotation angle" ); @@ -1234,7 +1234,7 @@ sal_Bool XMLNumber8OneBasedHdl::importXML( const SvXMLUnitConverter& ) const { sal_Int32 nValue = 0; - sal_Bool bRet = SvXMLUnitConverter::convertNumber( nValue, rStrImpValue ); + bool const bRet = ::sax::Converter::convertNumber(nValue, rStrImpValue); if( bRet ) rValue <<= static_cast<sal_Int8>( nValue - 1 ); return bRet; @@ -1250,7 +1250,7 @@ sal_Bool XMLNumber8OneBasedHdl::exportXML( if( bRet ) { OUStringBuffer aOut; - SvXMLUnitConverter::convertNumber( aOut, nValue + 1 ); + ::sax::Converter::convertNumber( aOut, nValue + 1 ); rStrExpValue = aOut.makeStringAndClear(); } return bRet; diff --git a/xmloff/source/text/txtstyli.cxx b/xmloff/source/text/txtstyli.cxx index f99e35d404b9..84f4531cf026 100644 --- a/xmloff/source/text/txtstyli.cxx +++ b/xmloff/source/text/txtstyli.cxx @@ -49,6 +49,8 @@ #include <com/sun/star/style/ParagraphStyleCategory.hpp> #include <com/sun/star/style/XStyle.hpp> +#include <sax/tools/converter.hxx> + #include <tools/debug.hxx> #include <tools/diagnose_ex.h> @@ -117,7 +119,7 @@ void XMLTextStyleContext::SetAttribute( sal_uInt16 nPrefixKey, else if( IsXMLToken( rLocalName, XML_DEFAULT_OUTLINE_LEVEL ) ) { sal_Int32 nTmp; - if( SvXMLUnitConverter::convertNumber( nTmp, rValue ) && + if (::sax::Converter::convertNumber( nTmp, rValue ) && 0 <= nTmp && nTmp <= 10 ) nOutlineLevel = static_cast< sal_Int8 >( nTmp ); } diff --git a/xmloff/source/text/txtvfldi.cxx b/xmloff/source/text/txtvfldi.cxx index d3ade9a90d4f..34549cb1f151 100644 --- a/xmloff/source/text/txtvfldi.cxx +++ b/xmloff/source/text/txtvfldi.cxx @@ -52,9 +52,10 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/xml/sax/XAttributeList.hpp> -#ifndef _RTL_USTRING +#include <sax/tools/converter.hxx> + #include <rtl/ustring.hxx> -#endif + #include <tools/debug.hxx> @@ -885,7 +886,7 @@ XMLVariableDeclImportContext::XMLVariableDeclImportContext( case XML_TOK_TEXTFIELD_NUMBERING_LEVEL: { sal_Int32 nLevel; - sal_Bool bRet = SvXMLUnitConverter::convertNumber( + bool const bRet = ::sax::Converter::convertNumber( nLevel, xAttrList->getValueByIndex(i), 0, GetImport().GetTextImport()->GetChapterNumbering()-> getCount()); @@ -1341,7 +1342,7 @@ void XMLValueImportHelper::ProcessAttribute( case XML_TOK_TEXTFIELD_VALUE: { double fTmp; - sal_Bool bRet = SvXMLUnitConverter::convertDouble(fTmp,sAttrValue); + bool const bRet = ::sax::Converter::convertDouble(fTmp,sAttrValue); if (bRet) { bFloatValueOK = sal_True; fValue = fTmp; @@ -1374,8 +1375,8 @@ void XMLValueImportHelper::ProcessAttribute( case XML_TOK_TEXTFIELD_BOOL_VALUE: { - bool bTmp; - sal_Bool bRet = SvXMLUnitConverter::convertBool(bTmp,sAttrValue); + bool bTmp(false); + bool bRet = ::sax::Converter::convertBool(bTmp, sAttrValue); if (bRet) { bFloatValueOK = sal_True; fValue = (bTmp ? 1.0 : 0.0); @@ -1383,7 +1384,7 @@ void XMLValueImportHelper::ProcessAttribute( else { double fTmp; - bRet = SvXMLUnitConverter::convertDouble(fTmp,sAttrValue); + bRet = ::sax::Converter::convertDouble(fTmp, sAttrValue); if (bRet) { bFloatValueOK = sal_True; fValue = fTmp; diff --git a/xmloff/source/transform/OOo2Oasis.cxx b/xmloff/source/transform/OOo2Oasis.cxx index f94794ef4831..bbef198c4b92 100644 --- a/xmloff/source/transform/OOo2Oasis.cxx +++ b/xmloff/source/transform/OOo2Oasis.cxx @@ -31,6 +31,7 @@ #include <rtl/ustrbuf.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/servicehelper.hxx> +#include <sax/tools/converter.hxx> #include <xmloff/nmspmap.hxx> #include "xmloff/xmlnmspe.hxx" #include <xmloff/xmltoken.hxx> @@ -47,7 +48,6 @@ #include "AttrTransformerAction.hxx" #include "PropertyActionsOOo.hxx" #include "TransformerActions.hxx" -#include <xmloff/xmluconv.hxx> #include "OOo2Oasis.hxx" using ::rtl::OUString; @@ -1459,7 +1459,7 @@ void XMLTrackedChangesOOoTContext_Impl::StartElement( xPropSetInfo->hasPropertyByName( aPropName ) ) { Sequence < sal_Int8 > aKey; - SvXMLUnitConverter::decodeBase64( aKey, + ::sax::Converter::decodeBase64( aKey, xAttrList->getValueByIndex( i ) ); rPropSet->setPropertyValue( aPropName, makeAny( aKey ) ); } diff --git a/xmloff/source/transform/Oasis2OOo.cxx b/xmloff/source/transform/Oasis2OOo.cxx index 90765e472ca5..7c2f82f5f34f 100644 --- a/xmloff/source/transform/Oasis2OOo.cxx +++ b/xmloff/source/transform/Oasis2OOo.cxx @@ -30,6 +30,7 @@ #include "precompiled_xmloff.hxx" #include <com/sun/star/beans/XPropertySetInfo.hpp> #include <rtl/ustrbuf.hxx> +#include <sax/tools/converter.hxx> #include <xmloff/nmspmap.hxx> #include "xmloff/xmlnmspe.hxx" #include <xmloff/xmltoken.hxx> @@ -50,7 +51,6 @@ #include "AttrTransformerAction.hxx" #include "TransformerActions.hxx" #include "FamilyType.hxx" -#include <xmloff/xmluconv.hxx> #include <comphelper/servicehelper.hxx> #include "Oasis2OOo.hxx" @@ -1571,7 +1571,7 @@ void XMLConfigItemTContext_Impl::EndElement() xPropSetInfo->hasPropertyByName( aPropName ) ) { Sequence < sal_Int8 > aKey; - SvXMLUnitConverter::decodeBase64( aKey, m_aContent ); + ::sax::Converter::decodeBase64( aKey, m_aContent ); rPropSet->setPropertyValue( aPropName, makeAny( aKey ) ); } } @@ -1637,7 +1637,7 @@ void XMLTrackedChangesOASISTContext_Impl::StartElement( if( aKey.getLength() ) { OUStringBuffer aBuffer; - SvXMLUnitConverter::encodeBase64( aBuffer, aKey ); + ::sax::Converter::encodeBase64( aBuffer, aKey ); XMLMutableAttributeList *pMutableAttrList = new XMLMutableAttributeList( xAttrList ); xAttrList = pMutableAttrList; diff --git a/xmloff/source/transform/StyleOASISTContext.cxx b/xmloff/source/transform/StyleOASISTContext.cxx index b6e361f9754e..1823b47869ea 100644 --- a/xmloff/source/transform/StyleOASISTContext.cxx +++ b/xmloff/source/transform/StyleOASISTContext.cxx @@ -33,6 +33,7 @@ #include <com/sun/star/xml/sax/XDocumentHandler.hpp> #include <com/sun/star/xml/sax/XAttributeList.hpp> #include <rtl/ustrbuf.hxx> +#include <sax/tools/converter.hxx> #include <xmloff/nmspmap.hxx> #include <xmloff/xmltoken.hxx> #include "xmloff/xmlnmspe.hxx" @@ -46,7 +47,6 @@ #include "PropertyActionsOASIS.hxx" #include "StyleOASISTContext.hxx" #include <xmloff/xmluconv.hxx> -#include <rtl/ustrbuf.hxx> using ::rtl::OUString; using namespace ::xmloff::token; @@ -342,10 +342,10 @@ void XMLPropertiesTContext_Impl::StartElement( break; case XML_OPTACTION_INTERVAL_MAJOR: pAttrList->AddAttribute( rAttrName, rAttrValue ); - SvXMLUnitConverter::convertDouble( fIntervalMajor, rAttrValue ); + ::sax::Converter::convertDouble(fIntervalMajor, rAttrValue); break; case XML_OPTACTION_INTERVAL_MINOR_DIVISOR: - SvXMLUnitConverter::convertNumber( nIntervalMinorDivisor, rAttrValue ); + ::sax::Converter::convertNumber(nIntervalMinorDivisor, rAttrValue); bIntervalMinorFound = true; break; case XML_OPTACTION_SYMBOL_TYPE: @@ -472,12 +472,12 @@ void XMLPropertiesTContext_Impl::StartElement( if( aAttrValue.indexOf( sal_Unicode('%') ) != -1 ) { sal_Int32 nValue = 0; - SvXMLUnitConverter::convertPercent( nValue, rAttrValue ); + ::sax::Converter::convertPercent(nValue, rAttrValue); if( nValue ) { nValue *= 100; rtl::OUStringBuffer aOut; - SvXMLUnitConverter::convertPercent( aOut, nValue ); + ::sax::Converter::convertPercent(aOut, nValue); aAttrValue = aOut.makeStringAndClear(); } } @@ -545,7 +545,7 @@ void XMLPropertiesTContext_Impl::StartElement( case XML_ATACTION_GAMMA_OASIS: // converts percentage value to double { sal_Int32 nValue; - SvXMLUnitConverter::convertPercent( nValue, rAttrValue ); + ::sax::Converter::convertPercent( nValue, rAttrValue ); const double fValue = ((double)nValue) / 100.0; pAttrList->AddAttribute( rAttrName, OUString::valueOf( fValue ) ); } @@ -555,7 +555,7 @@ void XMLPropertiesTContext_Impl::StartElement( sal_Int32 nValue; if( rAttrValue.indexOf( sal_Unicode('%') ) != -1 ) { - SvXMLUnitConverter::convertPercent( nValue, rAttrValue ); + ::sax::Converter::convertPercent(nValue, rAttrValue); } else { @@ -564,7 +564,7 @@ void XMLPropertiesTContext_Impl::StartElement( nValue = 100 - nValue; rtl::OUStringBuffer aOut; - SvXMLUnitConverter::convertPercent( aOut, nValue ); + ::sax::Converter::convertPercent(aOut, nValue); pAttrList->AddAttribute( rAttrName, aOut.makeStringAndClear() ); } break; @@ -599,7 +599,7 @@ void XMLPropertiesTContext_Impl::StartElement( fIntervalMinor = fIntervalMajor / static_cast< double >( nIntervalMinorDivisor ); ::rtl::OUStringBuffer aBuf; - SvXMLUnitConverter::convertDouble( aBuf, fIntervalMinor ); + ::sax::Converter::convertDouble( aBuf, fIntervalMinor ); pAttrList->AddAttribute( GetTransformer().GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_CHART, diff --git a/xmloff/source/transform/StyleOOoTContext.cxx b/xmloff/source/transform/StyleOOoTContext.cxx index a357f2451f85..e52cc1d03ec3 100644 --- a/xmloff/source/transform/StyleOOoTContext.cxx +++ b/xmloff/source/transform/StyleOOoTContext.cxx @@ -32,6 +32,9 @@ #include <com/sun/star/xml/sax/SAXException.hpp> #include <com/sun/star/xml/sax/XDocumentHandler.hpp> #include <com/sun/star/xml/sax/XAttributeList.hpp> + +#include <sax/tools/converter.hxx> + #include <xmloff/nmspmap.hxx> #include <xmloff/xmltoken.hxx> #include "xmloff/xmlnmspe.hxx" @@ -721,10 +724,10 @@ void XMLPropertiesOOoTContext_Impl::StartElement( break; case XML_PTACTION_INTERVAL_MAJOR: pContext->AddAttribute( sAttrName, sAttrValue ); - SvXMLUnitConverter::convertDouble( fIntervalMajor, sAttrValue ); + ::sax::Converter::convertDouble( fIntervalMajor, sAttrValue ); break; case XML_PTACTION_INTERVAL_MINOR: - SvXMLUnitConverter::convertDouble( fIntervalMinor, sAttrValue ); + ::sax::Converter::convertDouble( fIntervalMinor, sAttrValue ); pIntervalMinorDivisorContext = pContext; break; case XML_PTACTION_SYMBOL: @@ -879,12 +882,12 @@ void XMLPropertiesOOoTContext_Impl::StartElement( if( aAttrValue.indexOf( sal_Unicode('%') ) != -1 ) { sal_Int32 nValue = 0; - SvXMLUnitConverter::convertPercent( nValue, sAttrValue ); + ::sax::Converter::convertPercent( nValue, sAttrValue ); if( nValue ) { nValue /= 100; rtl::OUStringBuffer aOut; - SvXMLUnitConverter::convertPercent( aOut, nValue ); + ::sax::Converter::convertPercent( aOut, nValue ); aAttrValue = aOut.makeStringAndClear(); } } @@ -953,7 +956,7 @@ void XMLPropertiesOOoTContext_Impl::StartElement( sal_Int32 nValue = (sal_Int32)((fValue * 100.0) + ( fValue > 0 ? 0.5 : - 0.5 ) ); rtl::OUStringBuffer aOut; - SvXMLUnitConverter::convertPercent( aOut, nValue ); + ::sax::Converter::convertPercent( aOut, nValue ); OUString aAttrValue( aOut.makeStringAndClear() ); pContext->AddAttribute( sAttrName, aAttrValue ); } @@ -963,7 +966,7 @@ void XMLPropertiesOOoTContext_Impl::StartElement( sal_Int32 nValue; if( sAttrValue.indexOf( sal_Unicode('%') ) != -1 ) { - SvXMLUnitConverter::convertPercent( nValue, sAttrValue ); + ::sax::Converter::convertPercent( nValue, sAttrValue ); } else { @@ -972,7 +975,7 @@ void XMLPropertiesOOoTContext_Impl::StartElement( nValue = 100 - nValue; rtl::OUStringBuffer aOut; - SvXMLUnitConverter::convertPercent( aOut, nValue ); + ::sax::Converter::convertPercent( aOut, nValue ); pContext->AddAttribute( sAttrName, aOut.makeStringAndClear() ); } break; @@ -1030,7 +1033,7 @@ void XMLPropertiesOOoTContext_Impl::StartElement( ::rtl::math::round( fIntervalMajor / fIntervalMinor )); ::rtl::OUStringBuffer aBuf; - SvXMLUnitConverter::convertNumber( aBuf, nIntervalMinorDivisor ); + ::sax::Converter::convertNumber( aBuf, nIntervalMinorDivisor ); pIntervalMinorDivisorContext->AddAttribute( GetTransformer().GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_CHART, 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>; |