diff options
39 files changed, 108 insertions, 287 deletions
diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx index 8f096cb437a6..4d69dafdb2b4 100644 --- a/dbaccess/source/filter/xml/xmlExport.cxx +++ b/dbaccess/source/filter/xml/xmlExport.cxx @@ -1344,7 +1344,7 @@ OUString ODBExport::implConvertAny(const Any& _rValue) case TypeClass_SHORT: case TypeClass_LONG: // let the unit converter format is as string - ::sax::Converter::convertNumber(aBuffer, getINT32(_rValue)); + aBuffer.append(getINT32(_rValue)); break; default: OSL_FAIL("ODBExport::implConvertAny: Invalid type"); diff --git a/include/sax/tools/converter.hxx b/include/sax/tools/converter.hxx index 77e5a3839e7b..095102804ace 100644 --- a/include/sax/tools/converter.hxx +++ b/include/sax/tools/converter.hxx @@ -102,10 +102,6 @@ public: static void convertColor( OUStringBuffer &rBuffer, sal_Int32 nColor ); - /** convert number to string */ - static void convertNumber( OUStringBuffer& rBuffer, - sal_Int32 nNumber ); - /** convert string to number with optional min and max values */ static bool convertNumber( sal_Int32& rValue, const OUString& rString, diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx index 25151dd9c0dc..cc5fe5f8d2ed 100644 --- a/reportdesign/source/filter/xml/xmlExport.cxx +++ b/reportdesign/source/filter/xml/xmlExport.cxx @@ -801,7 +801,7 @@ void ORptExport::exportContainer(const Reference< XSection>& _xSection) { if ( nEmptyCellColSpan > 0 ) { - AddAttribute( XML_NAMESPACE_TABLE,XML_NUMBER_COLUMNS_SPANNED,implConvertNumber(nEmptyCellColSpan) ); + AddAttribute( XML_NAMESPACE_TABLE,XML_NUMBER_COLUMNS_SPANNED, OUString::number(nEmptyCellColSpan) ); bCoveredCell = true; nColSpan = nEmptyCellColSpan - 1; nEmptyCellColSpan = 0; @@ -809,14 +809,14 @@ void ORptExport::exportContainer(const Reference< XSection>& _xSection) sal_Int32 nSpan = aColIter->nColSpan; if ( nSpan > 1 ) { - AddAttribute( XML_NAMESPACE_TABLE,XML_NUMBER_COLUMNS_SPANNED,implConvertNumber(nSpan) ); + AddAttribute( XML_NAMESPACE_TABLE,XML_NUMBER_COLUMNS_SPANNED, OUString::number(nSpan) ); nColSpan = nSpan - 1; bCoveredCell = true; } nSpan = aColIter->nRowSpan; if ( nSpan > 1 ) { - AddAttribute( XML_NAMESPACE_TABLE,XML_NUMBER_ROWS_SPANNED,implConvertNumber(nSpan) ); + AddAttribute( XML_NAMESPACE_TABLE,XML_NUMBER_ROWS_SPANNED, OUString::number(nSpan) ); aRowSpan[nColIndex] = nSpan - 1; } if ( aColIter->xElement.is() ) @@ -951,7 +951,7 @@ void ORptExport::exportContainer(const Reference< XSection>& _xSection) if ( nEmptyCellColSpan ) { { - AddAttribute( XML_NAMESPACE_TABLE,XML_NUMBER_COLUMNS_SPANNED,implConvertNumber(nEmptyCellColSpan) ); + AddAttribute( XML_NAMESPACE_TABLE,XML_NUMBER_COLUMNS_SPANNED, OUString::number(nEmptyCellColSpan) ); SvXMLElementExport aCell(*this,XML_NAMESPACE_TABLE, XML_TABLE_CELL, true, true); if ( !bShapeHandled ) { @@ -971,7 +971,7 @@ void ORptExport::exportContainer(const Reference< XSection>& _xSection) if ( nEmptyCellColSpan ) { { - AddAttribute( XML_NAMESPACE_TABLE,XML_NUMBER_COLUMNS_SPANNED,implConvertNumber(nEmptyCellColSpan) ); + AddAttribute( XML_NAMESPACE_TABLE,XML_NUMBER_COLUMNS_SPANNED, OUString::number(nEmptyCellColSpan) ); SvXMLElementExport aCell(*this,XML_NAMESPACE_TABLE, XML_TABLE_CELL, true, true); if ( !bShapeHandled ) { @@ -1364,14 +1364,6 @@ void ORptExport::ExportStyles_(bool bUsed) GetShapeExport()->ExportGraphicDefaults(); } -OUString ORptExport::implConvertNumber(sal_Int32 _nValue) -{ - OUStringBuffer aBuffer; - ::sax::Converter::convertNumber(aBuffer, _nValue); - return aBuffer.makeStringAndClear(); -} - - SvXMLAutoStylePoolP* ORptExport::CreateAutoStylePool() { return new OXMLAutoStylePoolP(*this); diff --git a/reportdesign/source/filter/xml/xmlExport.hxx b/reportdesign/source/filter/xml/xmlExport.hxx index ad4e972d872c..102af7a03cf1 100644 --- a/reportdesign/source/filter/xml/xmlExport.hxx +++ b/reportdesign/source/filter/xml/xmlExport.hxx @@ -138,8 +138,6 @@ private: void exportGroupsExpressionAsFunction(const Reference< XGroups>& _xGroups); static OUString convertFormula(const OUString& _sFormula); - static OUString implConvertNumber(sal_Int32 _nValue); - virtual void SetBodyAttributes() override; protected: diff --git a/sax/qa/cppunit/test_converter.cxx b/sax/qa/cppunit/test_converter.cxx index c8b813c47d22..6a1f087e143a 100644 --- a/sax/qa/cppunit/test_converter.cxx +++ b/sax/qa/cppunit/test_converter.cxx @@ -610,15 +610,6 @@ void doTestStringToNumber(sal_Int32 nValue, char const*const pis, sal_Int32 nMin CPPUNIT_ASSERT_EQUAL(nValue, nTemp); } -void doTestNumberToString(char const*const pis, sal_Int32 nValue) -{ - OUString const is(OUString::createFromAscii(pis)); - OUStringBuffer buf; - Converter::convertNumber(buf, nValue); - SAL_INFO("sax.cppunit","" << buf.toString()); - CPPUNIT_ASSERT_EQUAL(is, buf.makeStringAndClear()); -} - void ConverterTest::testNumber() { doTestStringToNumber(30, "30", 1, 40); @@ -626,11 +617,6 @@ void ConverterTest::testNumber() doTestStringToNumber(-30, "7", -100, -30); doTestStringToNumber(0, "-0", 0, 1); doTestStringToNumber(0, "666", -0, 0); - doTestNumberToString("333", 333); - doTestNumberToString("-1", -1); - doTestNumberToString("0", 0000); - doTestNumberToString("-1", -0001); - doTestNumberToString("0", -0); } void doTestEncodeBase64(char const*const pis, const uno::Sequence<sal_Int8>& aPass) diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx index 7f2069bba9a6..c3a77033e8f3 100644 --- a/sax/source/tools/converter.cxx +++ b/sax/source/tools/converter.cxx @@ -524,12 +524,6 @@ void Converter::convertColor( OUStringBuffer& rBuffer, sal_Int32 nColor ) rBuffer.append( sal_Unicode( aHexTab[ nCol & 0xf ] ) ); } -/** convert number to string */ -void Converter::convertNumber( OUStringBuffer& rBuffer, sal_Int32 nNumber ) -{ - rBuffer.append( nNumber ); -} - /** convert string to number with optional min and max values */ bool Converter::convertNumber( sal_Int32& rValue, const OUString& rString, @@ -651,7 +645,7 @@ void Converter::convertAngle(OUStringBuffer& rBuffer, sal_Int16 const nAngle) { #if 1 // wrong, but backward compatible with OOo/LO < 4.4 - ::sax::Converter::convertNumber(rBuffer, nAngle); + rBuffer.append(nAngle); #else // maybe in the future... (see other convertAngle) double fAngle(double(nAngle) / 10.0); @@ -2555,7 +2549,7 @@ bool Converter::convertAny(OUStringBuffer& rsValue, { rsType.append("integer"); bConverted = true; - ::sax::Converter::convertNumber(rsValue, nTempValue); + rsValue.append(nTempValue); } } break; diff --git a/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx b/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx index b3f059fea309..497bac9bf561 100644 --- a/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx +++ b/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx @@ -60,10 +60,7 @@ ScChangeTrackingExportHelper::~ScChangeTrackingExportHelper() OUString ScChangeTrackingExportHelper::GetChangeID(const sal_uInt32 nActionNumber) { - OUStringBuffer sBuffer(sChangeIDPrefix); - ::sax::Converter::convertNumber(sBuffer, - static_cast<sal_Int32>(nActionNumber)); - return sBuffer.makeStringAndClear(); + return OUString::number(nActionNumber); } void ScChangeTrackingExportHelper::GetAcceptanceState(const ScChangeAction* pAction) @@ -86,29 +83,18 @@ void ScChangeTrackingExportHelper::WriteBigRange(const ScBigRange& rBigRange, XM nEndColumn, nEndRow, nEndSheet); if ((nStartColumn == nEndColumn) && (nStartRow == nEndRow) && (nStartSheet == nEndSheet)) { - OUStringBuffer sBuffer; - ::sax::Converter::convertNumber(sBuffer, nStartColumn); - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_COLUMN, sBuffer.makeStringAndClear()); - ::sax::Converter::convertNumber(sBuffer, nStartRow); - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_ROW, sBuffer.makeStringAndClear()); - ::sax::Converter::convertNumber(sBuffer, nStartSheet); - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TABLE, sBuffer.makeStringAndClear()); + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_COLUMN, OUString::number(nStartColumn)); + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_ROW, OUString::number(nStartRow)); + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TABLE, OUString::number(nStartSheet)); } else { - OUStringBuffer sBuffer; - ::sax::Converter::convertNumber(sBuffer, nStartColumn); - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_START_COLUMN, sBuffer.makeStringAndClear()); - ::sax::Converter::convertNumber(sBuffer, nStartRow); - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_START_ROW, sBuffer.makeStringAndClear()); - ::sax::Converter::convertNumber(sBuffer, nStartSheet); - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_START_TABLE, sBuffer.makeStringAndClear()); - ::sax::Converter::convertNumber(sBuffer, nEndColumn); - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_END_COLUMN, sBuffer.makeStringAndClear()); - ::sax::Converter::convertNumber(sBuffer, nEndRow); - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_END_ROW, sBuffer.makeStringAndClear()); - ::sax::Converter::convertNumber(sBuffer, nEndSheet); - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_END_TABLE, sBuffer.makeStringAndClear()); + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_START_COLUMN, OUString::number(nStartColumn)); + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_START_ROW, OUString::number(nStartRow)); + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_START_TABLE, OUString::number(nStartSheet)); + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_END_COLUMN, OUString::number(nEndColumn)); + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_END_ROW, OUString::number(nEndRow)); + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_END_TABLE, OUString::number(nEndSheet)); } SvXMLElementExport aBigRangeElem(rExport, XML_NAMESPACE_TABLE, aName, true, true); } @@ -343,12 +329,8 @@ void ScChangeTrackingExportHelper::WriteFormulaCell(const ScCellValue& rCell, co SCCOL nColumns; SCROW nRows; pFormulaCell->GetMatColsRows(nColumns, nRows); - OUStringBuffer sColumns; - OUStringBuffer sRows; - ::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()); + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_MATRIX_COLUMNS_SPANNED, OUString::number(nColumns)); + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_MATRIX_ROWS_SPANNED, OUString::number(nRows)); } else { @@ -473,19 +455,15 @@ void ScChangeTrackingExportHelper::AddInsertionAttributes(const ScChangeAction* } nPosition = nStartPosition; nCount = nEndPosition - nStartPosition + 1; - OUStringBuffer sBuffer; - ::sax::Converter::convertNumber(sBuffer, nPosition); - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_POSITION, sBuffer.makeStringAndClear()); + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_POSITION, OUString::number(nPosition)); OSL_ENSURE(nCount > 0, "wrong insertion count"); if (nCount > 1) { - ::sax::Converter::convertNumber(sBuffer, nCount); - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_COUNT, sBuffer.makeStringAndClear()); + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_COUNT, OUString::number(nCount)); } if (pConstAction->GetType() != SC_CAT_INSERT_TABS) { - ::sax::Converter::convertNumber(sBuffer, nStartSheet); - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TABLE, sBuffer.makeStringAndClear()); + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TABLE, OUString::number(nStartSheet)); } } @@ -535,13 +513,10 @@ void ScChangeTrackingExportHelper::AddDeletionAttributes(const ScChangeActionDel } break; } - OUStringBuffer sBuffer; - ::sax::Converter::convertNumber(sBuffer, nPosition); - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_POSITION, sBuffer.makeStringAndClear()); + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_POSITION, OUString::number(nPosition)); if (pDelAction->GetType() != SC_CAT_DELETE_TABS) { - ::sax::Converter::convertNumber(sBuffer, nStartSheet); - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TABLE, sBuffer.makeStringAndClear()); + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TABLE, OUString::number(nStartSheet)); if (pDelAction->IsMultiDelete() && !pDelAction->GetDx() && !pDelAction->GetDy()) { const ScChangeAction* p = pDelAction->GetNext(); @@ -565,8 +540,7 @@ void ScChangeTrackingExportHelper::AddDeletionAttributes(const ScChangeActionDel } } - ::sax::Converter::convertNumber(sBuffer, nSlavesCount); - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_MULTI_DELETION_SPANNED, sBuffer.makeStringAndClear()); + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_MULTI_DELETION_SPANNED, OUString::number(nSlavesCount)); } } } @@ -578,13 +552,10 @@ void ScChangeTrackingExportHelper::WriteCutOffs(const ScChangeActionDel* pAction if (pCutOffIns || pLinkMove) { SvXMLElementExport aCutOffsElem (rExport, XML_NAMESPACE_TABLE, XML_CUT_OFFS, true, true); - OUStringBuffer sBuffer; if (pCutOffIns) { rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_ID, GetChangeID(pCutOffIns->GetActionNumber())); - ::sax::Converter::convertNumber(sBuffer, - static_cast<sal_Int32>(pAction->GetCutOffCount())); - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_POSITION, sBuffer.makeStringAndClear()); + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_POSITION, OUString::number(pAction->GetCutOffCount())); SvXMLElementExport aInsertCutOffElem (rExport, XML_NAMESPACE_TABLE, XML_INSERTION_CUT_OFF, true, true); } while (pLinkMove) @@ -592,18 +563,12 @@ void ScChangeTrackingExportHelper::WriteCutOffs(const ScChangeActionDel* pAction rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_ID, GetChangeID(pLinkMove->GetAction()->GetActionNumber())); if (pLinkMove->GetCutOffFrom() == pLinkMove->GetCutOffTo()) { - ::sax::Converter::convertNumber(sBuffer, - static_cast<sal_Int32>(pLinkMove->GetCutOffFrom())); - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_POSITION, sBuffer.makeStringAndClear()); + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_POSITION, OUString::number(pLinkMove->GetCutOffFrom())); } else { - ::sax::Converter::convertNumber(sBuffer, - static_cast<sal_Int32>(pLinkMove->GetCutOffFrom())); - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_START_POSITION, sBuffer.makeStringAndClear()); - ::sax::Converter::convertNumber(sBuffer, - static_cast<sal_Int32>(pLinkMove->GetCutOffTo())); - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_END_POSITION, sBuffer.makeStringAndClear()); + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_START_POSITION, OUString::number(pLinkMove->GetCutOffFrom())); + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_END_POSITION, OUString::number(pLinkMove->GetCutOffTo())); } SvXMLElementExport aMoveCutOffElem (rExport, XML_NAMESPACE_TABLE, XML_MOVEMENT_CUT_OFF, true, true); pLinkMove = pLinkMove->GetNext(); diff --git a/sc/source/filter/xml/XMLChangeTrackingExportHelper.hxx b/sc/source/filter/xml/XMLChangeTrackingExportHelper.hxx index 674ffb3e63da..eabe66820c9d 100644 --- a/sc/source/filter/xml/XMLChangeTrackingExportHelper.hxx +++ b/sc/source/filter/xml/XMLChangeTrackingExportHelper.hxx @@ -48,7 +48,7 @@ class ScChangeTrackingExportHelper OUString sChangeIDPrefix; css::uno::Reference<css::text::XText> xText; - OUString GetChangeID(const sal_uInt32 nActionNumber); + static OUString GetChangeID(const sal_uInt32 nActionNumber); void GetAcceptanceState(const ScChangeAction* pAction); void WriteBigRange(const ScBigRange& rBigRange, xmloff::token::XMLTokenEnum aName); diff --git a/sc/source/filter/xml/XMLExportDDELinks.cxx b/sc/source/filter/xml/XMLExportDDELinks.cxx index ece97a35cccf..938ea02643fd 100644 --- a/sc/source/filter/xml/XMLExportDDELinks.cxx +++ b/sc/source/filter/xml/XMLExportDDELinks.cxx @@ -65,9 +65,7 @@ void ScXMLExportDDELinks::WriteCell(const ScMatrixValue& aVal, sal_Int32 nRepeat if (nRepeat > 1) { - OUStringBuffer aBuf; - ::sax::Converter::convertNumber(aBuf, nRepeat); - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_COLUMNS_REPEATED, aBuf.makeStringAndClear()); + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_COLUMNS_REPEATED, OUString::number(nRepeat)); } SvXMLElementExport(rExport, XML_NAMESPACE_TABLE, XML_TABLE_CELL, true, true); } @@ -88,9 +86,7 @@ void ScXMLExportDDELinks::WriteTable(const sal_Int32 nPos) SvXMLElementExport aTableElem(rExport, XML_NAMESPACE_TABLE, XML_TABLE, true, true); if (nCols > 1) { - OUStringBuffer aBuf; - ::sax::Converter::convertNumber(aBuf, static_cast<sal_Int32>(nCols)); - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_COLUMNS_REPEATED, aBuf.makeStringAndClear()); + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_COLUMNS_REPEATED, OUString::number(nCols)); } { SvXMLElementExport aElemCol(rExport, XML_NAMESPACE_TABLE, XML_TABLE_COLUMN, true, true); diff --git a/sc/source/filter/xml/XMLExportDataPilot.cxx b/sc/source/filter/xml/XMLExportDataPilot.cxx index b16aa0a03143..475bd125071f 100644 --- a/sc/source/filter/xml/XMLExportDataPilot.cxx +++ b/sc/source/filter/xml/XMLExportDataPilot.cxx @@ -391,9 +391,7 @@ void ScXMLExportDataPilot::WriteAutoShowInfo(ScDPSaveDimension* pDim) if (!sValueStr.isEmpty()) rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY_MEMBER_MODE, sValueStr); - OUStringBuffer sBuffer; - ::sax::Converter::convertNumber(sBuffer, pAutoInfo->ItemCount); - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_MEMBER_COUNT, sBuffer.makeStringAndClear()); + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_MEMBER_COUNT, OUString::number(pAutoInfo->ItemCount)); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DATA_FIELD, pAutoInfo->DataField); @@ -694,9 +692,7 @@ void ScXMLExportDataPilot::WriteDimension(ScDPSaveDimension* pDim, const ScDPDim rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_ORIENTATION, sValueStr ); if (pDim->GetUsedHierarchy() != 1) { - OUStringBuffer sBuffer; - ::sax::Converter::convertNumber(sBuffer, pDim->GetUsedHierarchy()); - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_USED_HIERARCHY, sBuffer.makeStringAndClear()); + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_USED_HIERARCHY, OUString::number(pDim->GetUsedHierarchy())); } ScXMLConverter::GetStringFromFunction( sValueStr, static_cast<sal_Int16>(pDim->GetFunction()) ); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_FUNCTION, sValueStr); diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 35a5e92c3b57..260817a97928 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -1323,9 +1323,7 @@ void ScXMLExport::WriteRowContent() AddAttribute(XML_NAMESPACE_TABLE, XML_CONTENT_VALIDATION_NAME, pValidationsContainer->GetValidationName(nPrevValidationIndex)); if (nCols > 1) { - OUStringBuffer aBuf; - ::sax::Converter::convertNumber(aBuf, nCols); - AddAttribute(sAttrColumnsRepeated, aBuf.makeStringAndClear()); + AddAttribute(sAttrColumnsRepeated, OUString::number(nCols)); } SvXMLElementExport aElemC(*this, sElemCell, true, true); nIndex = aRange.nIndex; @@ -1346,9 +1344,7 @@ void ScXMLExport::WriteRowContent() AddAttribute(XML_NAMESPACE_TABLE, XML_CONTENT_VALIDATION_NAME, pValidationsContainer->GetValidationName(nPrevValidationIndex)); if (nCols > 1) { - OUStringBuffer aBuf; - ::sax::Converter::convertNumber(aBuf, nCols); - AddAttribute(sAttrColumnsRepeated, aBuf.makeStringAndClear()); + AddAttribute(sAttrColumnsRepeated, OUString::number(nCols)); } SvXMLElementExport aElemC(*this, sElemCell, true, true); } @@ -1368,9 +1364,7 @@ void ScXMLExport::WriteRowStartTag( } if (nEqualRows > 1) { - OUStringBuffer aBuf; - ::sax::Converter::convertNumber(aBuf, nEqualRows); - AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_ROWS_REPEATED, aBuf.makeStringAndClear()); + AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_ROWS_REPEATED, OUString::number(nEqualRows)); } StartElement( sElemRow, true); @@ -3147,12 +3141,8 @@ void ScXMLExport::WriteCell(ScMyCell& aCell, sal_Int32 nEqualCellCount) { SCCOL nColumns( aCell.aMatrixRange.aEnd.Col() - aCell.aMatrixRange.aStart.Col() + 1 ); SCROW nRows( aCell.aMatrixRange.aEnd.Row() - aCell.aMatrixRange.aStart.Row() + 1 ); - OUStringBuffer sColumns; - OUStringBuffer sRows; - ::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()); + AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_MATRIX_COLUMNS_SPANNED, OUString::number(nColumns)); + AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_MATRIX_ROWS_SPANNED, OUString::number(nRows)); } bool bIsEmpty(false); switch (aCell.nType) @@ -3263,12 +3253,8 @@ void ScXMLExport::WriteCell(ScMyCell& aCell, sal_Int32 nEqualCellCount) { SCCOL nColumns( aCell.aMergeRange.aEnd.Col() - aCell.aMergeRange.aStart.Col() + 1 ); SCROW nRows( aCell.aMergeRange.aEnd.Row() - aCell.aMergeRange.aStart.Row() + 1 ); - OUStringBuffer sColumns; - OUStringBuffer sRows; - ::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()); + AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_COLUMNS_SPANNED, OUString::number(nColumns)); + AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_ROWS_SPANNED, OUString::number(nRows)); } } SvXMLElementExport aElemC(*this, *pCellString, true, true); @@ -3386,9 +3372,7 @@ void ScXMLExport::ExportShape(const uno::Reference < drawing::XShape >& xShape, sal_Int32 nZOrder = 0; if (xShapeProps->getPropertyValue("ZOrder") >>= nZOrder) { - OUStringBuffer sBuffer; - ::sax::Converter::convertNumber(sBuffer, nZOrder); - AddAttribute(XML_NAMESPACE_DRAW, XML_ZINDEX, sBuffer.makeStringAndClear()); + AddAttribute(XML_NAMESPACE_DRAW, XML_ZINDEX, OUString::number(nZOrder)); } uno::Reference< beans::XPropertySetInfo > xPropSetInfo = xShapeProps->getPropertySetInfo(); if( xPropSetInfo->hasPropertyByName( sPropCLSID ) ) @@ -3583,10 +3567,8 @@ void ScXMLExport::WriteAreaLink( const ScMyCell& rMyCell ) if( !rAreaLink.sFilterOptions.isEmpty() ) AddAttribute( XML_NAMESPACE_TABLE, XML_FILTER_OPTIONS, rAreaLink.sFilterOptions ); OUStringBuffer sValue; - ::sax::Converter::convertNumber( sValue, rAreaLink.GetColCount() ); - AddAttribute( XML_NAMESPACE_TABLE, XML_LAST_COLUMN_SPANNED, sValue.makeStringAndClear() ); - ::sax::Converter::convertNumber( sValue, rAreaLink.GetRowCount() ); - AddAttribute( XML_NAMESPACE_TABLE, XML_LAST_ROW_SPANNED, sValue.makeStringAndClear() ); + AddAttribute( XML_NAMESPACE_TABLE, XML_LAST_COLUMN_SPANNED, OUString::number(rAreaLink.GetColCount()) ); + AddAttribute( XML_NAMESPACE_TABLE, XML_LAST_ROW_SPANNED, OUString::number(rAreaLink.GetRowCount()) ); if( rAreaLink.nRefresh ) { ::sax::Converter::convertDuration( sValue, @@ -3709,7 +3691,6 @@ void ScXMLExport::WriteDetective( const ScMyCell& rMyCell ) SvXMLElementExport aRangeElem( *this, XML_NAMESPACE_TABLE, XML_HIGHLIGHTED_RANGE, true, true ); ++aObjItr; } - OUStringBuffer aBuffer; ScMyDetectiveOpVec::const_iterator aOpItr(rOpVec.begin()); ScMyDetectiveOpVec::const_iterator aEndOpItr(rOpVec.end()); while(aOpItr != aEndOpItr) @@ -3717,8 +3698,7 @@ void ScXMLExport::WriteDetective( const ScMyCell& rMyCell ) OUString sOpString; ScXMLConverter::GetStringFromDetOpType( sOpString, aOpItr->eOpType ); AddAttribute( XML_NAMESPACE_TABLE, XML_NAME, sOpString ); - ::sax::Converter::convertNumber( aBuffer, aOpItr->nIndex ); - AddAttribute( XML_NAMESPACE_TABLE, XML_INDEX, aBuffer.makeStringAndClear() ); + AddAttribute( XML_NAMESPACE_TABLE, XML_INDEX, OUString::number(aOpItr->nIndex) ); SvXMLElementExport aRangeElem( *this, XML_NAMESPACE_TABLE, XML_OPERATION, true, true ); ++aOpItr; } @@ -3852,9 +3832,7 @@ void ScXMLExport::WriteCalculationSettings(const uno::Reference <sheet::XSpreads AddAttribute(XML_NAMESPACE_TABLE, XML_USE_WILDCARDS, XML_TRUE); if (nYear2000 != 1930) { - OUStringBuffer sBuffer; - ::sax::Converter::convertNumber(sBuffer, nYear2000); - AddAttribute(XML_NAMESPACE_TABLE, XML_NULL_YEAR, sBuffer.makeStringAndClear()); + AddAttribute(XML_NAMESPACE_TABLE, XML_NULL_YEAR, OUString::number(nYear2000)); } SvXMLElementExport aCalcSettings(*this, XML_NAMESPACE_TABLE, XML_CALCULATION_SETTINGS, true, true); { @@ -3872,9 +3850,7 @@ void ScXMLExport::WriteCalculationSettings(const uno::Reference <sheet::XSpreads AddAttribute(XML_NAMESPACE_TABLE, XML_STATUS, XML_ENABLE); if (nIterationCount != 100) { - ::sax::Converter::convertNumber(sBuffer, - nIterationCount); - AddAttribute(XML_NAMESPACE_TABLE, XML_STEPS, sBuffer.makeStringAndClear()); + AddAttribute(XML_NAMESPACE_TABLE, XML_STEPS, OUString::number(nIterationCount)); } if (!::rtl::math::approxEqual(fIterationEpsilon, 0.001)) { diff --git a/sc/source/filter/xml/xmlstyle.cxx b/sc/source/filter/xml/xmlstyle.cxx index f34c68ed65b1..3d38967ad818 100644 --- a/sc/source/filter/xml/xmlstyle.cxx +++ b/sc/source/filter/xml/xmlstyle.cxx @@ -1554,9 +1554,7 @@ bool XmlScPropHdl_RotateAngle::exportXML( if(rValue >>= nVal) { - OUStringBuffer sValue; - ::sax::Converter::convertNumber(sValue, sal_Int32(nVal / 100)); - rStrExpValue = sValue.makeStringAndClear(); + rStrExpValue = OUString::number(nVal / 100); bRetval = true; } diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index a283d811f98c..9076a17f215e 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -939,10 +939,7 @@ void ScPreviewShell::WriteUserDataSequence(uno::Sequence < beans::PropertyValue { sal_uInt16 nViewID(GetViewFrame()->GetCurViewId()); pSeq[0].Name = SC_VIEWID; - OUStringBuffer sBuffer(SC_VIEW); - ::sax::Converter::convertNumber(sBuffer, - static_cast<sal_Int32>(nViewID)); - pSeq[0].Value <<= sBuffer.makeStringAndClear(); + pSeq[0].Value <<= SC_VIEW + OUString::number(nViewID); pSeq[1].Name = SC_ZOOMVALUE; pSeq[1].Value <<= sal_Int32 (pPreview->GetZoom()); pSeq[2].Name = "PageNumber"; diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 67a220886fa6..a608f679e836 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -2742,10 +2742,7 @@ void ScViewData::WriteUserDataSequence(uno::Sequence <beans::PropertyValue>& rSe { sal_uInt16 nViewID(pViewShell->GetViewFrame()->GetCurViewId()); pSettings[SC_VIEW_ID].Name = SC_VIEWID; - OUStringBuffer sBuffer(SC_VIEW); - ::sax::Converter::convertNumber(sBuffer, - static_cast<sal_Int32>(nViewID)); - pSettings[SC_VIEW_ID].Value <<= sBuffer.makeStringAndClear(); + pSettings[SC_VIEW_ID].Value <<= SC_VIEW + OUString::number(nViewID); uno::Reference<container::XNameContainer> xNameContainer = document::NamedPropertyValues::create( comphelper::getProcessComponentContext() ); diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx index f519833c05f5..1f58e849a50a 100644 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -1638,10 +1638,8 @@ SfxDocumentMetaData::setDocumentStatistics( const css::uno::Any any = the_value[i].Value; sal_Int32 val = 0; if (any >>= val) { - OUStringBuffer buf; - ::sax::Converter::convertNumber(buf, val); attributes.push_back(std::make_pair(s_stdStatAttrs[j], - buf.makeStringAndClear())); + OUString::number(val))); } else { SAL_WARN("sfx.doc", "Invalid statistic: " << name); } @@ -1675,9 +1673,7 @@ SfxDocumentMetaData::setEditingCycles(::sal_Int16 the_value) throw css::lang::IllegalArgumentException( "SfxDocumentMetaData::setEditingCycles: argument is negative", *this, 0); - OUStringBuffer buf; - ::sax::Converter::convertNumber(buf, the_value); - setMetaTextAndNotify("meta:editing-cycles", buf.makeStringAndClear()); + setMetaTextAndNotify("meta:editing-cycles", OUString::number(the_value)); } ::sal_Int32 SAL_CALL diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx index 6181fb7f41bd..12f6bf3fe507 100644 --- a/sw/source/filter/xml/xmlexp.cxx +++ b/sw/source/filter/xml/xmlexp.cxx @@ -472,9 +472,7 @@ void SwXMLExport::ExportContent_() aAny >>= nYear; if (nYear != 1930 ) { - OUStringBuffer sBuffer; - ::sax::Converter::convertNumber(sBuffer, nYear); - AddAttribute(XML_NAMESPACE_TABLE, XML_NULL_YEAR, sBuffer.makeStringAndClear()); + AddAttribute(XML_NAMESPACE_TABLE, XML_NULL_YEAR, OUString::number(nYear)); SvXMLElementExport aCalcSettings(*this, XML_NAMESPACE_TABLE, XML_CALCULATION_SETTINGS, true, true); } } diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx index 6451c5ba4160..58f8de8111a8 100644 --- a/sw/source/filter/xml/xmlexpit.cxx +++ b/sw/source/filter/xml/xmlexpit.cxx @@ -1019,7 +1019,7 @@ bool SvXMLExportItemMapper::QueryXMLValue( { // #i114163# positiveInteger only! sal_Int32 const number(oNumOffset.get()); - ::sax::Converter::convertNumber(aOut, number); + aOut.append(number); } else { diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx index f12fca5f1c9b..c6d0aac51d82 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -1475,9 +1475,7 @@ void SwView::WriteUserDataSequence ( uno::Sequence < beans::PropertyValue >& rSe std::vector<beans::PropertyValue> aVector; sal_uInt16 nViewID( GetViewFrame()->GetCurViewId()); - OUStringBuffer sBuffer( "view" ); - ::sax::Converter::convertNumber(sBuffer, static_cast<sal_Int32>(nViewID)); - aVector.push_back(comphelper::makePropertyValue("ViewId", sBuffer.makeStringAndClear())); + aVector.push_back(comphelper::makePropertyValue("ViewId", "view" + OUString::number(nViewID))); aVector.push_back(comphelper::makePropertyValue("ViewLeft", convertTwipToMm100 ( rRect.Left() ))); diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 954ba1c8c793..0243a79e4434 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -2129,18 +2129,15 @@ void SchXMLExportHelper_Impl::exportDateScale( const Reference< beans::XProperty if( aIncrement.TimeResolution >>= nTimeResolution ) mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_BASE_TIME_UNIT, lcl_getTimeUnitToken( nTimeResolution ) ); - OUStringBuffer aValue; chart::TimeInterval aInterval; if( aIncrement.MajorTimeInterval >>= aInterval ) { - ::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_VALUE, OUString::number(aInterval.Number) ); mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_MAJOR_INTERVAL_UNIT, lcl_getTimeUnitToken( aInterval.TimeUnit ) ); } if( aIncrement.MinorTimeInterval >>= aInterval ) { - ::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_VALUE, OUString::number(aInterval.Number) ); mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_MINOR_INTERVAL_UNIT, lcl_getTimeUnitToken( aInterval.TimeUnit ) ); } diff --git a/xmloff/source/core/SettingsExportHelper.cxx b/xmloff/source/core/SettingsExportHelper.cxx index a678f95f0ddd..f0019b13d6c1 100644 --- a/xmloff/source/core/SettingsExportHelper.cxx +++ b/xmloff/source/core/SettingsExportHelper.cxx @@ -209,9 +209,7 @@ void XMLSettingsExportHelper::exportShort(const sal_Int16 nValue, const OUString m_rContext.AddAttribute( XML_NAME, rName ); m_rContext.AddAttribute( XML_TYPE, XML_SHORT ); m_rContext.StartElement( XML_CONFIG_ITEM ); - OUStringBuffer sBuffer; - ::sax::Converter::convertNumber(sBuffer, sal_Int32(nValue)); - m_rContext.Characters( sBuffer.makeStringAndClear() ); + m_rContext.Characters( OUString::number(nValue) ); m_rContext.EndElement( false ); } @@ -221,9 +219,7 @@ void XMLSettingsExportHelper::exportInt(const sal_Int32 nValue, const OUString& m_rContext.AddAttribute( XML_NAME, rName ); m_rContext.AddAttribute( XML_TYPE, XML_INT ); m_rContext.StartElement( XML_CONFIG_ITEM ); - OUStringBuffer sBuffer; - ::sax::Converter::convertNumber(sBuffer, nValue); - m_rContext.Characters( sBuffer.makeStringAndClear() ); + m_rContext.Characters( OUString::number(nValue) ); m_rContext.EndElement( false ); } @@ -233,8 +229,7 @@ void XMLSettingsExportHelper::exportLong(const sal_Int64 nValue, const OUString& m_rContext.AddAttribute( XML_NAME, rName ); m_rContext.AddAttribute( XML_TYPE, XML_LONG ); m_rContext.StartElement( XML_CONFIG_ITEM ); - OUString sValue(OUString::number(nValue)); - m_rContext.Characters( sValue ); + m_rContext.Characters( OUString::number(nValue) ); m_rContext.EndElement( false ); } diff --git a/xmloff/source/draw/propimp0.cxx b/xmloff/source/draw/propimp0.cxx index dd13c8ffdb63..c8ec378abbfd 100644 --- a/xmloff/source/draw/propimp0.cxx +++ b/xmloff/source/draw/propimp0.cxx @@ -218,9 +218,8 @@ bool XMLTextAnimationStepPropertyHdl::exportXML( if( nVal < 0 ) { - const OUString aPX( "px" ); - ::sax::Converter::convertNumber( aOut, (sal_Int32)-nVal ); - aOut.append( aPX ); + aOut.append( (sal_Int32)-nVal ); + aOut.append( "px" ); } else { diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index dfa0624ab87b..8cf9e1caaeee 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -3691,9 +3691,7 @@ void XMLShapeExport::export3DSceneAttributes( const css::uno::Reference< css::be aAny = xPropSet->getPropertyValue("D3DSceneShadowSlant"); sal_Int16 nShadowSlant = 0; aAny >>= nShadowSlant; - ::sax::Converter::convertNumber(sStringBuffer, (sal_Int32)nShadowSlant); - aStr = sStringBuffer.makeStringAndClear(); - mrExport.AddAttribute(XML_NAMESPACE_DR3D, XML_SHADOW_SLANT, aStr); + mrExport.AddAttribute(XML_NAMESPACE_DR3D, XML_SHADOW_SLANT, OUString::number((sal_Int32)nShadowSlant)); // shadeMode aAny = xPropSet->getPropertyValue("D3DSceneShadeMode"); @@ -4656,9 +4654,9 @@ void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< bean { if ( nIdx ) aStrBuffer.append(' '); - ::sax::Converter::convertNumber( aStrBuffer, aSubViewSizes[nIdx].Width ); + aStrBuffer.append( aSubViewSizes[nIdx].Width ); aStrBuffer.append(' '); - ::sax::Converter::convertNumber( aStrBuffer, aSubViewSizes[nIdx].Height ); + aStrBuffer.append( aSubViewSizes[nIdx].Height ); } aStr = aStrBuffer.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW_EXT, XML_SUB_VIEW_SIZE, aStr ); @@ -4818,13 +4816,13 @@ void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< bean else { rAdj.Value >>= nValue; - ::sax::Converter::convertNumber(aStrBuffer, nValue); + aStrBuffer.append(nValue); } } else { // this should not be, but better than setting nothing - ::sax::Converter::convertNumber( aStrBuffer, 0 ); + aStrBuffer.append("0"); } } aStr = aStrBuffer.makeStringAndClear(); diff --git a/xmloff/source/forms/formattributes.cxx b/xmloff/source/forms/formattributes.cxx index aeed736998c2..323dde98333e 100644 --- a/xmloff/source/forms/formattributes.cxx +++ b/xmloff/source/forms/formattributes.cxx @@ -243,18 +243,14 @@ namespace xmloff const sal_Char* _pAttributeName, const OUString& _rPropertyName, const sal_Int16 _nAttributeDefault) { - OUStringBuffer aDefault; - ::sax::Converter::convertNumber(aDefault, (sal_Int32)_nAttributeDefault); - implAdd(_pAttributeName, _rPropertyName, ::cppu::UnoType<sal_Int16>::get(), aDefault.makeStringAndClear()); + implAdd(_pAttributeName, _rPropertyName, ::cppu::UnoType<sal_Int16>::get(), OUString::number(_nAttributeDefault)); } void OAttribute2Property::addInt32Property( const sal_Char* _pAttributeName, const OUString& _rPropertyName, const sal_Int32 _nAttributeDefault) { - OUStringBuffer aDefault; - ::sax::Converter::convertNumber( aDefault, _nAttributeDefault ); - implAdd( _pAttributeName, _rPropertyName, ::cppu::UnoType<sal_Int32>::get(), aDefault.makeStringAndClear() ); + implAdd( _pAttributeName, _rPropertyName, ::cppu::UnoType<sal_Int32>::get(), OUString::number( _nAttributeDefault ) ); } void OAttribute2Property::addEnumProperty( diff --git a/xmloff/source/forms/propertyexport.cxx b/xmloff/source/forms/propertyexport.cxx index 650bf60b61fe..b365d66f40e0 100644 --- a/xmloff/source/forms/propertyexport.cxx +++ b/xmloff/source/forms/propertyexport.cxx @@ -314,10 +314,7 @@ namespace xmloff if (force || _nDefault != nCurrentValue) { // let the formatter of the export context build a string - OUStringBuffer sBuffer; - ::sax::Converter::convertNumber(sBuffer, (sal_Int32)nCurrentValue); - - AddAttribute(_nNamespaceKey, _pAttributeName, sBuffer.makeStringAndClear()); + AddAttribute(_nNamespaceKey, _pAttributeName, OUString::number(nCurrentValue)); } // the property does not need to be handled anymore @@ -337,10 +334,7 @@ namespace xmloff if ( _nDefault != nCurrentValue ) { // let the formatter of the export context build a string - OUStringBuffer sBuffer; - ::sax::Converter::convertNumber( sBuffer, nCurrentValue ); - - AddAttribute( _nNamespaceKey, _pAttributeName, sBuffer.makeStringAndClear() ); + AddAttribute( _nNamespaceKey, _pAttributeName, OUString::number(nCurrentValue) ); } // the property does not need to be handled anymore @@ -536,21 +530,21 @@ namespace xmloff case TypeClass_SHORT: case TypeClass_LONG: // let the unit converter format is as string - ::sax::Converter::convertNumber(aBuffer, getINT32(_rValue)); + aBuffer.append(getINT32(_rValue)); break; case TypeClass_UNSIGNED_LONG: case TypeClass_HYPER: - ::sax::Converter::convertNumber(aBuffer, getINT64(_rValue)); + aBuffer.append(getINT64(_rValue)); break; case TypeClass_UNSIGNED_HYPER: - ::sax::Converter::convertNumber(aBuffer, _rValue.get<sal_uInt64>()); + aBuffer.append(OUString::number(_rValue.get<sal_uInt64>())); break; case TypeClass_ENUM: { // convert it into an int32 sal_Int32 nValue = 0; ::cppu::enum2int(nValue, _rValue); - ::sax::Converter::convertNumber(aBuffer, nValue); + aBuffer.append(nValue); } break; default: diff --git a/xmloff/source/style/HatchStyle.cxx b/xmloff/source/style/HatchStyle.cxx index ea7999f0ac27..99dddb2e692c 100644 --- a/xmloff/source/style/HatchStyle.cxx +++ b/xmloff/source/style/HatchStyle.cxx @@ -206,9 +206,7 @@ void XMLHatchStyleExport::exportXML( rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_HATCH_DISTANCE, aStrValue ); // Angle - ::sax::Converter::convertNumber(aOut, sal_Int32(aHatch.Angle)); - aStrValue = aOut.makeStringAndClear(); - rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_ROTATION, aStrValue ); + rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_ROTATION, OUString::number(aHatch.Angle) ); // Do Write SvXMLElementExport rElem( rExport, XML_NAMESPACE_DRAW, XML_HATCH, diff --git a/xmloff/source/style/PageMasterPropHdl.cxx b/xmloff/source/style/PageMasterPropHdl.cxx index 6099d4789c68..86d8829f70ae 100644 --- a/xmloff/source/style/PageMasterPropHdl.cxx +++ b/xmloff/source/style/PageMasterPropHdl.cxx @@ -260,9 +260,7 @@ bool XMLPMPropHdl_PaperTrayNumber::exportXML( rStrExpValue = GetXMLToken( XML_DEFAULT ); else { - OUStringBuffer aBuffer; - ::sax::Converter::convertNumber( aBuffer, nPaperTray ); - rStrExpValue = aBuffer.makeStringAndClear(); + rStrExpValue = OUString::number( nPaperTray ); } bRet = true; } diff --git a/xmloff/source/style/weighhdl.cxx b/xmloff/source/style/weighhdl.cxx index 3182291806a5..7181dbcd13a6 100644 --- a/xmloff/source/style/weighhdl.cxx +++ b/xmloff/source/style/weighhdl.cxx @@ -141,16 +141,12 @@ bool XMLFontWeightPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, } } - OUStringBuffer aOut; - if( 400 == nWeight ) - aOut.append( GetXMLToken(XML_WEIGHT_NORMAL) ); + rStrExpValue = GetXMLToken(XML_WEIGHT_NORMAL); else if( 700 == nWeight ) - aOut.append( GetXMLToken(XML_WEIGHT_BOLD) ); + rStrExpValue = GetXMLToken(XML_WEIGHT_BOLD); else - ::sax::Converter::convertNumber( aOut, (sal_Int32)nWeight ); - - rStrExpValue = aOut.makeStringAndClear(); + rStrExpValue = OUString::number( nWeight ); } return bRet; diff --git a/xmloff/source/style/xmlbahdl.cxx b/xmloff/source/style/xmlbahdl.cxx index 6ae285f78ad8..bacc2bc1e9ee 100644 --- a/xmloff/source/style/xmlbahdl.cxx +++ b/xmloff/source/style/xmlbahdl.cxx @@ -102,12 +102,10 @@ bool XMLNumberPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, con { bool bRet = false; sal_Int32 nValue; - OUStringBuffer aOut; if( lcl_xmloff_getAny( rValue, nValue, nBytes ) ) { - ::sax::Converter::convertNumber( aOut, nValue ); - rStrExpValue = aOut.makeStringAndClear(); + rStrExpValue = OUString::number( nValue ); bRet = true; } @@ -159,19 +157,15 @@ bool XMLNumberNonePropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, if( lcl_xmloff_getAny( rValue, nValue, nBytes ) ) { - OUStringBuffer aOut; - if( nValue == 0 ) { - aOut.append( sZeroStr ); + rStrExpValue = sZeroStr; } else { - ::sax::Converter::convertNumber( aOut, nValue ); + rStrExpValue = OUString::number( nValue ); } - rStrExpValue = aOut.makeStringAndClear(); - bRet = true; } @@ -842,9 +836,7 @@ bool XMLNumberWithoutZeroPropHdl::exportXML( OUString& rStrExpValue, const Any& if( bRet ) { - OUStringBuffer aBuffer; - ::sax::Converter::convertNumber( aBuffer, nValue ); - rStrExpValue = aBuffer.makeStringAndClear(); + rStrExpValue = OUString::number(nValue); } return bRet; @@ -885,9 +877,7 @@ bool XMLNumberWithAutoInsteadZeroPropHdl::exportXML( OUString& rStrExpValue, con rStrExpValue = GetXMLToken( XML_AUTO ); else { - OUStringBuffer aBuffer; - ::sax::Converter::convertNumber( aBuffer, nValue ); - rStrExpValue = aBuffer.makeStringAndClear(); + rStrExpValue = OUString::number(nValue); } return true; diff --git a/xmloff/source/text/XMLIndexMarkExport.cxx b/xmloff/source/text/XMLIndexMarkExport.cxx index 75c027843b96..08ae8f57ef2d 100644 --- a/xmloff/source/text/XMLIndexMarkExport.cxx +++ b/xmloff/source/text/XMLIndexMarkExport.cxx @@ -173,10 +173,8 @@ void XMLIndexMarkExport::ExportTOCMarkAttributes( sal_Int16 nLevel = 0; Any aAny = rPropSet->getPropertyValue(sLevel); aAny >>= nLevel; - OUStringBuffer sBuf; - ::sax::Converter::convertNumber(sBuf, static_cast<sal_Int32>(nLevel + 1)); rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_OUTLINE_LEVEL, - sBuf.makeStringAndClear()); + OUString::number(nLevel + 1)); } static void lcl_ExportPropertyString( SvXMLExport& rExport, diff --git a/xmloff/source/text/XMLLineNumberingExport.cxx b/xmloff/source/text/XMLLineNumberingExport.cxx index 93f808e07322..b0d0435213b4 100644 --- a/xmloff/source/text/XMLLineNumberingExport.cxx +++ b/xmloff/source/text/XMLLineNumberingExport.cxx @@ -153,11 +153,8 @@ void XMLLineNumberingExport::Export() aAny = xLineNumbering->getPropertyValue("Interval"); sal_Int16 nLineInterval = 0; aAny >>= nLineInterval; - OUStringBuffer sBuf; - ::sax::Converter::convertNumber(sBuf, - (sal_Int32)nLineInterval); rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_INCREMENT, - sBuf.makeStringAndClear()); + OUString::number(nLineInterval)); SvXMLElementExport aConfigElem(rExport, XML_NAMESPACE_TEXT, XML_LINENUMBERING_CONFIGURATION, @@ -174,10 +171,8 @@ void XMLLineNumberingExport::Export() aAny = xLineNumbering->getPropertyValue("SeparatorInterval"); sal_Int16 nLineDistance = 0; aAny >>= nLineDistance; - ::sax::Converter::convertNumber(sBuf, - (sal_Int32)nLineDistance); rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_INCREMENT, - sBuf.makeStringAndClear()); + OUString::number(nLineDistance)); SvXMLElementExport aSeparatorElem(rExport, XML_NAMESPACE_TEXT, XML_LINENUMBERING_SEPARATOR, diff --git a/xmloff/source/text/XMLSectionExport.cxx b/xmloff/source/text/XMLSectionExport.cxx index 791ceca006b3..b61732701f7b 100644 --- a/xmloff/source/text/XMLSectionExport.cxx +++ b/xmloff/source/text/XMLSectionExport.cxx @@ -506,11 +506,9 @@ void XMLSectionExport::ExportTableOfContentStart( sal_Int16 nLevel = sal_Int16(); if( rPropertySet->getPropertyValue("Level") >>= nLevel ) { - OUStringBuffer sBuffer; - ::sax::Converter::convertNumber(sBuffer, (sal_Int32)nLevel); GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_OUTLINE_LEVEL, - sBuffer.makeStringAndClear()); + OUString::number(nLevel)); } // use outline level @@ -1495,12 +1493,10 @@ void XMLSectionExport::ExportLevelParagraphStyles( if (nNamesCount > 0) { // level attribute; we count 1..10; API 0..9 - OUStringBuffer sBuf; sal_Int32 nLevelPlusOne = nLevel + 1; - ::sax::Converter::convertNumber(sBuf, nLevelPlusOne); GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_OUTLINE_LEVEL, - sBuf.makeStringAndClear()); + OUString::number(nLevelPlusOne)); // source styles element SvXMLElementExport aParaStyles(GetExport(), diff --git a/xmloff/source/text/XMLSectionFootnoteConfigExport.cxx b/xmloff/source/text/XMLSectionFootnoteConfigExport.cxx index 4d2e3b21b866..f68df46427dd 100644 --- a/xmloff/source/text/XMLSectionFootnoteConfigExport.cxx +++ b/xmloff/source/text/XMLSectionFootnoteConfigExport.cxx @@ -137,10 +137,8 @@ void XMLSectionFootnoteConfigExport::exportXML( if (bNumRestart) { // restart number is stored as 0.., but interpreted as 1.. - ::sax::Converter::convertNumber(sBuf, - (sal_Int32)(nNumRestartAt+1)); rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_START_VALUE, - sBuf.makeStringAndClear()); + OUString::number(nNumRestartAt+1)); } if (bNumOwn) diff --git a/xmloff/source/text/XMLTextColumnsExport.cxx b/xmloff/source/text/XMLTextColumnsExport.cxx index 607a5935caa1..ccfdea983c43 100644 --- a/xmloff/source/text/XMLTextColumnsExport.cxx +++ b/xmloff/source/text/XMLTextColumnsExport.cxx @@ -66,9 +66,8 @@ void XMLTextColumnsExport::exportXML( const Any& rAny ) sal_Int32 nCount = aColumns.getLength(); OUStringBuffer sValue; - ::sax::Converter::convertNumber( sValue, (nCount) ? nCount : 1 ); GetExport().AddAttribute( XML_NAMESPACE_FO, XML_COLUMN_COUNT, - sValue.makeStringAndClear() ); + OUString::number(nCount ? nCount : 1) ); // handle 'automatic' columns Reference < XPropertySet > xPropSet( xColumns, UNO_QUERY ); @@ -169,10 +168,8 @@ void XMLTextColumnsExport::exportXML( const Any& rAny ) while( nCount-- ) { // style:rel-width - ::sax::Converter::convertNumber( sValue, pColumns->Width ); - sValue.append( '*' ); GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_REL_WIDTH, - sValue.makeStringAndClear() ); + OUString::number(pColumns->Width) + "*" ); // fo:margin-left GetExport().GetMM100UnitConverter().convertMeasureToXML( sValue, diff --git a/xmloff/source/text/txtdrope.cxx b/xmloff/source/text/txtdrope.cxx index 9e69fae2894c..1ae319fffa2a 100644 --- a/xmloff/source/text/txtdrope.cxx +++ b/xmloff/source/text/txtdrope.cxx @@ -55,9 +55,8 @@ void XMLTextDropCapExport::exportXML( const Any& rAny, SvXMLUnitConverter& rUnitConv = rExport.GetMM100UnitConverter(); // style:lines - ::sax::Converter::convertNumber( sBuffer, (sal_Int32)aFormat.Lines ); rExport.AddAttribute( XML_NAMESPACE_STYLE, XML_LINES, - sBuffer.makeStringAndClear() ); + OUString::number( aFormat.Lines ) ); // style:length if( bWholeWord ) @@ -66,8 +65,7 @@ void XMLTextDropCapExport::exportXML( const Any& rAny, } else if( aFormat.Count > 1 ) { - ::sax::Converter::convertNumber(sBuffer, (sal_Int32)aFormat.Count); - sValue = sBuffer.makeStringAndClear(); + sValue = OUString::number(aFormat.Count); } if( !sValue.isEmpty() ) rExport.AddAttribute( XML_NAMESPACE_STYLE, XML_LENGTH, sValue ); diff --git a/xmloff/source/text/txtftne.cxx b/xmloff/source/text/txtftne.cxx index 18333c9bb3de..e504539ece06 100644 --- a/xmloff/source/text/txtftne.cxx +++ b/xmloff/source/text/txtftne.cxx @@ -308,9 +308,8 @@ void XMLTextParagraphExport::exportTextFootnoteConfigurationHelper( aAny = rFootnoteConfig->getPropertyValue(sStartAt); sal_Int16 nOffset = 0; aAny >>= nOffset; - ::sax::Converter::convertNumber(sBuffer, (sal_Int32)nOffset); GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_START_VALUE, - sBuffer.makeStringAndClear()); + OUString::number(nOffset)); // some properties are for footnotes only if (!bIsEndnote) diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 4468ea57c055..cd92849fa1ea 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -2592,9 +2592,8 @@ XMLShapeExportFlags XMLTextParagraphExport::addTextFrameAttributes( rPropSet->getPropertyValue( sAnchorPageNo ) >>= nPage; SAL_WARN_IF(nPage <= 0, "xmloff", "ERROR: writing invalid anchor-page-number 0"); - ::sax::Converter::convertNumber( sValue, (sal_Int32)nPage ); GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_ANCHOR_PAGE_NUMBER, - sValue.makeStringAndClear() ); + OUString::number( nPage ) ); } else { @@ -2752,9 +2751,8 @@ XMLShapeExportFlags XMLTextParagraphExport::addTextFrameAttributes( rPropSet->getPropertyValue( sZOrder ) >>= nZIndex; if( -1 != nZIndex ) { - ::sax::Converter::convertNumber( sValue, nZIndex ); GetExport().AddAttribute( XML_NAMESPACE_DRAW, XML_ZINDEX, - sValue.makeStringAndClear() ); + OUString::number( nZIndex ) ); } } @@ -3065,7 +3063,7 @@ void XMLTextParagraphExport::_exportTextGraphic( OUStringBuffer sRet( GetXMLToken(XML_ROTATE).getLength()+4 ); sRet.append( GetXMLToken(XML_ROTATE)); sRet.append( '(' ); - ::sax::Converter::convertNumber( sRet, (sal_Int32)nVal ); + sRet.append( nVal ); sRet.append( ')' ); GetExport().AddAttribute( XML_NAMESPACE_SVG, XML_TRANSFORM, sRet.makeStringAndClear() ); diff --git a/xmloff/source/text/txtprhdl.cxx b/xmloff/source/text/txtprhdl.cxx index a19f05f331c1..d29452b7de3a 100644 --- a/xmloff/source/text/txtprhdl.cxx +++ b/xmloff/source/text/txtprhdl.cxx @@ -1077,9 +1077,7 @@ bool XMLTextRotationAnglePropHdl_Impl::exportXML( bool bRet = ( rValue >>= nAngle ); if( bRet ) { - OUStringBuffer aOut; - ::sax::Converter::convertNumber( aOut, nAngle / 10 ); - rStrExpValue = aOut.makeStringAndClear(); + rStrExpValue = OUString::number( nAngle / 10 ); } OSL_ENSURE( bRet, "illegal rotation angle" ); @@ -1123,9 +1121,7 @@ bool XMLNumber8OneBasedHdl::exportXML( bool bRet = ( rValue >>= nValue ); if( bRet ) { - OUStringBuffer aOut; - ::sax::Converter::convertNumber( aOut, nValue + 1 ); - rStrExpValue = aOut.makeStringAndClear(); + rStrExpValue = OUString::number( nValue + 1 ); } return bRet; } diff --git a/xmloff/source/transform/StyleOOoTContext.cxx b/xmloff/source/transform/StyleOOoTContext.cxx index 077e7b0a84c9..1a8c9ce1e3f4 100644 --- a/xmloff/source/transform/StyleOOoTContext.cxx +++ b/xmloff/source/transform/StyleOOoTContext.cxx @@ -989,13 +989,11 @@ void XMLPropertiesOOoTContext_Impl::StartElement( sal_Int32 nIntervalMinorDivisor = static_cast< sal_Int32 >( ::rtl::math::round( fIntervalMajor / fIntervalMinor )); - OUStringBuffer aBuf; - ::sax::Converter::convertNumber( aBuf, nIntervalMinorDivisor ); pIntervalMinorDivisorContext->AddAttribute( GetTransformer().GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_CHART, GetXMLToken( XML_INTERVAL_MINOR_DIVISOR )), - aBuf.makeStringAndClear()); + OUString::number( nIntervalMinorDivisor )); } } } diff --git a/xmloff/source/xforms/xformsexport.cxx b/xmloff/source/xforms/xformsexport.cxx index 8f19b53910e2..3e5aa06bf7ab 100644 --- a/xmloff/source/xforms/xformsexport.cxx +++ b/xmloff/source/xforms/xformsexport.cxx @@ -132,7 +132,11 @@ void xforms_formatDate( OUStringBuffer& aBuffer, const util::Date& aDate ); void xforms_formatTime( OUStringBuffer& aBuffer, const css::util::Time& aTime ); void xforms_formatDateTime( OUStringBuffer& aBuffer, const util::DateTime& aDateTime ); -convert_t const xforms_int32 = &xforms_convert<sal_Int32,&::sax::Converter::convertNumber>; +static void convertNumber(OUStringBuffer & b, sal_Int32 n) { + b.append(n); +} + +convert_t const xforms_int32 = &xforms_convert<sal_Int32,&convertNumber>; convert_t const xforms_double = &xforms_convert<double,&::sax::Converter::convertDouble>; convert_t const xforms_dateTime = &xforms_convertRef<util::DateTime,&xforms_formatDateTime>; convert_t const xforms_date = &xforms_convertRef<util::Date,&xforms_formatDate>; |