diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-02 08:59:42 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-02 10:13:12 +0200 |
commit | d5415561e3979d33b2a7e1a06e2d5515a1e1dd33 (patch) | |
tree | 8f0703d728ae02bee930c6de31b4f51a1d4902d9 /forms | |
parent | d3e7bbec20c25bc26b3dadc9791f53239473b13d (diff) |
loplugin:stringloop in various
Change-Id: Ia400e67108e622ae63a8d59667eae96c858f22dc
Reviewed-on: https://gerrit.libreoffice.org/58463
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'forms')
-rw-r--r-- | forms/source/xforms/model_ui.cxx | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/forms/source/xforms/model_ui.cxx b/forms/source/xforms/model_ui.cxx index f6da0ce70803..ba3bbff52191 100644 --- a/forms/source/xforms/model_ui.cxx +++ b/forms/source/xforms/model_ui.cxx @@ -743,7 +743,7 @@ static OUString lcl_serializeForDisplay( const Reference< XAttr >& _rxAttrNode ) static OUString lcl_serializeForDisplay( const Reference<XNodeList>& xNodes ) { - OUString sResult; + OUStringBuffer sResult; // create document fragment Reference<XDocument> xDocument( getDocumentBuilder()->newDocument() ); @@ -770,7 +770,7 @@ static OUString lcl_serializeForDisplay( const Reference<XNodeList>& xNodes ) Reference< XAttr > xAttr( xCurrent, UNO_QUERY ); if ( xAttr.is() ) { - sResult += lcl_serializeForDisplay( xAttr ); + sResult.append(lcl_serializeForDisplay( xAttr )); ++nAttributeNodes; } } @@ -787,7 +787,7 @@ static OUString lcl_serializeForDisplay( const Reference<XNodeList>& xNodes ) "lcl_serializeForDisplay: mixed attribute and non-attribute nodes?" ); if ( nAttributeNodes ) // had only attribute nodes - return sResult; + return sResult.makeStringAndClear(); // serialize fragment CSerializationAppXML aSerialization; @@ -808,20 +808,19 @@ static OUString lcl_serializeForDisplay( const Reference<XNodeList>& xNodes ) // well, the serialization prepends XML header(s) that we need to // remove first. - OUStringBuffer aBuffer; + sResult.setLength(0); while( ! xTextInputStream->isEOF() ) { OUString sLine = xTextInputStream->readLine(); if( !sLine.isEmpty() && !sLine.startsWith( "<?xml" ) ) { - aBuffer.append( sLine ); - aBuffer.append( '\n' ); + sResult.append( sLine ); + sResult.append( '\n' ); } } - sResult = aBuffer.makeStringAndClear(); - return sResult; + return sResult.makeStringAndClear(); } static OUString lcl_serializeForDisplay( const Reference<XXPathObject>& xResult ) |