summaryrefslogtreecommitdiff
path: root/sd/source/ui/unoidl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-10-14 14:27:57 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-10-15 14:33:57 +0200
commitf13c6ad5f020a196a0e3aa6f28bda3dc185d465b (patch)
treef9aaab122974d36c134fb1723ec3c1c8df51eeef /sd/source/ui/unoidl
parent9270f74466d0eb841babaa24997f608631c70341 (diff)
new loplugin:bufferadd
look for OUStringBuffer append sequences that can be turned into creating an OUString with + operations Change-Id: Ica840dc096000307b4a105fb4d9ec7588a15ade6 Reviewed-on: https://gerrit.libreoffice.org/80809 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source/ui/unoidl')
-rw-r--r--sd/source/ui/unoidl/unoobj.cxx15
-rw-r--r--sd/source/ui/unoidl/unopage.cxx11
2 files changed, 9 insertions, 17 deletions
diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx
index 872c3a71458e..6c728052b2cb 100644
--- a/sd/source/ui/unoidl/unoobj.cxx
+++ b/sd/source/ui/unoidl/unoobj.cxx
@@ -1465,14 +1465,13 @@ uno::Any SAL_CALL SdUnoEventsAccess::getByName( const OUString& aName )
const OUString aModulName = aMacro.getToken(0, '.', nIdx);
const OUString aLibName = aMacro.getToken(0, '.', nIdx);
- OUStringBuffer sBuffer;
- sBuffer.append( aLibName );
- sBuffer.append( '.' );
- sBuffer.append( aModulName );
- sBuffer.append( '.' );
- sBuffer.append( aMacroName );
-
- aAny <<= sBuffer.makeStringAndClear();
+ OUString sBuffer = aLibName +
+ "." +
+ aModulName +
+ "." +
+ aMacroName;
+
+ aAny <<= sBuffer;
pProperties->Name = gaStrMacroName;
pProperties->Handle = -1;
pProperties->Value = aAny;
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 0d6bc61f2dab..ca082fe01c11 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -2103,11 +2103,8 @@ OUString getPageApiName( SdPage const * pPage )
if( aPageName.isEmpty() )
{
- OUStringBuffer sBuffer;
- sBuffer.append( sEmptyPageName );
const sal_Int32 nPageNum = ( ( pPage->GetPageNum() - 1 ) >> 1 ) + 1;
- sBuffer.append( nPageNum );
- aPageName = sBuffer.makeStringAndClear();
+ aPageName = sEmptyPageName + OUString::number( nPageNum );
}
}
@@ -2165,11 +2162,7 @@ OUString getUiNameFromPageApiNameImpl( const OUString& rApiName )
if( nPageNumber != -1)
{
- OUStringBuffer sBuffer;
- sBuffer.append( SdResId(STR_PAGE) );
- sBuffer.append( ' ' );
- sBuffer.append( aNumber );
- return sBuffer.makeStringAndClear();
+ return SdResId(STR_PAGE) + " " + aNumber;
}
}