diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-01 09:26:27 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-02 08:00:10 +0000 |
commit | 1461ebbbb5d47d90e31f0945a4878a68fbee5213 (patch) | |
tree | 5af28d3cdaf4d5195ddf9e69727807ab8104a8e2 /xmloff | |
parent | c0f9bdd3e644e3ebf690aff9eb1aeec4f16dbf27 (diff) |
expand out ::sax::Converter::convertNumber to OUString::number
which results in much simpler code overall, there is no need to go via
an OUStringBuffer all the time
Change-Id: I69eba92c93f471fa9a45f97c29c56dcf3cd1ebf8
Reviewed-on: https://gerrit.libreoffice.org/33773
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
21 files changed, 52 insertions, 114 deletions
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>; |