diff options
author | Jelle van der Waa <jelle@vdwaa.nl> | 2013-08-09 17:07:04 +0200 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2013-08-19 15:50:01 +0000 |
commit | fa0e48c5e4ffc2bf05a60ce0e878073643db8cbe (patch) | |
tree | a7e44df2a84103097b696e87864967a167299f5f /xmloff/source | |
parent | c8e39e66528affb66f1ae121fa36dd4ab31a9b0b (diff) |
fdo#57950: Remove some chained appends in xmloff
Change-Id: Iff0c43d190e6afa26c23416db4da9843cf7f41a5
Reviewed-on: https://gerrit.libreoffice.org/5327
Reviewed-by: Petr Mladek <pmladek@suse.cz>
Tested-by: Petr Mladek <pmladek@suse.cz>
Diffstat (limited to 'xmloff/source')
-rw-r--r-- | xmloff/source/core/RDFaExportHelper.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/core/nmspmap.cxx | 10 | ||||
-rw-r--r-- | xmloff/source/draw/animationexport.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/draw/shapeexport2.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/draw/shapeexport4.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/forms/propertyexport.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/style/xmlbahdl.cxx | 8 | ||||
-rw-r--r-- | xmloff/source/style/xmlexppr.cxx | 8 | ||||
-rw-r--r-- | xmloff/source/style/xmlnumfi.cxx | 11 | ||||
-rw-r--r-- | xmloff/source/text/txtprhdl.cxx | 14 | ||||
-rw-r--r-- | xmloff/source/transform/TransformerBase.cxx | 5 | ||||
-rw-r--r-- | xmloff/source/xforms/xformsexport.cxx | 8 |
12 files changed, 21 insertions, 67 deletions
diff --git a/xmloff/source/core/RDFaExportHelper.cxx b/xmloff/source/core/RDFaExportHelper.cxx index d2b830fead3f..29047f8be210 100644 --- a/xmloff/source/core/RDFaExportHelper.cxx +++ b/xmloff/source/core/RDFaExportHelper.cxx @@ -151,13 +151,9 @@ RDFaExportHelper::AddRDFa( { throw uno::RuntimeException(); } - static const sal_Unicode s_OpenBracket ('['); - static const sal_Unicode s_CloseBracket(']'); const OUString about( xSubjectURI.is() ? getRelativeReference(m_rExport, xSubjectURI->getStringValue()) - : OUStringBuffer().append(s_OpenBracket).append( - LookupBlankNode(xSubjectBNode)).append(s_CloseBracket) - .makeStringAndClear() + : "[" + LookupBlankNode(xSubjectBNode) + "]" ); const uno::Reference<rdf::XLiteral> xContent( diff --git a/xmloff/source/core/nmspmap.cxx b/xmloff/source/core/nmspmap.cxx index 03e5e13edd08..44eb2351f521 100644 --- a/xmloff/source/core/nmspmap.cxx +++ b/xmloff/source/core/nmspmap.cxx @@ -548,13 +548,11 @@ sal_Bool SvXMLNamespaceMap::NormalizeOasisURN( OUString& rName ) return sal_False; // replace [tcid] with current TCID and version with current version. - OUStringBuffer aNewName( nNameLen +20 ); - aNewName.append( rName.copy( 0, nTCIdStart ) ); - aNewName.append( GetXMLToken( XML_OPENDOCUMENT ) ); - aNewName.append( rName.copy( nTCIdEnd, nVersionStart-nTCIdEnd ) ); - aNewName.append( GetXMLToken( XML_1_0 ) ); - rName = aNewName.makeStringAndClear(); + rName = rName.copy( 0, nTCIdStart ) + + GetXMLToken( XML_OPENDOCUMENT ) + + rName.copy( nTCIdEnd, nVersionStart-nTCIdEnd ) + + GetXMLToken( XML_1_0 ); return sal_True; } diff --git a/xmloff/source/draw/animationexport.cxx b/xmloff/source/draw/animationexport.cxx index 14a63c392db1..3ccb7e1ec95c 100644 --- a/xmloff/source/draw/animationexport.cxx +++ b/xmloff/source/draw/animationexport.cxx @@ -1247,9 +1247,7 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat if( !sTmp.isEmpty() ) sTmp.append( (sal_Unicode)';' ); - sTmp.append( p->Time ); - sTmp.append( (sal_Unicode)',' ); - sTmp.append( p->Progress ); + sTmp.append( OUString::number(p->Time) + "," + OUString::number(p->Progress) ); p++; } diff --git a/xmloff/source/draw/shapeexport2.cxx b/xmloff/source/draw/shapeexport2.cxx index f9071211b1e1..70593e608879 100644 --- a/xmloff/source/draw/shapeexport2.cxx +++ b/xmloff/source/draw/shapeexport2.cxx @@ -500,12 +500,8 @@ void XMLShapeExport::ImpExportEvents( const uno::Reference< drawing::XShape >& x (aStrLibrary.equalsIgnoreAsciiCase("StarOffice") || aStrLibrary.equalsIgnoreAsciiCase("application") ) ? XML_APPLICATION : XML_DOCUMENT ) ); - OUStringBuffer sTmp( sLocation.getLength() + aStrMacro.getLength() + 1 ); - sTmp = sLocation; - sTmp.append( sal_Unicode( ':' ) ); - sTmp.append( aStrMacro ); mrExport.AddAttribute(XML_NAMESPACE_SCRIPT, XML_MACRO_NAME, - sTmp.makeStringAndClear()); + sLocation + ":" + aStrMacro); } else { diff --git a/xmloff/source/draw/shapeexport4.cxx b/xmloff/source/draw/shapeexport4.cxx index a87f73f5c597..111f0151a222 100644 --- a/xmloff/source/draw/shapeexport4.cxx +++ b/xmloff/source/draw/shapeexport4.cxx @@ -92,9 +92,7 @@ void ExportParameter( OUStringBuffer& rStrBuffer, const com::sun::star::drawing: { case com::sun::star::drawing::EnhancedCustomShapeParameterType::EQUATION : { - rStrBuffer.append( (sal_Unicode)'?' ); - rStrBuffer.append( (sal_Unicode)'f' ); - rStrBuffer.append( OUString::valueOf( nValue ) ); + rStrBuffer.append( "?f" + OUString::number( nValue ) ); } break; diff --git a/xmloff/source/forms/propertyexport.cxx b/xmloff/source/forms/propertyexport.cxx index fa960c9d1646..c5727fa474d3 100644 --- a/xmloff/source/forms/propertyexport.cxx +++ b/xmloff/source/forms/propertyexport.cxx @@ -674,9 +674,7 @@ namespace xmloff // the property must exist if (!m_xPropertyInfo->hasPropertyByName(_rPropertyName)) { - OStringBuffer aBuf("OPropertyExport::dbg_implCheckProperty: no property with the name "); - aBuf.append(OUStringToOString(_rPropertyName, RTL_TEXTENCODING_ASCII_US)).append('!'); - OSL_FAIL(aBuf.getStr()); + OSL_FAIL("OPropertyExport::dbg_implCheckProperty: no property with the name " + OUStringToOString(_rPropertyName, RTL_TEXTENCODING_ASCII_US) + "!"); return; } diff --git a/xmloff/source/style/xmlbahdl.cxx b/xmloff/source/style/xmlbahdl.cxx index bad015ca3d0c..364121b12e9b 100644 --- a/xmloff/source/style/xmlbahdl.cxx +++ b/xmloff/source/style/xmlbahdl.cxx @@ -500,13 +500,7 @@ sal_Bool XMLColorPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, Sequence< double > aHSL; if( (rValue >>= aHSL) && (aHSL.getLength() == 3) ) { - aOut.append( OUString("hsl(") ); - aOut.append( aHSL[0] ); - aOut.append( OUString(",") ); - aOut.append( aHSL[1] * 100.0 ); - aOut.append( OUString("%,") ); - aOut.append( aHSL[2] * 100.0 ); - aOut.append( OUString("%)") ); + aOut.append( "hsl(" + OUString::number(aHSL[0]) + "," + OUString::number(aHSL[1] * 100.0) + "%," + OUString::number(aHSL[2] * 100.0) + "%)" ); rStrExpValue = aOut.makeStringAndClear(); bRet = sal_True; diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx index 4d27c6921590..6888f6e01594 100644 --- a/xmloff/source/style/xmlexppr.cxx +++ b/xmloff/source/style/xmlexppr.cxx @@ -971,9 +971,7 @@ void SvXMLExportPropertyMapper::_exportXML( sPrefix = pNamespaceMap->GetPrefixByKey( nKey ); } // In any case, the attribute name has to be adapted. - sNameBuffer.append( sPrefix ); - sNameBuffer.append( sal_Unicode(':') ); - sNameBuffer.append( pAttribName->copy( nColonPos+1 ) ); + sNameBuffer.append( sPrefix + ":" + pAttribName->copy( nColonPos+1 ) ); sAttribName = sNameBuffer.makeStringAndClear(); } @@ -985,9 +983,7 @@ void SvXMLExportPropertyMapper::_exportXML( pNamespaceMap = pNewNamespaceMap; } pNewNamespaceMap->Add( sPrefix, sNamespace ); - sNameBuffer.append( GetXMLToken(XML_XMLNS) ); - sNameBuffer.append( sal_Unicode(':') ); - sNameBuffer.append( sPrefix ); + sNameBuffer.append( GetXMLToken(XML_XMLNS) + ":" + sPrefix ); rAttrList.AddAttribute( sNameBuffer.makeStringAndClear(), sNamespace ); } diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index bf2b24500b02..601771e020f8 100644 --- a/xmloff/source/style/xmlnumfi.cxx +++ b/xmloff/source/style/xmlnumfi.cxx @@ -1926,8 +1926,7 @@ void SvXMLNumFormatContext::AddCurrency( const OUString& rContent, LanguageType if ( nLang != LANGUAGE_SYSTEM ) { // '-' sign and language code in hex: - aFormatCode.append( (sal_Unicode) '-' ); - aFormatCode.append(OUString::valueOf(sal_Int32(nLang), 16).toAsciiUpperCase()); + aFormatCode.append("-" + OUString::number(sal_Int32(nLang), 16).toAsciiUpperCase()); } aFormatCode.append( (sal_Unicode) ']' ); // end of "new" currency symbol @@ -1958,9 +1957,7 @@ void SvXMLNumFormatContext::AddNfKeyword( sal_uInt16 nIndex ) if ( !bTruncate && !bHasDateTime ) { // with truncate-on-overflow = false, add "[]" to first time part - aFormatCode.append( (sal_Unicode)'[' ); - aFormatCode.append( sKeyword ); - aFormatCode.append( (sal_Unicode)']' ); + aFormatCode.append("[" + sKeyword + "]"); } else { @@ -2080,9 +2077,7 @@ void SvXMLNumFormatContext::AddCondition( const sal_Int32 nIndex ) sRealCond = sRealCond.replaceAt( nPos, 1, rDecSep ); } } - aConditions.append( (sal_Unicode) '[' ); - aConditions.append( sRealCond ); - aConditions.append( (sal_Unicode) ']' ); + aConditions.append("[" + sRealCond + "]"); } const SvNumberformat* pFormat = pFormatter->GetEntry(l_nKey); diff --git a/xmloff/source/text/txtprhdl.cxx b/xmloff/source/text/txtprhdl.cxx index 7cd2a7898fa2..07157c89d159 100644 --- a/xmloff/source/text/txtprhdl.cxx +++ b/xmloff/source/text/txtprhdl.cxx @@ -573,12 +573,7 @@ sal_Bool XMLFrameProtectPropHdl_Impl::exportXML( } else { - OUStringBuffer aOut( rStrExpValue.getLength() + 1 + - sVal.getLength() ); - aOut.append( rStrExpValue ); - aOut.append( (sal_Unicode)' ' ); - aOut.append( sVal ); - rStrExpValue = aOut.makeStringAndClear(); + rStrExpValue = rStrExpValue + " " + sVal; } } else if( rStrExpValue.isEmpty() ) @@ -831,12 +826,7 @@ sal_Bool XMLGrfMirrorPropHdl_Impl::exportXML( } else { - OUStringBuffer aOut( rStrExpValue.getLength() + 1 + - sVal.getLength() ); - aOut.append( rStrExpValue ); - aOut.append( (sal_Unicode)' ' ); - aOut.append( sVal ); - rStrExpValue = aOut.makeStringAndClear(); + rStrExpValue = rStrExpValue + " " + sVal; } } else if( rStrExpValue.isEmpty() ) diff --git a/xmloff/source/transform/TransformerBase.cxx b/xmloff/source/transform/TransformerBase.cxx index b24665eac9e7..6863a5ea70dd 100644 --- a/xmloff/source/transform/TransformerBase.cxx +++ b/xmloff/source/transform/TransformerBase.cxx @@ -1222,11 +1222,8 @@ sal_Bool XMLTransformerBase::NegPercent( OUString& rValue ) sal_Int32 nIntVal = 100 - static_cast<sal_Int32>( nVal ); - OUStringBuffer aNewValBuffer; - aNewValBuffer.append( nIntVal ); - aNewValBuffer.append( sal_Unicode('%' ) ); + rValue = OUString::number(nIntVal) + "%"; - rValue = aNewValBuffer.makeStringAndClear(); bRet = sal_True; } diff --git a/xmloff/source/xforms/xformsexport.cxx b/xmloff/source/xforms/xformsexport.cxx index 424baf490933..6b082b492898 100644 --- a/xmloff/source/xforms/xformsexport.cxx +++ b/xmloff/source/xforms/xformsexport.cxx @@ -674,11 +674,9 @@ OUString xforms_bool( const Any& rAny ) void xforms_formatDate( OUStringBuffer& aBuffer, const util::Date& rDate ) { - aBuffer.append( static_cast<sal_Int32>( rDate.Year ) ); - aBuffer.append( sal_Unicode('-') ); - aBuffer.append( static_cast<sal_Int32>( rDate.Month ) ); - aBuffer.append( sal_Unicode('-') ); - aBuffer.append( static_cast<sal_Int32>( rDate.Day ) ); + aBuffer.append(OUString::number(static_cast<sal_Int32>( rDate.Year ) ) + + "-" + OUString::number(static_cast<sal_Int32>( rDate.Month )) + + "-" + OUString::number(static_cast<sal_Int32>( rDate.Day )) ); } void xforms_formatTime( OUStringBuffer& aBuffer, const com::sun::star::util::Time& rTime ) |