diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-09-30 15:10:42 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-01 08:26:49 +0200 |
commit | 03516c505eced337149782a67b2ad98c246929b3 (patch) | |
tree | c499c7912cf65ebbf13c729782a93adc3f856a55 | |
parent | 9b3643820bf821c8be728ed20a8cb7ed05cabef2 (diff) |
loplugin:stringadd in helpcompiler..oox
Change-Id: I858870d883de10a673d7ce2798bda8c8f511cee5
Reviewed-on: https://gerrit.libreoffice.org/79889
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | helpcompiler/source/HelpLinker.cxx | 6 | ||||
-rw-r--r-- | hwpfilter/source/hwpreader.cxx | 10 | ||||
-rw-r--r-- | i18nlangtag/source/languagetag/languagetag.cxx | 3 | ||||
-rw-r--r-- | idlc/source/options.cxx | 58 | ||||
-rw-r--r-- | io/source/acceptor/acceptor.cxx | 13 | ||||
-rw-r--r-- | io/source/connector/connector.cxx | 10 | ||||
-rw-r--r-- | jvmfwk/source/fwkbase.cxx | 3 | ||||
-rw-r--r-- | l10ntools/source/helper.cxx | 5 | ||||
-rw-r--r-- | l10ntools/source/merge.cxx | 7 | ||||
-rw-r--r-- | lingucomponent/source/languageguessing/guesslang.cxx | 3 | ||||
-rw-r--r-- | linguistic/source/misc.cxx | 4 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwptblformula.cxx | 3 | ||||
-rw-r--r-- | lotuswordpro/source/filter/xfilter/xffont.cxx | 9 | ||||
-rw-r--r-- | oox/source/ole/vbamodule.cxx | 3 | ||||
-rw-r--r-- | oox/source/ppt/pptimport.cxx | 3 |
15 files changed, 51 insertions, 89 deletions
diff --git a/helpcompiler/source/HelpLinker.cxx b/helpcompiler/source/HelpLinker.cxx index b5a488f3dbc0..44444902eb71 100644 --- a/helpcompiler/source/HelpLinker.cxx +++ b/helpcompiler/source/HelpLinker.cxx @@ -737,8 +737,7 @@ void HelpLinker::main( std::vector<std::string> &args, { //This part is used when compileExtensionHelp is called from the extensions manager. //If extension help is compiled using helplinker in the build process - OUString aIdxCaptionPathFileURL( *pOfficeHelpPath ); - aIdxCaptionPathFileURL += "/idxcaption.xsl"; + OUString aIdxCaptionPathFileURL = *pOfficeHelpPath + "/idxcaption.xsl"; OString aOStr_IdxCaptionPathFileURL( OUStringToOString ( aIdxCaptionPathFileURL, fs::getThreadTextEncoding() ) ); @@ -762,8 +761,7 @@ void HelpLinker::main( std::vector<std::string> &args, //If extension help is compiled using helplinker in the build process //then -idxcontent must be supplied //This part is used when compileExtensionHelp is called from the extensions manager. - OUString aIdxContentPathFileURL( *pOfficeHelpPath ); - aIdxContentPathFileURL += "/idxcontent.xsl"; + OUString aIdxContentPathFileURL = *pOfficeHelpPath + "/idxcontent.xsl"; OString aOStr_IdxContentPathFileURL( OUStringToOString ( aIdxContentPathFileURL, fs::getThreadTextEncoding() ) ); diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx index b7978a201936..4144d20e0bde 100644 --- a/hwpfilter/source/hwpreader.cxx +++ b/hwpfilter/source/hwpreader.cxx @@ -2656,11 +2656,11 @@ void HwpReader::makeFStyle(FBoxStyle * fstyle) else if( fstyle->boxtype == 'G' ) { if( fstyle->margin[1][0] || fstyle->margin[1][1] || fstyle->margin[1][2] || fstyle->margin[1][3] ){ - OUString clip = "rect("; - clip += Double2Str(WTMM(-fstyle->margin[1][0]) ) + "mm "; - clip += Double2Str(WTMM(-fstyle->margin[1][1]) ) + "mm "; - clip += Double2Str(WTMM(-fstyle->margin[1][2]) ) + "mm "; - clip += Double2Str(WTMM(-fstyle->margin[1][3]) ) + "mm)"; + OUString clip = "rect(" + + Double2Str(WTMM(-fstyle->margin[1][0]) ) + "mm " + + Double2Str(WTMM(-fstyle->margin[1][1]) ) + "mm " + + Double2Str(WTMM(-fstyle->margin[1][2]) ) + "mm " + + Double2Str(WTMM(-fstyle->margin[1][3]) ) + "mm)"; padd("style:mirror", sXML_CDATA, "none"); padd("fo:clip", sXML_CDATA, clip); } diff --git a/i18nlangtag/source/languagetag/languagetag.cxx b/i18nlangtag/source/languagetag/languagetag.cxx index d0ffdb58cd81..7f580dfc9dd3 100644 --- a/i18nlangtag/source/languagetag/languagetag.cxx +++ b/i18nlangtag/source/languagetag/languagetag.cxx @@ -204,8 +204,7 @@ void LiblangtagDataRef::setupDataPath() // Check if data is in our own installation, else assume system // installation. - OUString aData( aURL); - aData += "/language-subtag-registry.xml"; + OUString aData = aURL + "/language-subtag-registry.xml"; osl::DirectoryItem aDirItem; if (osl::DirectoryItem::get( aData, aDirItem) == osl::DirectoryItem::E_None) { diff --git a/idlc/source/options.cxx b/idlc/source/options.cxx index 4f49cd202de4..bfd273ace1ba 100644 --- a/idlc/source/options.cxx +++ b/idlc/source/options.cxx @@ -371,33 +371,33 @@ bool Options::initOptions(std::vector< std::string > & rArgs) OString Options::prepareHelp() const { - OString help("\nusing: "); - help += m_program + " [-options] <file_1> ... <file_n> | @<filename> | -stdin\n"; - help += " <file_n> = file_n specifies one or more idl files.\n"; - help += " Only files with the extension '.idl' are valid.\n"; - help += " @<filename> = filename specifies the name of a command file.\n"; - help += " -stdin = read idl file from standard input.\n"; - help += " Options:\n"; - help += " -O<path> = path specifies the output directory.\n"; - help += " The generated output is a registry file with\n"; - help += " the same name as the idl input file (or 'stdin'\n"; - help += " for -stdin).\n"; - help += " -M<path> = path specifies the output directory for deps.\n"; - help += " Generate GNU make dependency files with the\n"; - help += " same name as the idl input file.\n"; - help += " -I<path> = path specifies a directory where include\n"; - help += " files will be searched by the preprocessor.\n"; - help += " Multiple directories can be combined with ';'.\n"; - help += " -D<name> = name defines a macro for the preprocessor.\n"; - help += " -C = generate complete type information, including\n"; - help += " documentation.\n"; - help += " -cid = check if identifiers fulfill the UNO naming\n"; - help += " requirements.\n"; - help += " -quiet = no output.\n"; - help += " -verbose = verbose output.\n"; - help += " -w = display warning messages.\n"; - help += " -we = treat warnings as errors.\n"; - help += " -h|-? = print this help message and exit.\n\n"; + OString help = "\nusing: " + + m_program + " [-options] <file_1> ... <file_n> | @<filename> | -stdin\n" + " <file_n> = file_n specifies one or more idl files.\n" + " Only files with the extension '.idl' are valid.\n" + " @<filename> = filename specifies the name of a command file.\n" + " -stdin = read idl file from standard input.\n" + " Options:\n" + " -O<path> = path specifies the output directory.\n" + " The generated output is a registry file with\n" + " the same name as the idl input file (or 'stdin'\n" + " for -stdin).\n" + " -M<path> = path specifies the output directory for deps.\n" + " Generate GNU make dependency files with the\n" + " same name as the idl input file.\n" + " -I<path> = path specifies a directory where include\n" + " files will be searched by the preprocessor.\n" + " Multiple directories can be combined with ';'.\n" + " -D<name> = name defines a macro for the preprocessor.\n" + " -C = generate complete type information, including\n" + " documentation.\n" + " -cid = check if identifiers fulfill the UNO naming\n" + " requirements.\n" + " -quiet = no output.\n" + " -verbose = verbose output.\n" + " -w = display warning messages.\n" + " -we = treat warnings as errors.\n" + " -h|-? = print this help message and exit.\n\n"; help += prepareVersion(); return help; @@ -405,9 +405,7 @@ OString Options::prepareHelp() const OString Options::prepareVersion() const { - OString version(m_program); - version += " Version 1.1\n\n"; - return version; + return m_program + " Version 1.1\n\n"; } diff --git a/io/source/acceptor/acceptor.cxx b/io/source/acceptor/acceptor.cxx index 0606c4f1f248..217c23b9a845 100644 --- a/io/source/acceptor/acceptor.cxx +++ b/io/source/acceptor/acceptor.cxx @@ -92,11 +92,7 @@ namespace io_acceptor : m_pFlag( pFlag ) { if( *m_pFlag ) - { - OUString sMessage( "AlreadyAcceptingException :" ); - sMessage += sConnectionDescription; - throw AlreadyAcceptingException( sMessage ); - } + throw AlreadyAcceptingException( "AlreadyAcceptingException :" + sConnectionDescription ); *m_pFlag = true; } ~BeingInAccept() @@ -186,12 +182,7 @@ namespace io_acceptor _xAcceptor.set(_xSMgr->createInstanceWithContext(delegatee, _xCtx), UNO_QUERY); if(!_xAcceptor.is()) - { - OUString message("Acceptor: unknown delegatee "); - message += delegatee; - - throw ConnectionSetupException(message); - } + throw ConnectionSetupException("Acceptor: unknown delegatee " + delegatee); } } catch (const rtl::MalformedUriException & rEx) diff --git a/io/source/connector/connector.cxx b/io/source/connector/connector.cxx index 1c9619c26352..c21a34d17eac 100644 --- a/io/source/connector/connector.cxx +++ b/io/source/connector/connector.cxx @@ -114,8 +114,7 @@ namespace stoc_connector { OUString sMessage("Connector : couldn't connect to socket ("); OUString sError = pConn->m_socket.getErrorAsString(); - sMessage += sError; - sMessage += ")"; + sMessage += sError + ")"; throw NoConnectException( sMessage ); } // we enable tcpNoDelay for loopback connections because @@ -137,12 +136,7 @@ namespace stoc_connector _xSMgr->createInstanceWithContext(delegatee, _xCtx), UNO_QUERY ); if(!xConnector.is()) - { - OUString message("Connector: unknown delegatee "); - message += delegatee; - - throw ConnectionSetupException(message); - } + throw ConnectionSetupException("Connector: unknown delegatee " + delegatee); sal_Int32 index = sConnectionDescription.indexOf(','); diff --git a/jvmfwk/source/fwkbase.cxx b/jvmfwk/source/fwkbase.cxx index 221e2bef9766..3e17431ebc1c 100644 --- a/jvmfwk/source/fwkbase.cxx +++ b/jvmfwk/source/fwkbase.cxx @@ -461,8 +461,7 @@ OString makeClassPathOption(OUString const & sUserClassPath) sPaths = OUStringToOString( sBufCP.makeStringAndClear(), osl_getThreadTextEncoding()); - OString sOptionClassPath("-Djava.class.path="); - sOptionClassPath += sPaths; + OString sOptionClassPath = "-Djava.class.path=" + sPaths; return sOptionClassPath; } diff --git a/l10ntools/source/helper.cxx b/l10ntools/source/helper.cxx index e84b029869a7..84b454bde587 100644 --- a/l10ntools/source/helper.cxx +++ b/l10ntools/source/helper.cxx @@ -121,12 +121,9 @@ OString UnQuotHTML( const OString& rString ) bool isWellFormedXML( OString const & text ) { xmlDocPtr doc; - OString content; bool result = true; - content = "<root>"; - content += text; - content += "</root>"; + OString content = "<root>" + text + "</root>"; doc = xmlParseMemory(content.getStr(),static_cast<int>(content.getLength())); if (doc == nullptr) { result = false; diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx index aff23bafdd07..aad0388bd23d 100644 --- a/l10ntools/source/merge.cxx +++ b/l10ntools/source/merge.cxx @@ -322,12 +322,7 @@ OString MergeDataFile::CreateKey(const OString& rTYP, const OString& rGID, const OString& rLID, const OString& rFilename, bool bCaseSensitive) { static const char sStroke[] = "-"; - OString sKey( rTYP ); - sKey += sStroke; - sKey += rGID; - sKey += sStroke; - sKey += rLID; - sKey += sStroke; + OString sKey = rTYP + sStroke + rGID + sStroke + rLID + sStroke; sKey += lcl_NormalizeFilename(rFilename); if(bCaseSensitive) return sKey; // officecfg case sensitive identifier diff --git a/lingucomponent/source/languageguessing/guesslang.cxx b/lingucomponent/source/languageguessing/guesslang.cxx index e25d51a413fa..89e16dcfd19b 100644 --- a/lingucomponent/source/languageguessing/guesslang.cxx +++ b/lingucomponent/source/languageguessing/guesslang.cxx @@ -191,8 +191,7 @@ void LangGuess_Impl::SetFingerPrintsDB( { //! text encoding for file name / path needs to be in the same encoding the OS uses OString path = OUStringToOString( filePath, osl_getThreadTextEncoding() ); - OString conf_file_path(path); - conf_file_path += DEFAULT_CONF_FILE_NAME; + OString conf_file_path = path + DEFAULT_CONF_FILE_NAME; m_aGuesser.SetDBPath(conf_file_path.getStr(), path.getStr()); } diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx index a8ba9b99c3bc..3702af806e17 100644 --- a/linguistic/source/misc.cxx +++ b/linguistic/source/misc.cxx @@ -542,9 +542,7 @@ uno::Reference< XHyphenatedWord > RebuildHyphensAndControlChars( aLeft = rOrigWord.copy( 0, nPos ); aRight = rOrigWord.copy( nPos ); // FIXME: changes at the right side - aOrigHyphenatedWord = aLeft; - aOrigHyphenatedWord += aRplc; - aOrigHyphenatedWord += aRight; + aOrigHyphenatedWord = aLeft + aRplc + aRight; nOrigHyphenPos = sal::static_int_cast< sal_Int16 >(aLeft.getLength() + rxHyphWord->getHyphenPos() - nChgPos); diff --git a/lotuswordpro/source/filter/lwptblformula.cxx b/lotuswordpro/source/filter/lwptblformula.cxx index 10193e7c5d00..c6af01f6e34f 100644 --- a/lotuswordpro/source/filter/lwptblformula.cxx +++ b/lotuswordpro/source/filter/lwptblformula.cxx @@ -101,8 +101,7 @@ void LwpFormulaInfo::ReadText() std::vector<char> aBuf(nStrLen + 1); m_pObjStrm->QuickRead(aBuf.data(), nStrLen); aBuf[nStrLen]= '\0'; - OUString aText; - aText += "\""; + OUString aText = "\""; aText += OUString(aBuf.data(), nStrLen, osl_getThreadTextEncoding()); aText += "\""; diff --git a/lotuswordpro/source/filter/xfilter/xffont.cxx b/lotuswordpro/source/filter/xfilter/xffont.cxx index 96259c5dafa8..8e906af25a47 100644 --- a/lotuswordpro/source/filter/xfilter/xffont.cxx +++ b/lotuswordpro/source/filter/xfilter/xffont.cxx @@ -209,20 +209,17 @@ void XFFont::ToXml(IXFStream *pStrm) //font size: if( (m_nFlag & XFFONT_FLAG_SIZE) && m_nFontSize != 0 ) { - OUString strSize = OUString::number(m_nFontSize); - strSize += "pt"; + OUString strSize = OUString::number(m_nFontSize) + "pt"; pAttrList->AddAttribute("fo:font-size",strSize); } if( (m_nFlag & XFFONT_FLAG_SIZE_ASIA) && m_nFontSizeAsia ) { - OUString strSize = OUString::number(m_nFontSizeAsia); - strSize += "pt"; + OUString strSize = OUString::number(m_nFontSizeAsia) + "pt"; pAttrList->AddAttribute("style:font-size-asian",strSize); } if( (m_nFlag & XFFONT_FLAG_SIZE_COMPLEX) && m_nFontSizeComplex ) { - OUString strSize = OUString::number(m_nFontSizeComplex); - strSize += "pt"; + OUString strSize = OUString::number(m_nFontSizeComplex) + "pt"; pAttrList->AddAttribute("style:font-size-complex",strSize); } diff --git a/oox/source/ole/vbamodule.cxx b/oox/source/ole/vbamodule.cxx index 889398ccfae6..b7ff5edb7aec 100644 --- a/oox/source/ole/vbamodule.cxx +++ b/oox/source/ole/vbamodule.cxx @@ -190,8 +190,7 @@ OUString VbaModule::readSourceCode( StorageBase& rVbaStrg ) const { // cntrl modifier is explicit ( but could be cntrl+shift ), parseKeyEvent // will handle and uppercase letter appropriately - OUString sApiKey = "^"; - sApiKey += sKey; + OUString sApiKey = "^" + sKey; try { KeyEvent aKeyEvent = ooo::vba::parseKeyEvent( sApiKey ); diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx index efc10c69af97..b154196de2ac 100644 --- a/oox/source/ppt/pptimport.cxx +++ b/oox/source/ppt/pptimport.cxx @@ -155,8 +155,7 @@ bool PowerPointImport::importDocument() SfxErrorContext aContext(ERRCTX_SFX_OPENDOC, aURL.getName(INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset), nullptr, RID_ERRCTX); OUString aWarning; aContext.GetString(ERRCODE_NONE.MakeWarning(), aWarning); - aWarning += ":\n"; - aWarning += SvxResId(RID_SVXSTR_WARN_MISSING_SMARTART); + aWarning += ":\n" + SvxResId(RID_SVXSTR_WARN_MISSING_SMARTART); // Show it. std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(nullptr, |