diff options
author | Neil Moore <dar13.moore@gmail.com> | 2013-08-09 12:29:54 -0400 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2013-08-10 15:04:11 +0000 |
commit | 6cd939111aaf32a35ffe4eb893115e91df2eb664 (patch) | |
tree | 3dcedbf0b31e0d20de07b75fa06fe64731dd7e15 /forms | |
parent | 9ffa46f008cf650955c6894f065fde02b647d717 (diff) |
BUG:57950 Remove chained appends
Removed some chained OUString::append()'s from forms. OUStringBuffer
could really use a append operator(+=).
Change-Id: I635bdd25da9f09373e686d87a1d198bc09bda906
Reviewed-on: https://gerrit.libreoffice.org/5329
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'forms')
-rw-r--r-- | forms/source/xforms/convert.cxx | 7 | ||||
-rw-r--r-- | forms/source/xforms/model_ui.cxx | 29 | ||||
-rw-r--r-- | forms/source/xforms/submission.cxx | 9 |
3 files changed, 12 insertions, 33 deletions
diff --git a/forms/source/xforms/convert.cxx b/forms/source/xforms/convert.cxx index 651ecc1f89b2..4bdfe219c994 100644 --- a/forms/source/xforms/convert.cxx +++ b/forms/source/xforms/convert.cxx @@ -386,11 +386,8 @@ namespace aDateTime.Minutes, aDateTime.Hours, aDateTime.IsUTC); OUString sTime = lcl_toXSD_UNOTime_typed( aTime ); - OUStringBuffer sInfo; - sInfo.append( sDate ); - sInfo.append( (sal_Unicode) 'T' ); - sInfo.append( sTime ); - return sInfo.makeStringAndClear(); + OUString sRet = sDate + "T" + sTime; + return sRet; } // ------------------------------------------------------------------------ diff --git a/forms/source/xforms/model_ui.cxx b/forms/source/xforms/model_ui.cxx index 4dec45b5bd81..e4b07df13691 100644 --- a/forms/source/xforms/model_ui.cxx +++ b/forms/source/xforms/model_ui.cxx @@ -300,9 +300,7 @@ OUString Model::getNodeDisplayName( const XNode_t& xNode, OUString sContent = xNode->getNodeValue(); if( bDetail || ! lcl_isWhitespace( sContent ) ) { - aBuffer.append( sal_Unicode('"') ); - aBuffer.append( Convert::collapseWhitespace( sContent ) ); - aBuffer.append( sal_Unicode('"') ); + aBuffer = aBuffer + "\"" + Convert::collapseWhitespace( sContent ) + "\""; } } break; @@ -360,18 +358,15 @@ OUString Model::getBindingName( const XPropertySet_t& xBinding, OUString sExpression; xBinding->getPropertyValue( "BindingExpression" ) >>= sExpression; - OUStringBuffer aBuffer; + OUString sRet; if( !sID.isEmpty() ) { - aBuffer.append( sID ); - aBuffer.append( " (" ); - aBuffer.append( sExpression ); - aBuffer.append( ")" ); + sRet = sID + " (" + sExpression + ") "; } else - aBuffer.append( sExpression ); + sRet = sExpression; - return aBuffer.makeStringAndClear(); + return sRet; } OUString Model::getSubmissionName( const XPropertySet_t& xSubmission, @@ -766,18 +761,12 @@ static OUString lcl_serializeForDisplay( const Reference< XAttr >& _rxAttrNode ) OSL_ENSURE( _rxAttrNode.is(), "lcl_serializeForDisplay( attr ): invalid argument!" ); if ( _rxAttrNode.is() ) { - OUStringBuffer aBuffer; - aBuffer.append( _rxAttrNode->getName() ); - aBuffer.appendAscii( "=" ); OUString sValue = _rxAttrNode->getValue(); sal_Unicode nQuote = '"'; if ( sValue.indexOf( nQuote ) >= 0 ) nQuote = '\''; - aBuffer.append( nQuote ); - aBuffer.append( sValue ); - aBuffer.append( nQuote ); - aBuffer.append( (sal_Unicode)' ' ); - sResult = aBuffer.makeStringAndClear(); + + sResult = _rxAttrNode->getName() + "=" + OUString(nQuote) + sValue + OUString(nQuote) + " "; } return sResult; } @@ -884,9 +873,7 @@ static OUString lcl_serializeForDisplay( const Reference<XXPathObject>& xResult break; case XPathObjectType_XPATH_STRING: - aBuffer.append( sal_Unicode('"') ); - aBuffer.append( xResult->getString() ); - aBuffer.append( sal_Unicode('"') ); + aBuffer = aBuffer + "\"" + xResult->getString() + "\""; break; case XPathObjectType_XPATH_NODESET: diff --git a/forms/source/xforms/submission.cxx b/forms/source/xforms/submission.cxx index cc4f53ccf48e..873b6c10467f 100644 --- a/forms/source/xforms/submission.cxx +++ b/forms/source/xforms/submission.cxx @@ -478,13 +478,8 @@ sal_Int64 SAL_CALL Submission::getSomething( static OUString lcl_message( const OUString& rID, const OUString& rText ) { - OUStringBuffer aMessage; - aMessage.append( "XForms submission '" ); - aMessage.append( rID ); - aMessage.append( "' failed" ); - aMessage.append( rText ); - aMessage.append( "." ); - return aMessage.makeStringAndClear(); + OUString aMessage = "XForms submission '" + rID + "' failed" + rText + "."; + return aMessage; } void SAL_CALL Submission::submitWithInteraction( |