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 /sc | |
parent | 02c32e0f0e75a9df80888051d1ec189fa14129bd (diff) |
#i108468#: clean up xmluconv code duplication, part 1:
move convertNumber64 from SvXMLUnitConverter to sax::converter.
remove duplicate methods from SvXMLUnitConverter:
convertBool, convertPercent, convertColor, convertNumber, convertDouble,
indexOfComma, encodeBase64, decodeBase64, decodeBase64SomeChars,
clearUndefinedChars
Diffstat (limited to 'sc')
24 files changed, 161 insertions, 114 deletions
diff --git a/sc/CppunitTest_sc_filters_test.mk b/sc/CppunitTest_sc_filters_test.mk index 3fc42c202618..d6ea1b8b1eb7 100644 --- a/sc/CppunitTest_sc_filters_test.mk +++ b/sc/CppunitTest_sc_filters_test.mk @@ -51,6 +51,7 @@ $(eval $(call gb_CppunitTest_add_linked_libs,sc_filters_test, \ oox \ sal \ salhelper \ + sax \ sb \ sc \ sfx \ diff --git a/sc/CppunitTest_sc_ucalc.mk b/sc/CppunitTest_sc_ucalc.mk index 08f0ed80dd0c..fe853cc5fb68 100644 --- a/sc/CppunitTest_sc_ucalc.mk +++ b/sc/CppunitTest_sc_ucalc.mk @@ -56,6 +56,7 @@ $(eval $(call gb_CppunitTest_add_linked_libs,sc_ucalc, \ i18nisolang1 \ sal \ salhelper \ + sax \ sb \ sfx \ sot \ diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk index 2d8620895f16..a1671f86f598 100644 --- a/sc/Library_sc.mk +++ b/sc/Library_sc.mk @@ -62,6 +62,7 @@ $(eval $(call gb_Library_add_linked_libs,sc,\ i18nisolang1 \ sal \ salhelper \ + sax \ sb \ sfx \ sot \ diff --git a/sc/source/filter/xml/XMLCalculationSettingsContext.cxx b/sc/source/filter/xml/XMLCalculationSettingsContext.cxx index e5e8bb8c3630..fd7f45387e89 100644 --- a/sc/source/filter/xml/XMLCalculationSettingsContext.cxx +++ b/sc/source/filter/xml/XMLCalculationSettingsContext.cxx @@ -41,6 +41,7 @@ #include <xmloff/xmlnmspe.hxx> #include <xmloff/xmluconv.hxx> #include <xmloff/nmspmap.hxx> +#include <sax/tools/converter.hxx> #include <com/sun/star/sheet/XSpreadsheetDocument.hpp> #include <comphelper/extract.hxx> @@ -102,7 +103,7 @@ ScXMLCalculationSettingsContext::ScXMLCalculationSettingsContext( ScXMLImport& r else if (IsXMLToken(aLocalName, XML_NULL_YEAR)) { sal_Int32 nTemp; - GetScImport().GetMM100UnitConverter().convertNumber(nTemp, sValue); + ::sax::Converter::convertNumber(nTemp, sValue); nYear2000 = static_cast<sal_uInt16>(nTemp); } else if (IsXMLToken(aLocalName, XML_USE_REGULAR_EXPRESSIONS)) @@ -241,13 +242,13 @@ ScXMLIterationContext::ScXMLIterationContext( ScXMLImport& rImport, else if (IsXMLToken(aLocalName, XML_STEPS)) { sal_Int32 nSteps; - GetScImport().GetMM100UnitConverter().convertNumber(nSteps, sValue); + ::sax::Converter::convertNumber(nSteps, sValue); pCalcSet->SetIterationCount(nSteps); } else if (IsXMLToken(aLocalName, XML_MAXIMUM_DIFFERENCE)) { double fDif; - GetScImport().GetMM100UnitConverter().convertDouble(fDif, sValue); + ::sax::Converter::convertDouble(fDif, sValue); pCalcSet->SetIterationEpsilon(fDif); } } diff --git a/sc/source/filter/xml/XMLCellRangeSourceContext.cxx b/sc/source/filter/xml/XMLCellRangeSourceContext.cxx index b7a05b59053e..c6f8c4244869 100644 --- a/sc/source/filter/xml/XMLCellRangeSourceContext.cxx +++ b/sc/source/filter/xml/XMLCellRangeSourceContext.cxx @@ -33,6 +33,9 @@ //___________________________________________________________________ #include "XMLCellRangeSourceContext.hxx" + +#include <sax/tools/converter.hxx> + #include <xmloff/nmspmap.hxx> #include <xmloff/xmluconv.hxx> #include "xmlimprt.hxx" @@ -90,7 +93,7 @@ ScXMLCellRangeSourceContext::ScXMLCellRangeSourceContext( case XML_TOK_TABLE_CELL_RANGE_SOURCE_ATTR_LAST_COLUMN: { sal_Int32 nValue; - if( SvXMLUnitConverter::convertNumber( nValue, sValue, 1 ) ) + if (::sax::Converter::convertNumber( nValue, sValue, 1 )) pCellRangeSource->nColumns = nValue; else pCellRangeSource->nColumns = 1; @@ -99,7 +102,7 @@ ScXMLCellRangeSourceContext::ScXMLCellRangeSourceContext( case XML_TOK_TABLE_CELL_RANGE_SOURCE_ATTR_LAST_ROW: { sal_Int32 nValue; - if( SvXMLUnitConverter::convertNumber( nValue, sValue, 1 ) ) + if (::sax::Converter::convertNumber( nValue, sValue, 1 )) pCellRangeSource->nRows = nValue; else pCellRangeSource->nRows = 1; diff --git a/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx b/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx index 06d5ae419990..2eb6641cefab 100644 --- a/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx +++ b/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx @@ -40,6 +40,7 @@ #include <xmloff/xmlnmspe.hxx> #include <xmloff/nmspmap.hxx> #include <xmloff/xmluconv.hxx> +#include <sax/tools/converter.hxx> #include <com/sun/star/util/DateTime.hpp> #include <tools/datetime.hxx> #include <svl/zforlist.hxx> @@ -69,7 +70,8 @@ ScChangeTrackingExportHelper::~ScChangeTrackingExportHelper() rtl::OUString ScChangeTrackingExportHelper::GetChangeID(const sal_uInt32 nActionNumber) { rtl::OUStringBuffer sBuffer(sChangeIDPrefix); - SvXMLUnitConverter::convertNumber(sBuffer, static_cast<sal_Int32>(nActionNumber)); + ::sax::Converter::convertNumber(sBuffer, + static_cast<sal_Int32>(nActionNumber)); return sBuffer.makeStringAndClear(); } @@ -94,27 +96,27 @@ void ScChangeTrackingExportHelper::WriteBigRange(const ScBigRange& rBigRange, XM if ((nStartColumn == nEndColumn) && (nStartRow == nEndRow) && (nStartSheet == nEndSheet)) { rtl::OUStringBuffer sBuffer; - SvXMLUnitConverter::convertNumber(sBuffer, nStartColumn); + ::sax::Converter::convertNumber(sBuffer, nStartColumn); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_COLUMN, sBuffer.makeStringAndClear()); - SvXMLUnitConverter::convertNumber(sBuffer, nStartRow); + ::sax::Converter::convertNumber(sBuffer, nStartRow); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_ROW, sBuffer.makeStringAndClear()); - SvXMLUnitConverter::convertNumber(sBuffer, nStartSheet); + ::sax::Converter::convertNumber(sBuffer, nStartSheet); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TABLE, sBuffer.makeStringAndClear()); } else { rtl::OUStringBuffer sBuffer; - SvXMLUnitConverter::convertNumber(sBuffer, nStartColumn); + ::sax::Converter::convertNumber(sBuffer, nStartColumn); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_START_COLUMN, sBuffer.makeStringAndClear()); - SvXMLUnitConverter::convertNumber(sBuffer, nStartRow); + ::sax::Converter::convertNumber(sBuffer, nStartRow); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_START_ROW, sBuffer.makeStringAndClear()); - SvXMLUnitConverter::convertNumber(sBuffer, nStartSheet); + ::sax::Converter::convertNumber(sBuffer, nStartSheet); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_START_TABLE, sBuffer.makeStringAndClear()); - SvXMLUnitConverter::convertNumber(sBuffer, nEndColumn); + ::sax::Converter::convertNumber(sBuffer, nEndColumn); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_END_COLUMN, sBuffer.makeStringAndClear()); - SvXMLUnitConverter::convertNumber(sBuffer, nEndRow); + ::sax::Converter::convertNumber(sBuffer, nEndRow); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_END_ROW, sBuffer.makeStringAndClear()); - SvXMLUnitConverter::convertNumber(sBuffer, nEndSheet); + ::sax::Converter::convertNumber(sBuffer, nEndSheet); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_END_TABLE, sBuffer.makeStringAndClear()); } SvXMLElementExport aBigRangeElem(rExport, XML_NAMESPACE_TABLE, aName, true, true); @@ -277,7 +279,7 @@ void ScChangeTrackingExportHelper::SetValueAttributes(const double& fValue, cons { rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_FLOAT); rtl::OUStringBuffer sBuffer; - SvXMLUnitConverter::convertDouble(sBuffer, fValue); + ::sax::Converter::convertDouble(sBuffer, fValue); rtl::OUString sNumValue(sBuffer.makeStringAndClear()); if (sNumValue.getLength()) rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE, sNumValue); @@ -362,8 +364,8 @@ void ScChangeTrackingExportHelper::WriteFormulaCell(const ScBaseCell* pCell, con pFormulaCell->GetMatColsRows(nColumns, nRows); rtl::OUStringBuffer sColumns; rtl::OUStringBuffer sRows; - SvXMLUnitConverter::convertNumber(sColumns, static_cast<sal_Int32>(nColumns)); - SvXMLUnitConverter::convertNumber(sRows, static_cast<sal_Int32>(nRows)); + ::sax::Converter::convertNumber(sColumns, static_cast<sal_Int32>(nColumns)); + ::sax::Converter::convertNumber(sRows, static_cast<sal_Int32>(nRows)); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_MATRIX_COLUMNS_SPANNED, sColumns.makeStringAndClear()); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_MATRIX_ROWS_SPANNED, sRows.makeStringAndClear()); } @@ -498,17 +500,17 @@ void ScChangeTrackingExportHelper::AddInsertionAttributes(const ScChangeAction* nPosition = nStartPosition; nCount = nEndPosition - nStartPosition + 1; rtl::OUStringBuffer sBuffer; - SvXMLUnitConverter::convertNumber(sBuffer, nPosition); + ::sax::Converter::convertNumber(sBuffer, nPosition); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_POSITION, sBuffer.makeStringAndClear()); OSL_ENSURE(nCount > 0, "wrong insertion count"); if (nCount > 1) { - SvXMLUnitConverter::convertNumber(sBuffer, nCount); + ::sax::Converter::convertNumber(sBuffer, nCount); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_COUNT, sBuffer.makeStringAndClear()); } if (pConstAction->GetType() != SC_CAT_INSERT_TABS) { - SvXMLUnitConverter::convertNumber(sBuffer, nStartSheet); + ::sax::Converter::convertNumber(sBuffer, nStartSheet); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TABLE, sBuffer.makeStringAndClear()); } } @@ -560,11 +562,11 @@ void ScChangeTrackingExportHelper::AddDeletionAttributes(const ScChangeActionDel break; } rtl::OUStringBuffer sBuffer; - SvXMLUnitConverter::convertNumber(sBuffer, nPosition); + ::sax::Converter::convertNumber(sBuffer, nPosition); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_POSITION, sBuffer.makeStringAndClear()); if (pDelAction->GetType() != SC_CAT_DELETE_TABS) { - SvXMLUnitConverter::convertNumber(sBuffer, nStartSheet); + ::sax::Converter::convertNumber(sBuffer, nStartSheet); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TABLE, sBuffer.makeStringAndClear()); if (pDelAction->IsMultiDelete() && !pDelAction->GetDx() && !pDelAction->GetDy()) { @@ -589,7 +591,7 @@ void ScChangeTrackingExportHelper::AddDeletionAttributes(const ScChangeActionDel } } - SvXMLUnitConverter::convertNumber(sBuffer, nSlavesCount); + ::sax::Converter::convertNumber(sBuffer, nSlavesCount); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_MULTI_DELETION_SPANNED, sBuffer.makeStringAndClear()); } } @@ -606,7 +608,8 @@ void ScChangeTrackingExportHelper::WriteCutOffs(const ScChangeActionDel* pAction if (pCutOffIns) { rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_ID, GetChangeID(pCutOffIns->GetActionNumber())); - SvXMLUnitConverter::convertNumber(sBuffer, static_cast<sal_Int32>(pAction->GetCutOffCount())); + ::sax::Converter::convertNumber(sBuffer, + static_cast<sal_Int32>(pAction->GetCutOffCount())); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_POSITION, sBuffer.makeStringAndClear()); SvXMLElementExport aInsertCutOffElem (rExport, XML_NAMESPACE_TABLE, XML_INSERTION_CUT_OFF, true, true); } @@ -615,14 +618,17 @@ void ScChangeTrackingExportHelper::WriteCutOffs(const ScChangeActionDel* pAction rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_ID, GetChangeID(pLinkMove->GetAction()->GetActionNumber())); if (pLinkMove->GetCutOffFrom() == pLinkMove->GetCutOffTo()) { - SvXMLUnitConverter::convertNumber(sBuffer, static_cast<sal_Int32>(pLinkMove->GetCutOffFrom())); + ::sax::Converter::convertNumber(sBuffer, + static_cast<sal_Int32>(pLinkMove->GetCutOffFrom())); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_POSITION, sBuffer.makeStringAndClear()); } else { - SvXMLUnitConverter::convertNumber(sBuffer, static_cast<sal_Int32>(pLinkMove->GetCutOffFrom())); + ::sax::Converter::convertNumber(sBuffer, + static_cast<sal_Int32>(pLinkMove->GetCutOffFrom())); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_START_POSITION, sBuffer.makeStringAndClear()); - SvXMLUnitConverter::convertNumber(sBuffer, static_cast<sal_Int32>(pLinkMove->GetCutOffTo())); + ::sax::Converter::convertNumber(sBuffer, + static_cast<sal_Int32>(pLinkMove->GetCutOffTo())); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_END_POSITION, sBuffer.makeStringAndClear()); } SvXMLElementExport aMoveCutOffElem (rExport, XML_NAMESPACE_TABLE, XML_MOVEMENT_CUT_OFF, true, true); diff --git a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx index 04ff68fc9ebf..d5259697fbb9 100644 --- a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx +++ b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx @@ -36,7 +36,7 @@ #include "rangeutl.hxx" #include <tools/datetime.hxx> #include <svl/zforlist.hxx> -#include <xmloff/xmluconv.hxx> +#include <sax/tools/converter.hxx> #define SC_CHANGE_ID_PREFIX "ct" @@ -271,7 +271,7 @@ sal_uInt32 ScXMLChangeTrackingImportHelper::GetIDFromString(const rtl::OUString& { rtl::OUString sValue(sID.copy(nPrefixLength, nLength - nPrefixLength)); sal_Int32 nValue; - SvXMLUnitConverter::convertNumber(nValue, sValue); + ::sax::Converter::convertNumber(nValue, sValue); OSL_ENSURE(nValue > 0, "wrong change action ID"); nResult = nValue; } diff --git a/sc/source/filter/xml/XMLDDELinksContext.cxx b/sc/source/filter/xml/XMLDDELinksContext.cxx index e43503c927ba..8c6ac75aa60d 100644 --- a/sc/source/filter/xml/XMLDDELinksContext.cxx +++ b/sc/source/filter/xml/XMLDDELinksContext.cxx @@ -39,7 +39,7 @@ #include <xmloff/xmltoken.hxx> #include <xmloff/xmlnmspe.hxx> #include <xmloff/nmspmap.hxx> -#include <xmloff/xmluconv.hxx> +#include <sax/tools/converter.hxx> using namespace com::sun::star; using namespace xmloff::token; @@ -332,7 +332,9 @@ ScXMLDDEColumnContext::ScXMLDDEColumnContext( ScXMLImport& rImport, if (nPrefix == XML_NAMESPACE_TABLE) if (IsXMLToken(aLocalName, XML_NUMBER_COLUMNS_REPEATED)) - GetScImport().GetMM100UnitConverter().convertNumber(nCols, sValue); + { + ::sax::Converter::convertNumber(nCols, sValue); + } } pDDELink->AddColumns(nCols); } @@ -378,7 +380,9 @@ ScXMLDDERowContext::ScXMLDDERowContext( ScXMLImport& rImport, if (nPrefix == XML_NAMESPACE_TABLE) if (IsXMLToken(aLocalName, XML_NUMBER_ROWS_REPEATED)) - GetScImport().GetMM100UnitConverter().convertNumber(nRows, sValue); + { + ::sax::Converter::convertNumber(nRows, sValue); + } } pDDELink->AddRows(nRows); } @@ -452,7 +456,7 @@ ScXMLDDECellContext::ScXMLDDECellContext( ScXMLImport& rImport, } else if (IsXMLToken(aLocalName, XML_VALUE)) { - GetScImport().GetMM100UnitConverter().convertDouble(fValue, sTempValue); + ::sax::Converter::convertDouble(fValue, sTempValue); bEmpty = false; bString2 = false; } @@ -460,7 +464,9 @@ ScXMLDDECellContext::ScXMLDDECellContext( ScXMLImport& rImport, else if (nPrefix == XML_NAMESPACE_TABLE) { if (IsXMLToken(aLocalName, XML_NUMBER_COLUMNS_REPEATED)) - GetScImport().GetMM100UnitConverter().convertNumber(nCells, sTempValue); + { + ::sax::Converter::convertNumber(nCells, sTempValue); + } } } } diff --git a/sc/source/filter/xml/XMLDetectiveContext.cxx b/sc/source/filter/xml/XMLDetectiveContext.cxx index a0b1d2f434d3..d7c2b54b3266 100644 --- a/sc/source/filter/xml/XMLDetectiveContext.cxx +++ b/sc/source/filter/xml/XMLDetectiveContext.cxx @@ -33,9 +33,10 @@ //___________________________________________________________________ #include "XMLDetectiveContext.hxx" + +#include <sax/tools/converter.hxx> #include <xmloff/nmspmap.hxx> #include <xmloff/xmltoken.hxx> -#include <xmloff/xmluconv.hxx> #include "convuno.hxx" #include "xmlimprt.hxx" #include "XMLConverter.hxx" @@ -236,7 +237,7 @@ ScXMLDetectiveOperationContext::ScXMLDetectiveOperationContext( case XML_TOK_DETECTIVE_OPERATION_ATTR_INDEX: { sal_Int32 nValue; - if( SvXMLUnitConverter::convertNumber( nValue, sValue, 0 ) ) + if (::sax::Converter::convertNumber( nValue, sValue, 0 )) aDetectiveOp.nIndex = nValue; } break; diff --git a/sc/source/filter/xml/XMLExportDDELinks.cxx b/sc/source/filter/xml/XMLExportDDELinks.cxx index 5c7cd285e567..ea54b0126284 100644 --- a/sc/source/filter/xml/XMLExportDDELinks.cxx +++ b/sc/source/filter/xml/XMLExportDDELinks.cxx @@ -34,7 +34,7 @@ #include <xmloff/xmltoken.hxx> #include <xmloff/xmlnmspe.hxx> #include <xmloff/nmspmap.hxx> -#include <xmloff/xmluconv.hxx> +#include <sax/tools/converter.hxx> #include "xmlexprt.hxx" #include "unonames.hxx" #include "document.hxx" @@ -89,7 +89,7 @@ void ScXMLExportDDELinks::WriteCell(const ScMatrixValue& aVal, sal_Int32 nRepeat { OUStringBuffer aBuf; rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_FLOAT); - rExport.GetMM100UnitConverter().convertDouble(aBuf, aVal.fVal); + ::sax::Converter::convertDouble(aBuf, aVal.fVal); rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE, aBuf.makeStringAndClear()); } } @@ -97,7 +97,7 @@ void ScXMLExportDDELinks::WriteCell(const ScMatrixValue& aVal, sal_Int32 nRepeat if (nRepeat > 1) { OUStringBuffer aBuf; - rExport.GetMM100UnitConverter().convertNumber(aBuf, nRepeat); + ::sax::Converter::convertNumber(aBuf, nRepeat); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_COLUMNS_REPEATED, aBuf.makeStringAndClear()); } SvXMLElementExport(rExport, XML_NAMESPACE_TABLE, XML_TABLE_CELL, true, true); @@ -120,7 +120,7 @@ void ScXMLExportDDELinks::WriteTable(const sal_Int32 nPos) if (nCols > 1) { OUStringBuffer aBuf; - rExport.GetMM100UnitConverter().convertNumber(aBuf, static_cast<sal_Int32>(nCols)); + ::sax::Converter::convertNumber(aBuf, static_cast<sal_Int32>(nCols)); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_COLUMNS_REPEATED, aBuf.makeStringAndClear()); } { diff --git a/sc/source/filter/xml/XMLExportDataPilot.cxx b/sc/source/filter/xml/XMLExportDataPilot.cxx index 81980443d3cc..844b9fcd2bbd 100644 --- a/sc/source/filter/xml/XMLExportDataPilot.cxx +++ b/sc/source/filter/xml/XMLExportDataPilot.cxx @@ -35,6 +35,7 @@ #include <xmloff/xmlnmspe.hxx> #include <xmloff/xmluconv.hxx> #include <xmloff/nmspmap.hxx> +#include <sax/tools/converter.hxx> #include <rtl/math.hxx> #include "xmlexprt.hxx" #include "XMLConverter.hxx" @@ -397,7 +398,7 @@ void ScXMLExportDataPilot::WriteAutoShowInfo(ScDPSaveDimension* pDim) rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY_MEMBER_MODE, sValueStr); rtl::OUStringBuffer sBuffer; - SvXMLUnitConverter::convertNumber(sBuffer, pAutoInfo->ItemCount); + ::sax::Converter::convertNumber(sBuffer, pAutoInfo->ItemCount); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_MEMBER_COUNT, sBuffer.makeStringAndClear()); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DATA_FIELD, pAutoInfo->DataField); @@ -482,9 +483,9 @@ void ScXMLExportDataPilot::WriteMembers(ScDPSaveDimension* pDim) } rtl::OUStringBuffer sBuffer; - SvXMLUnitConverter::convertBool(sBuffer, (*i)->GetIsVisible()); + ::sax::Converter::convertBool(sBuffer, (*i)->GetIsVisible()); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY, sBuffer.makeStringAndClear()); - SvXMLUnitConverter::convertBool(sBuffer, (*i)->GetShowDetails()); + ::sax::Converter::convertBool(sBuffer, (*i)->GetShowDetails()); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_SHOW_DETAILS, sBuffer.makeStringAndClear()); SvXMLElementExport aElemDPM(rExport, XML_NAMESPACE_TABLE, XML_DATA_PILOT_MEMBER, true, true); rExport.CheckAttrList(); @@ -498,7 +499,7 @@ void ScXMLExportDataPilot::WriteLevels(ScDPSaveDimension* pDim) if (pDim->HasShowEmpty()) { rtl::OUStringBuffer sBuffer; - SvXMLUnitConverter::convertBool(sBuffer, pDim->GetShowEmpty()); + ::sax::Converter::convertBool(sBuffer, pDim->GetShowEmpty()); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_SHOW_EMPTY, sBuffer.makeStringAndClear()); } SvXMLElementExport aElemDPL(rExport, XML_NAMESPACE_TABLE, XML_DATA_PILOT_LEVEL, true, true); @@ -703,7 +704,7 @@ void ScXMLExportDataPilot::WriteDimension(ScDPSaveDimension* pDim, const ScDPDim if (pDim->GetUsedHierarchy() != 1) { rtl::OUStringBuffer sBuffer; - SvXMLUnitConverter::convertNumber(sBuffer, pDim->GetUsedHierarchy()); + ::sax::Converter::convertNumber(sBuffer, pDim->GetUsedHierarchy()); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_USED_HIERARCHY, sBuffer.makeStringAndClear()); } ScXMLConverter::GetStringFromFunction( sValueStr, diff --git a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx index c7b9f6bde9c1..21a5513e90e1 100644 --- a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx +++ b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx @@ -37,6 +37,7 @@ #include <xmloff/xmlnmspe.hxx> #include <xmloff/xmluconv.hxx> #include <xmloff/nmspmap.hxx> +#include <sax/tools/converter.hxx> #include "xmlexprt.hxx" #include "XMLExportIterator.hxx" #include "XMLConverter.hxx" @@ -274,7 +275,7 @@ void ScXMLExportDatabaseRanges::WriteCondition(const sheet::TableFilterField2& a { rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DATA_TYPE, XML_NUMBER); rtl::OUStringBuffer sBuffer; - rExport.GetMM100UnitConverter().convertDouble(sBuffer, aFilterField.NumericValue); + ::sax::Converter::convertDouble(sBuffer, aFilterField.NumericValue); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_VALUE, sBuffer.makeStringAndClear()); } else @@ -888,7 +889,7 @@ private: { mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DATA_TYPE, XML_NUMBER); OUStringBuffer aBuf; - mrExport.GetMM100UnitConverter().convertDouble(aBuf, rEntry.nVal); + ::sax::Converter::convertDouble(aBuf, rEntry.nVal); mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_VALUE, aBuf.makeStringAndClear()); } diff --git a/sc/source/filter/xml/XMLTrackedChangesContext.cxx b/sc/source/filter/xml/XMLTrackedChangesContext.cxx index 18591f7517f9..c6c0b47272d3 100644 --- a/sc/source/filter/xml/XMLTrackedChangesContext.cxx +++ b/sc/source/filter/xml/XMLTrackedChangesContext.cxx @@ -40,6 +40,7 @@ #include <xmloff/xmlnmspe.hxx> #include <xmloff/nmspmap.hxx> #include <xmloff/xmluconv.hxx> +#include <sax/tools/converter.hxx> #include <svl/zforlist.hxx> #include <com/sun/star/text/XTextCursor.hpp> #include <com/sun/star/text/ControlCharacter.hpp> @@ -567,7 +568,7 @@ ScXMLTrackedChangesContext::ScXMLTrackedChangesContext( ScXMLImport& rImport, if (sValue.getLength()) { uno::Sequence<sal_Int8> aPass; - SvXMLUnitConverter::decodeBase64(aPass, sValue); + ::sax::Converter::decodeBase64(aPass, sValue); pChangeTrackingImportHelper->SetProtection(aPass); } } @@ -729,31 +730,31 @@ ScXMLBigRangeContext::ScXMLBigRangeContext( ScXMLImport& rImport, { if (IsXMLToken(aLocalName, XML_COLUMN)) { - SvXMLUnitConverter::convertNumber(nColumn, sValue); + ::sax::Converter::convertNumber(nColumn, sValue); bColumn = sal_True; } else if (IsXMLToken(aLocalName, XML_ROW)) { - SvXMLUnitConverter::convertNumber(nRow, sValue); + ::sax::Converter::convertNumber(nRow, sValue); bRow = sal_True; } else if (IsXMLToken(aLocalName, XML_TABLE)) { - SvXMLUnitConverter::convertNumber(nTable, sValue); + ::sax::Converter::convertNumber(nTable, sValue); bTable = sal_True; } else if (IsXMLToken(aLocalName, XML_START_COLUMN)) - SvXMLUnitConverter::convertNumber(nStartColumn, sValue); + ::sax::Converter::convertNumber(nStartColumn, sValue); else if (IsXMLToken(aLocalName, XML_END_COLUMN)) - SvXMLUnitConverter::convertNumber(nEndColumn, sValue); + ::sax::Converter::convertNumber(nEndColumn, sValue); else if (IsXMLToken(aLocalName, XML_START_ROW)) - SvXMLUnitConverter::convertNumber(nStartRow, sValue); + ::sax::Converter::convertNumber(nStartRow, sValue); else if (IsXMLToken(aLocalName, XML_END_ROW)) - SvXMLUnitConverter::convertNumber(nEndRow, sValue); + ::sax::Converter::convertNumber(nEndRow, sValue); else if (IsXMLToken(aLocalName, XML_START_TABLE)) - SvXMLUnitConverter::convertNumber(nStartTable, sValue); + ::sax::Converter::convertNumber(nStartTable, sValue); else if (IsXMLToken(aLocalName, XML_END_TABLE)) - SvXMLUnitConverter::convertNumber(nEndTable, sValue); + ::sax::Converter::convertNumber(nEndTable, sValue); } } if (bColumn) @@ -1162,12 +1163,12 @@ ScXMLChangeCellContext::ScXMLChangeCellContext( ScXMLImport& rImport, else if (IsXMLToken(aLocalName, XML_NUMBER_MATRIX_COLUMNS_SPANNED)) { bIsMatrix = sal_True; - SvXMLUnitConverter::convertNumber(nMatrixCols, sValue); + ::sax::Converter::convertNumber(nMatrixCols, sValue); } else if (IsXMLToken(aLocalName, XML_NUMBER_MATRIX_ROWS_SPANNED)) { bIsMatrix = sal_True; - SvXMLUnitConverter::convertNumber(nMatrixRows, sValue); + ::sax::Converter::convertNumber(nMatrixRows, sValue); } } else if (nPrefix == XML_NAMESPACE_OFFICE) @@ -1189,7 +1190,7 @@ ScXMLChangeCellContext::ScXMLChangeCellContext( ScXMLImport& rImport, } else if (IsXMLToken(aLocalName, XML_VALUE)) { - SvXMLUnitConverter::convertDouble(fValue, sValue); + ::sax::Converter::convertDouble(fValue, sValue); bEmpty = false; } else if (IsXMLToken(aLocalName, XML_DATE_VALUE)) @@ -1512,15 +1513,15 @@ ScXMLInsertionContext::ScXMLInsertionContext( ScXMLImport& rImport, } else if (IsXMLToken(aLocalName, XML_POSITION)) { - SvXMLUnitConverter::convertNumber(nPosition, sValue); + ::sax::Converter::convertNumber(nPosition, sValue); } else if (IsXMLToken(aLocalName, XML_TABLE)) { - SvXMLUnitConverter::convertNumber(nTable, sValue); + ::sax::Converter::convertNumber(nTable, sValue); } else if (IsXMLToken(aLocalName, XML_COUNT)) { - SvXMLUnitConverter::convertNumber(nCount, sValue); + ::sax::Converter::convertNumber(nCount, sValue); } } } @@ -1593,7 +1594,7 @@ ScXMLInsertionCutOffContext::ScXMLInsertionCutOffContext( ScXMLImport& rImport, } else if (IsXMLToken(aLocalName, XML_POSITION)) { - SvXMLUnitConverter::convertNumber(nPosition, sValue); + ::sax::Converter::convertNumber(nPosition, sValue); } } } @@ -1647,15 +1648,15 @@ ScXMLMovementCutOffContext::ScXMLMovementCutOffContext( ScXMLImport& rImport, else if (IsXMLToken(aLocalName, XML_POSITION)) { bPosition = sal_True; - SvXMLUnitConverter::convertNumber(nPosition, sValue); + ::sax::Converter::convertNumber(nPosition, sValue); } else if (IsXMLToken(aLocalName, XML_START_POSITION)) { - SvXMLUnitConverter::convertNumber(nStartPosition, sValue); + ::sax::Converter::convertNumber(nStartPosition, sValue); } else if (IsXMLToken(aLocalName, XML_END_POSITION)) { - SvXMLUnitConverter::convertNumber(nEndPosition, sValue); + ::sax::Converter::convertNumber(nEndPosition, sValue); } } } @@ -1775,15 +1776,15 @@ ScXMLDeletionContext::ScXMLDeletionContext( ScXMLImport& rImport, } else if (IsXMLToken(aLocalName, XML_POSITION)) { - SvXMLUnitConverter::convertNumber(nPosition, sValue); + ::sax::Converter::convertNumber(nPosition, sValue); } else if (IsXMLToken(aLocalName, XML_TABLE)) { - SvXMLUnitConverter::convertNumber(nTable, sValue); + ::sax::Converter::convertNumber(nTable, sValue); } else if (IsXMLToken(aLocalName, XML_MULTI_DELETION_SPANNED)) { - SvXMLUnitConverter::convertNumber(nMultiSpanned, sValue); + ::sax::Converter::convertNumber(nMultiSpanned, sValue); } } } diff --git a/sc/source/filter/xml/xmlbodyi.cxx b/sc/source/filter/xml/xmlbodyi.cxx index 9fe2a64c5dea..cb8de57cf62d 100644 --- a/sc/source/filter/xml/xmlbodyi.cxx +++ b/sc/source/filter/xml/xmlbodyi.cxx @@ -58,7 +58,8 @@ #include <xmloff/xmltoken.hxx> #include <xmloff/xmlnmspe.hxx> #include <xmloff/nmspmap.hxx> -#include <xmloff/xmluconv.hxx> + +#include <sax/tools/converter.hxx> #include <com/sun/star/sheet/XSpreadsheetDocument.hpp> #include <sal/types.h> @@ -283,7 +284,7 @@ void ScXMLBodyContext::EndElement() uno::Sequence<sal_Int8> aPass; if (sPassword.getLength()) { - SvXMLUnitConverter::decodeBase64(aPass, sPassword); + ::sax::Converter::decodeBase64(aPass, sPassword); pProtection->setPasswordHash(aPass, meHash1, meHash2); } diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index 507f3ec8d1ec..4ba69c00c21a 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -69,6 +69,7 @@ #include <editeng/editobj.hxx> #include <svx/unoapi.hxx> #include <svl/languageoptions.hxx> +#include <sax/tools/converter.hxx> #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/text/XText.hpp> @@ -180,7 +181,7 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport, { if (sValue.getLength()) { - rXMLImport.GetMM100UnitConverter().convertDouble(fValue, sValue); + ::sax::Converter::convertDouble(fValue, sValue); bIsEmpty = false; } } @@ -222,7 +223,7 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport, else if ( IsXMLToken(sValue, XML_FALSE) ) fValue = 0.0; else - rXMLImport.GetMM100UnitConverter().convertDouble(fValue, sValue); + ::sax::Converter::convertDouble(fValue, sValue); bIsEmpty = false; } } diff --git a/sc/source/filter/xml/xmldpimp.cxx b/sc/source/filter/xml/xmldpimp.cxx index 210a6f5dc7ee..b86acdbe90a9 100644 --- a/sc/source/filter/xml/xmldpimp.cxx +++ b/sc/source/filter/xml/xmldpimp.cxx @@ -53,6 +53,8 @@ #include <xmloff/xmltoken.hxx> #include <xmloff/xmlnmspe.hxx> #include <xmloff/xmluconv.hxx> +#include <sax/tools/converter.hxx> + #include <com/sun/star/sheet/DataPilotFieldReferenceType.hpp> #include <com/sun/star/sheet/DataPilotFieldReferenceItemType.hpp> #include <com/sun/star/sheet/DataPilotFieldShowItemsMode.hpp> @@ -1681,7 +1683,7 @@ ScXMLDataPilotGroupsContext::ScXMLDataPilotGroupsContext( ScXMLImport& rImport, bAutoStart = sal_True; else { - GetScImport().GetMM100UnitConverter().convertDouble(fStart, sValue); + ::sax::Converter::convertDouble(fStart, sValue); bAutoStart = false; } } @@ -1691,12 +1693,14 @@ ScXMLDataPilotGroupsContext::ScXMLDataPilotGroupsContext( ScXMLImport& rImport, bAutoEnd = sal_True; else { - GetScImport().GetMM100UnitConverter().convertDouble(fEnd, sValue); + ::sax::Converter::convertDouble(fEnd, sValue); bAutoEnd = false; } } else if (IsXMLToken(aLocalName, XML_STEP)) - GetScImport().GetMM100UnitConverter().convertDouble(fStep, sValue); + { + ::sax::Converter::convertDouble(fStep, sValue); + } else if (IsXMLToken(aLocalName, XML_GROUPED_BY)) { if (IsXMLToken(sValue, XML_SECONDS)) diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 52e35dc239bb..732d40ed9030 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -83,6 +83,8 @@ #include <xmloff/xmlerror.hxx> #include <xmloff/XMLEventExport.hxx> +#include <sax/tools/converter.hxx> + #include <rtl/ustring.hxx> #include "tools/color.hxx" @@ -1135,7 +1137,7 @@ void ScXMLExport::WriteRowContent() if (nCols > 1) { rtl::OUStringBuffer aBuf; - GetMM100UnitConverter().convertNumber(aBuf, nCols); + ::sax::Converter::convertNumber(aBuf, nCols); AddAttribute(sAttrColumnsRepeated, aBuf.makeStringAndClear()); } SvXMLElementExport aElemC(*this, sElemCell, true, true); @@ -1159,7 +1161,7 @@ void ScXMLExport::WriteRowContent() if (nCols > 1) { rtl::OUStringBuffer aBuf; - GetMM100UnitConverter().convertNumber(aBuf, nCols); + ::sax::Converter::convertNumber(aBuf, nCols); AddAttribute(sAttrColumnsRepeated, aBuf.makeStringAndClear()); } SvXMLElementExport aElemC(*this, sElemCell, true, true); @@ -1181,7 +1183,7 @@ void ScXMLExport::WriteRowStartTag( if (nEqualRows > 1) { rtl::OUStringBuffer aBuf; - GetMM100UnitConverter().convertNumber(aBuf, nEqualRows); + ::sax::Converter::convertNumber(aBuf, nEqualRows); AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_ROWS_REPEATED, aBuf.makeStringAndClear()); } @@ -1507,7 +1509,7 @@ void ScXMLExport::SetBodyAttributes() eHashUsed = PASSHASH_XL; } } - SvXMLUnitConverter::encodeBase64(aBuffer, aPassHash); + ::sax::Converter::encodeBase64(aBuffer, aPassHash); if (aBuffer.getLength()) { AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY, aBuffer.makeStringAndClear()); @@ -2671,14 +2673,15 @@ void ScXMLExport::WriteTable(sal_Int32 nTable, const Reference<sheet::XSpreadshe ScPasswordHash eHashUsed = PASSHASH_UNSPECIFIED; if (pProtect->hasPasswordHash(PASSHASH_SHA1)) { - SvXMLUnitConverter::encodeBase64(aBuffer, pProtect->getPasswordHash(PASSHASH_SHA1)); + ::sax::Converter::encodeBase64(aBuffer, + pProtect->getPasswordHash(PASSHASH_SHA1)); eHashUsed = PASSHASH_SHA1; } else if (pProtect->hasPasswordHash(PASSHASH_XL, PASSHASH_SHA1)) { // Double-hash this by SHA1 on top of the legacy xls hash. uno::Sequence<sal_Int8> aHash = pProtect->getPasswordHash(PASSHASH_XL, PASSHASH_SHA1); - SvXMLUnitConverter::encodeBase64(aBuffer, aHash); + ::sax::Converter::encodeBase64(aBuffer, aHash); eHashUsed = PASSHASH_XL; } if (aBuffer.getLength()) @@ -2849,8 +2852,8 @@ void ScXMLExport::WriteCell (ScMyCell& aCell) sal_Int32 nRows(aCell.aMatrixRange.EndRow - aCell.aMatrixRange.StartRow + 1); rtl::OUStringBuffer sColumns; rtl::OUStringBuffer sRows; - SvXMLUnitConverter::convertNumber(sColumns, nColumns); - SvXMLUnitConverter::convertNumber(sRows, nRows); + ::sax::Converter::convertNumber(sColumns, nColumns); + ::sax::Converter::convertNumber(sRows, nRows); AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_MATRIX_COLUMNS_SPANNED, sColumns.makeStringAndClear()); AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_MATRIX_ROWS_SPANNED, sRows.makeStringAndClear()); } @@ -2954,8 +2957,8 @@ void ScXMLExport::WriteCell (ScMyCell& aCell) sal_Int32 nRows(aCell.aMergeRange.EndRow - aCell.aMergeRange.StartRow + 1); rtl::OUStringBuffer sColumns; rtl::OUStringBuffer sRows; - SvXMLUnitConverter::convertNumber(sColumns, nColumns); - SvXMLUnitConverter::convertNumber(sRows, nRows); + ::sax::Converter::convertNumber(sColumns, nColumns); + ::sax::Converter::convertNumber(sRows, nRows); AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_COLUMNS_SPANNED, sColumns.makeStringAndClear()); AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_ROWS_SPANNED, sRows.makeStringAndClear()); } @@ -3004,7 +3007,7 @@ void ScXMLExport::ExportShape(const uno::Reference < drawing::XShape >& xShape, if (xShapeProps->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ZOrder"))) >>= nZOrder) { rtl::OUStringBuffer sBuffer; - GetMM100UnitConverter().convertNumber(sBuffer, nZOrder); + ::sax::Converter::convertNumber(sBuffer, nZOrder); AddAttribute(XML_NAMESPACE_DRAW, XML_ZINDEX, sBuffer.makeStringAndClear()); } uno::Reference< beans::XPropertySetInfo > xPropSetInfo = xShapeProps->getPropertySetInfo(); @@ -3199,9 +3202,9 @@ void ScXMLExport::WriteAreaLink( const ScMyCell& rMyCell ) if( rAreaLink.sFilterOptions.getLength() ) AddAttribute( XML_NAMESPACE_TABLE, XML_FILTER_OPTIONS, rAreaLink.sFilterOptions ); OUStringBuffer sValue; - SvXMLUnitConverter::convertNumber( sValue, rAreaLink.GetColCount() ); + ::sax::Converter::convertNumber( sValue, rAreaLink.GetColCount() ); AddAttribute( XML_NAMESPACE_TABLE, XML_LAST_COLUMN_SPANNED, sValue.makeStringAndClear() ); - SvXMLUnitConverter::convertNumber( sValue, rAreaLink.GetRowCount() ); + ::sax::Converter::convertNumber( sValue, rAreaLink.GetRowCount() ); AddAttribute( XML_NAMESPACE_TABLE, XML_LAST_ROW_SPANNED, sValue.makeStringAndClear() ); if( rAreaLink.nRefresh ) { @@ -3318,7 +3321,7 @@ void ScXMLExport::WriteDetective( const ScMyCell& rMyCell ) OUString sOpString; ScXMLConverter::GetStringFromDetOpType( sOpString, aOpItr->eOpType ); AddAttribute( XML_NAMESPACE_TABLE, XML_NAME, sOpString ); - SvXMLUnitConverter::convertNumber( aBuffer, aOpItr->nIndex ); + ::sax::Converter::convertNumber( aBuffer, aOpItr->nIndex ); AddAttribute( XML_NAMESPACE_TABLE, XML_INDEX, aBuffer.makeStringAndClear() ); SvXMLElementExport aRangeElem( *this, XML_NAMESPACE_TABLE, XML_OPERATION, true, true ); ++aOpItr; @@ -3516,7 +3519,7 @@ void ScXMLExport::WriteCalculationSettings(const uno::Reference <sheet::XSpreads if (nYear2000 != 1930) { rtl::OUStringBuffer sBuffer; - GetMM100UnitConverter().convertNumber(sBuffer, nYear2000); + ::sax::Converter::convertNumber(sBuffer, nYear2000); AddAttribute(XML_NAMESPACE_TABLE, XML_NULL_YEAR, sBuffer.makeStringAndClear()); } SvXMLElementExport aCalcSettings(*this, XML_NAMESPACE_TABLE, XML_CALCULATION_SETTINGS, true, true); @@ -3535,12 +3538,14 @@ void ScXMLExport::WriteCalculationSettings(const uno::Reference <sheet::XSpreads AddAttribute(XML_NAMESPACE_TABLE, XML_STATUS, XML_ENABLE); if (nIterationCount != 100) { - GetMM100UnitConverter().convertNumber(sBuffer, nIterationCount); + ::sax::Converter::convertNumber(sBuffer, + nIterationCount); AddAttribute(XML_NAMESPACE_TABLE, XML_STEPS, sBuffer.makeStringAndClear()); } if (!::rtl::math::approxEqual(fIterationEpsilon, 0.001)) { - GetMM100UnitConverter().convertDouble(sBuffer, fIterationEpsilon); + ::sax::Converter::convertDouble(sBuffer, + fIterationEpsilon); AddAttribute(XML_NAMESPACE_TABLE, XML_MAXIMUM_DIFFERENCE, sBuffer.makeStringAndClear()); } SvXMLElementExport aElemIteration(*this, XML_NAMESPACE_TABLE, XML_ITERATION, true, true); @@ -3629,7 +3634,7 @@ void ScXMLExport::WriteScenario() if (!(nFlags & SC_SCENARIO_SHOWFRAME)) AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY_BORDER, XML_FALSE); rtl::OUStringBuffer aBuffer; - SvXMLUnitConverter::convertColor(aBuffer, aColor); + ::sax::Converter::convertColor(aBuffer, aColor.GetColor()); AddAttribute(XML_NAMESPACE_TABLE, XML_BORDER_COLOR, aBuffer.makeStringAndClear()); if (!(nFlags & SC_SCENARIO_TWOWAY)) AddAttribute(XML_NAMESPACE_TABLE, XML_COPY_BACK, XML_FALSE); @@ -3639,7 +3644,8 @@ void ScXMLExport::WriteScenario() AddAttribute(XML_NAMESPACE_TABLE, XML_COPY_FORMULAS, XML_FALSE); if (nFlags & SC_SCENARIO_PROTECT) AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTED, XML_TRUE); - SvXMLUnitConverter::convertBool(aBuffer, pDoc->IsActiveScenario(static_cast<SCTAB>(nCurrentTable))); + ::sax::Converter::convertBool(aBuffer, + pDoc->IsActiveScenario(static_cast<SCTAB>(nCurrentTable))); AddAttribute(XML_NAMESPACE_TABLE, XML_IS_ACTIVE, aBuffer.makeStringAndClear()); const ScRangeList* pRangeList = pDoc->GetScenarioRanges(static_cast<SCTAB>(nCurrentTable)); rtl::OUString sRangeListStr; @@ -4122,7 +4128,8 @@ void ScXMLExport::GetConfigurationSettings(uno::Sequence<beans::PropertyValue>& rtl::OUStringBuffer aTrackedChangesKey; if (GetDocument() && GetDocument()->GetChangeTrack() && GetDocument()->GetChangeTrack()->IsProtected()) { - SvXMLUnitConverter::encodeBase64(aTrackedChangesKey, GetDocument()->GetChangeTrack()->GetProtection()); + ::sax::Converter::encodeBase64(aTrackedChangesKey, + GetDocument()->GetChangeTrack()->GetProtection()); if (aTrackedChangesKey.getLength()) ++nPropsToAdd; } diff --git a/sc/source/filter/xml/xmlexternaltabi.cxx b/sc/source/filter/xml/xmlexternaltabi.cxx index 1e2277465c2a..1394c942f2a1 100644 --- a/sc/source/filter/xml/xmlexternaltabi.cxx +++ b/sc/source/filter/xml/xmlexternaltabi.cxx @@ -45,6 +45,9 @@ #include <xmloff/xmlnmspe.hxx> #include <xmloff/xmltoken.hxx> #include <xmloff/xmluconv.hxx> + +#include <sax/tools/converter.hxx> + #include <com/sun/star/util/NumberFormat.hpp> using namespace ::com::sun::star; @@ -309,7 +312,7 @@ ScXMLExternalRefCellContext::ScXMLExternalRefCellContext( { if (sValue.getLength()) { - mrScImport.GetMM100UnitConverter().convertDouble(mfCellValue, sValue); + ::sax::Converter::convertDouble(mfCellValue, sValue); mbIsNumeric = true; mbIsEmpty = false; } diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index f14b43e6d8d3..9c5cb7d4f289 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -50,6 +50,8 @@ #include <xmloff/xmltoken.hxx> #include <xmloff/xmlerror.hxx> +#include <sax/tools/converter.hxx> + #include <svl/zforlist.hxx> #include <svl/zformat.hxx> #include <svl/languageoptions.hxx> @@ -2249,7 +2251,7 @@ void ScXMLImport::SetConfigurationSettings(const uno::Sequence<beans::PropertyVa if (aConfigProps[i].Value >>= sKey) { uno::Sequence<sal_Int8> aPass; - SvXMLUnitConverter::decodeBase64(aPass, sKey); + ::sax::Converter::decodeBase64(aPass, sKey); if (aPass.getLength()) { if (pDoc->GetChangeTrack()) diff --git a/sc/source/filter/xml/xmlsceni.cxx b/sc/source/filter/xml/xmlsceni.cxx index 5a36e10e4065..8eddec66dc3b 100644 --- a/sc/source/filter/xml/xmlsceni.cxx +++ b/sc/source/filter/xml/xmlsceni.cxx @@ -43,9 +43,10 @@ #include <xmloff/xmltkmap.hxx> #include <xmloff/nmspmap.hxx> -#include <xmloff/xmluconv.hxx> #include <xmloff/xmltoken.hxx> +#include <sax/tools/converter.hxx> + using namespace com::sun::star; using namespace xmloff::token; using ::rtl::OUString; @@ -88,7 +89,9 @@ ScXMLTableScenarioContext::ScXMLTableScenarioContext( break; case XML_TOK_TABLE_SCENARIO_ATTR_BORDER_COLOR: { - SvXMLUnitConverter::convertColor(aBorderColor, sValue); + sal_Int32 nColor(0); + ::sax::Converter::convertColor(nColor, sValue); + aBorderColor.SetColor(nColor); } break; case XML_TOK_TABLE_SCENARIO_ATTR_COPY_BACK: diff --git a/sc/source/filter/xml/xmlstyle.cxx b/sc/source/filter/xml/xmlstyle.cxx index 34665341495c..a6ca43d24d16 100644 --- a/sc/source/filter/xml/xmlstyle.cxx +++ b/sc/source/filter/xml/xmlstyle.cxx @@ -39,7 +39,6 @@ #include "unonames.hxx" #include <xmloff/xmlnmspe.hxx> -#include <xmloff/xmluconv.hxx> #include <xmloff/xmltypes.hxx> #include <xmloff/families.hxx> #include <xmloff/xmlnumfe.hxx> @@ -48,6 +47,7 @@ #include <xmloff/attrlist.hxx> #include <xmloff/contextid.hxx> #include <xmloff/txtprmap.hxx> +#include <sax/tools/converter.hxx> #include <com/sun/star/util/CellProtection.hpp> #include <com/sun/star/table/CellOrientation.hpp> #include <com/sun/star/table/CellVertJustify2.hpp> @@ -1107,8 +1107,8 @@ sal_Bool XmlScPropHdl_PrintContent::importXML( } if ((rValue >>= aCellProtection) || bDefault) { - bool bValue; - if (SvXMLUnitConverter::convertBool(bValue, rStrImpValue)) + bool bValue(false); + if (::sax::Converter::convertBool(bValue, rStrImpValue)) { aCellProtection.IsPrintHidden = !bValue; rValue <<= aCellProtection; @@ -1130,7 +1130,7 @@ sal_Bool XmlScPropHdl_PrintContent::exportXML( if(rValue >>= aCellProtection) { rtl::OUStringBuffer sValue; - SvXMLUnitConverter::convertBool(sValue, !aCellProtection.IsPrintHidden); + ::sax::Converter::convertBool(sValue, !aCellProtection.IsPrintHidden); rStrExpValue = sValue.makeStringAndClear(); bRetval = sal_True; } @@ -1531,7 +1531,7 @@ sal_Bool XmlScPropHdl_RotateAngle::importXML( sal_Bool bRetval(false); sal_Int32 nValue; - if (SvXMLUnitConverter::convertNumber(nValue, rStrImpValue)) + if (::sax::Converter::convertNumber(nValue, rStrImpValue)) { nValue *= 100; rValue <<= nValue; @@ -1552,7 +1552,7 @@ sal_Bool XmlScPropHdl_RotateAngle::exportXML( if(rValue >>= nVal) { rtl::OUStringBuffer sValue; - SvXMLUnitConverter::convertNumber(sValue, sal_Int32(nVal / 100)); + ::sax::Converter::convertNumber(sValue, sal_Int32(nVal / 100)); rStrExpValue = sValue.makeStringAndClear(); bRetval = sal_True; } diff --git a/sc/source/filter/xml/xmlsubti.cxx b/sc/source/filter/xml/xmlsubti.cxx index f70ed4a34bbf..12d9cad96c88 100644 --- a/sc/source/filter/xml/xmlsubti.cxx +++ b/sc/source/filter/xml/xmlsubti.cxx @@ -44,9 +44,9 @@ #include "tabprotection.hxx" #include <svx/svdpage.hxx> +#include <sax/tools/converter.hxx> #include <xmloff/xmltkmap.hxx> #include <xmloff/nmspmap.hxx> -#include <xmloff/xmluconv.hxx> #include <xmloff/xmlerror.hxx> #include <com/sun/star/sheet/XSpreadsheetDocument.hpp> #include <com/sun/star/util/XMergeable.hpp> @@ -664,7 +664,7 @@ void ScMyTables::DeleteTable() if (rImport.GetDocument() && maProtectionData.mbProtected) { uno::Sequence<sal_Int8> aHash; - SvXMLUnitConverter::decodeBase64(aHash, maProtectionData.maPassword); + ::sax::Converter::decodeBase64(aHash, maProtectionData.maPassword); SAL_WNODEPRECATED_DECLARATIONS_PUSH auto_ptr<ScTableProtection> pProtect(new ScTableProtection); diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index 0c0a493c9ec0..3512ef6176da 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -69,7 +69,7 @@ #include "ViewSettingsSequenceDefines.hxx" #include "tpprint.hxx" #include "printopt.hxx" -#include <xmloff/xmluconv.hxx> +#include <sax/tools/converter.hxx> #include <rtl/ustrbuf.hxx> #include <svx/svxdlg.hxx> @@ -887,7 +887,8 @@ void ScPreviewShell::WriteUserDataSequence(uno::Sequence < beans::PropertyValue sal_uInt16 nViewID(GetViewFrame()->GetCurViewId()); pSeq[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_VIEWID)); rtl::OUStringBuffer sBuffer(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_VIEW))); - SvXMLUnitConverter::convertNumber(sBuffer, static_cast<sal_Int32>(nViewID)); + ::sax::Converter::convertNumber(sBuffer, + static_cast<sal_Int32>(nViewID)); pSeq[0].Value <<= sBuffer.makeStringAndClear(); pSeq[1].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_ZOOMVALUE)); pSeq[1].Value <<= sal_Int32 (pPreview->GetZoom()); diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 10b9e4160de5..75e404f32773 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -47,6 +47,8 @@ #include <vcl/svapp.hxx> #include <rtl/math.hxx> +#include <sax/tools/converter.hxx> + #include "viewdata.hxx" #include "docoptio.hxx" #include "scmod.hxx" @@ -65,7 +67,6 @@ #include "inputopt.hxx" #include "viewutil.hxx" #include "stlalgorithm.hxx" -#include <xmloff/xmluconv.hxx> #include "ViewSettingsSequenceDefines.hxx" #include <rtl/ustrbuf.hxx> #include <comphelper/processfactory.hxx> @@ -2614,7 +2615,8 @@ void ScViewData::WriteUserDataSequence(uno::Sequence <beans::PropertyValue>& rSe sal_uInt16 nViewID(pViewShell->GetViewFrame()->GetCurViewId()); pSettings[SC_VIEW_ID].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_VIEWID)); rtl::OUStringBuffer sBuffer(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_VIEW))); - SvXMLUnitConverter::convertNumber(sBuffer, static_cast<sal_Int32>(nViewID)); + ::sax::Converter::convertNumber(sBuffer, + static_cast<sal_Int32>(nViewID)); pSettings[SC_VIEW_ID].Value <<= sBuffer.makeStringAndClear(); uno::Reference<lang::XMultiServiceFactory> xServiceFactory = |