summaryrefslogtreecommitdiff
path: root/idl
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 /idl
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 'idl')
-rw-r--r--idl/source/prj/parser.cxx12
-rw-r--r--idl/source/prj/svidl.cxx18
2 files changed, 14 insertions, 16 deletions
diff --git a/idl/source/prj/parser.cxx b/idl/source/prj/parser.cxx
index c6fa85431f0e..8bb45b10b273 100644
--- a/idl/source/prj/parser.cxx
+++ b/idl/source/prj/parser.cxx
@@ -134,18 +134,18 @@ void SvIdlParser::ReadInclude( SvMetaModule& rModule )
osl::FileBase::RC searchError = osl::File::searchFileURL(aFullName, rBase.GetPath(), aFullName);
if( osl::FileBase::E_None != searchError )
{
- OStringBuffer aStr("cannot find file:");
- aStr.append(OUStringToOString(aFullName, RTL_TEXTENCODING_UTF8));
- throw SvParseException(aStr.makeStringAndClear(), rInStm.GetToken());
+ OString aStr = "cannot find file:" +
+ OUStringToOString(aFullName, RTL_TEXTENCODING_UTF8);
+ throw SvParseException(aStr, rInStm.GetToken());
}
osl::FileBase::getSystemPathFromFileURL( aFullName, aFullName );
rBase.AddDepFile( aFullName );
SvTokenStream aTokStm( aFullName );
if( ERRCODE_NONE != aTokStm.GetStream().GetError() )
{
- OStringBuffer aStr("cannot open file: ");
- aStr.append(OUStringToOString(aFullName, RTL_TEXTENCODING_UTF8));
- throw SvParseException(aStr.makeStringAndClear(), rInStm.GetToken());
+ OString aStr = "cannot open file: " +
+ OUStringToOString(aFullName, RTL_TEXTENCODING_UTF8);
+ throw SvParseException(aStr, rInStm.GetToken());
}
// rescue error from old file
SvIdlError aOldErr = rBase.GetError();
diff --git a/idl/source/prj/svidl.cxx b/idl/source/prj/svidl.cxx
index fcfebed79816..91ad73d19336 100644
--- a/idl/source/prj/svidl.cxx
+++ b/idl/source/prj/svidl.cxx
@@ -95,8 +95,8 @@ static OUString tempFileHelper(OUString const & fname)
}
else
{
- OStringBuffer aStr("invalid filename: ");
- aStr.append(OUStringToOString(fname, RTL_TEXTENCODING_UTF8));
+ OString aStr = "invalid filename: " +
+ OUStringToOString(fname, RTL_TEXTENCODING_UTF8);
fprintf(stderr, "%s\n", aStr.getStr());
}
return aTmpFile;
@@ -134,8 +134,8 @@ int main ( int argc, char ** argv)
if( !pDataBase->WriteSfx( aOutStm ) )
{
nExit = -1;
- OStringBuffer aStr("cannot write slotmap file: ");
- aStr.append(OUStringToOString(aCommand.aSlotMapFile, RTL_TEXTENCODING_UTF8));
+ OString aStr = "cannot write slotmap file: " +
+ OUStringToOString(aCommand.aSlotMapFile, RTL_TEXTENCODING_UTF8);
fprintf(stderr, "%s\n", aStr.getStr());
}
}
@@ -181,12 +181,10 @@ int main ( int argc, char ** argv)
if( bErr )
{
nExit = -1;
- OStringBuffer aStr("cannot move file from: ");
- aStr.append(OUStringToOString(aErrFile2,
- RTL_TEXTENCODING_UTF8));
- aStr.append("\n to file: ");
- aStr.append(OUStringToOString(aErrFile,
- RTL_TEXTENCODING_UTF8));
+ OString aStr = "cannot move file from: " +
+ OUStringToOString(aErrFile2, RTL_TEXTENCODING_UTF8) +
+ "\n to file: " +
+ OUStringToOString(aErrFile, RTL_TEXTENCODING_UTF8);
fprintf( stderr, "%s\n", aStr.getStr() );
}
else