summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-06-26 13:54:14 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-06-26 13:55:34 +0200
commitcec3fd6de65a0f526c2b990e8dc54935d0a7864a (patch)
tree613719264eddc919fbb1758cdbe48549cbb8f7eb
parentc92853c93e537b75444ea2852777d73390de1b1a (diff)
loplugin:stringconstant: handle OUString+=OUString(literal)
Change-Id: I655751536bd084d01bce436c043eca754c58849f
-rw-r--r--svtools/source/misc/transfer.cxx41
-rw-r--r--svtools/source/urlobj/inetimg.cxx16
2 files changed, 20 insertions, 37 deletions
diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx
index 0de880d74677..cc04d4de0919 100644
--- a/svtools/source/misc/transfer.cxx
+++ b/svtools/source/misc/transfer.cxx
@@ -111,22 +111,17 @@ SvStream& WriteTransferableObjectDescriptor( SvStream& rOStm, const Transferable
static OUString ImplGetParameterString( const TransferableObjectDescriptor& rObjDesc )
{
- const OUString aChar( "\"" );
const OUString aClassName( rObjDesc.maClassName.GetHexName() );
OUString aParams;
if( !aClassName.isEmpty() )
{
- aParams += OUString( ";classname=\"" );
- aParams += aClassName;
- aParams += aChar;
+ aParams += ";classname=\"" + aClassName + "\"";
}
if( !rObjDesc.maTypeName.isEmpty() )
{
- aParams += OUString( ";typename=\"" );
- aParams += rObjDesc.maTypeName;
- aParams += aChar;
+ aParams += ";typename=\"" + rObjDesc.maTypeName + "\"";
}
if( !rObjDesc.maDisplayName.isEmpty() )
@@ -147,30 +142,18 @@ static OUString ImplGetParameterString( const TransferableObjectDescriptor& rObj
pToAccept[nChar] = sal_True;
}
- aParams += OUString( ";displayname=\"" );
- aParams += ::rtl::Uri::encode( rObjDesc.maDisplayName, pToAccept, rtl_UriEncodeIgnoreEscapes, RTL_TEXTENCODING_UTF8 );
- aParams += aChar;
+ aParams += ";displayname=\""
+ + rtl::Uri::encode(
+ rObjDesc.maDisplayName, pToAccept, rtl_UriEncodeIgnoreEscapes,
+ RTL_TEXTENCODING_UTF8)
+ + "\"";
}
- aParams += OUString( ";viewaspect=\"" );
- aParams += OUString::number( rObjDesc.mnViewAspect );
- aParams += aChar;
-
- aParams += OUString( ";width=\"" );
- aParams += OUString::number( rObjDesc.maSize.Width() );
- aParams += aChar;
-
- aParams += OUString( ";height=\"" );
- aParams += OUString::number( rObjDesc.maSize.Height() );
- aParams += aChar;
-
- aParams += OUString( ";posx=\"" );
- aParams += OUString::number( rObjDesc.maDragStartPos.X() );
- aParams += aChar;
-
- aParams += OUString( ";posy=\"" );
- aParams += OUString::number( rObjDesc.maDragStartPos.X() );
- aParams += aChar;
+ aParams += ";viewaspect=\"" + OUString::number(rObjDesc.mnViewAspect)
+ + "\";width=\"" + OUString::number(rObjDesc.maSize.Width())
+ + "\";height=\"" + OUString::number(rObjDesc.maSize.Height())
+ + "\";posx=\"" + OUString::number(rObjDesc.maDragStartPos.X())
+ + "\";posy=\"" + OUString::number(rObjDesc.maDragStartPos.X()) + "\"";
return aParams;
}
diff --git a/svtools/source/urlobj/inetimg.cxx b/svtools/source/urlobj/inetimg.cxx
index 51ef978ee0bb..d1b7fd74717c 100644
--- a/svtools/source/urlobj/inetimg.cxx
+++ b/svtools/source/urlobj/inetimg.cxx
@@ -32,14 +32,14 @@ bool INetImage::Write( SvStream& rOStm, SotClipboardFormatId nFormat ) const
{
case SotClipboardFormatId::INET_IMAGE:
{
- OUString sString;
- (sString += aImageURL ) += OUString(TOKEN_SEPARATOR);
- (sString += aTargetURL ) += OUString(TOKEN_SEPARATOR);
- (sString += aTargetFrame ) += OUString(TOKEN_SEPARATOR);
- (sString += aAlternateText ) += OUString(TOKEN_SEPARATOR);
- sString += OUString::number( aSizePixel.Width() );
- sString += OUString(TOKEN_SEPARATOR);
- sString += OUString::number( aSizePixel.Height() );
+ OUString sString(
+ aImageURL + OUStringLiteral1<TOKEN_SEPARATOR>() + aTargetURL
+ + OUStringLiteral1<TOKEN_SEPARATOR>() + aTargetFrame
+ + OUStringLiteral1<TOKEN_SEPARATOR>() + aAlternateText
+ + OUStringLiteral1<TOKEN_SEPARATOR>()
+ + OUString::number(aSizePixel.Width())
+ + OUStringLiteral1<TOKEN_SEPARATOR>()
+ + OUString::number(aSizePixel.Height()));
OString sOut(OUStringToOString(sString,
RTL_TEXTENCODING_UTF8));