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/source/style | |
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/source/style')
-rw-r--r-- | xmloff/source/style/HatchStyle.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/style/PageMasterPropHdl.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/style/weighhdl.cxx | 10 | ||||
-rw-r--r-- | xmloff/source/style/xmlbahdl.cxx | 20 |
4 files changed, 10 insertions, 28 deletions
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; |