summaryrefslogtreecommitdiff
path: root/desktop/source/pkgchk
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 /desktop/source/pkgchk
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 'desktop/source/pkgchk')
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_misc.cxx14
1 files changed, 4 insertions, 10 deletions
diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
index aebf71fc26d1..ff1b9dc6e0bf 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
@@ -356,12 +356,9 @@ Reference<XComponentContext> connectToOffice(
bool verbose )
{
OUString pipeId( ::dp_misc::generateRandomPipeId() );
- OUStringBuffer buf;
- buf.append( "--accept=pipe,name=" );
- buf.append( pipeId );
- buf.append( ";urp;" );
+ OUString acceptArg = "--accept=pipe,name=" + pipeId + ";urp;";
- Sequence<OUString> args { "--nologo", "--nodefault", buf.makeStringAndClear() };
+ Sequence<OUString> args { "--nologo", "--nodefault", acceptArg };
OUString appURL( getExecutableDir() + "/soffice" );
if (verbose)
@@ -377,13 +374,10 @@ Reference<XComponentContext> connectToOffice(
if (verbose)
dp_misc::writeConsole("OK. Connecting...");
- OSL_ASSERT( buf.isEmpty() );
- buf.append( "uno:pipe,name=" );
- buf.append( pipeId );
- buf.append( ";urp;StarOffice.ComponentContext" );
+ OUString sUnoUrl = "uno:pipe,name=" + pipeId + ";urp;StarOffice.ComponentContext";
Reference<XComponentContext> xRet(
::dp_misc::resolveUnoURL(
- buf.makeStringAndClear(), xLocalComponentContext ),
+ sUnoUrl, xLocalComponentContext ),
UNO_QUERY_THROW );
if (verbose)
dp_misc::writeConsole("OK.\n");