canvas/source/directx/dx_canvashelper.cxx | 2 connectivity/source/drivers/ado/ADriver.cxx | 2 dtrans/source/win32/dtobj/FmtFilter.cxx | 8 +- extensions/source/ole/unoconversionutilities.hxx | 2 package/qa/cppunit/test_package.cxx | 6 - package/source/manifest/ManifestImport.cxx | 3 package/source/xstor/owriteablestream.cxx | 7 -- package/source/xstor/xstorage.cxx | 6 - registry/source/keyimpl.cxx | 27 ++------ registry/source/regimpl.cxx | 6 - reportdesign/source/filter/xml/xmlExport.cxx | 10 --- reportdesign/source/ui/inspection/GeometryHandler.cxx | 3 reportdesign/source/ui/misc/UITools.cxx | 6 - reportdesign/source/ui/report/propbrw.cxx | 4 - sal/osl/all/log.cxx | 2 sal/osl/w32/procimpl.cxx | 2 sal/qa/osl/file/osl_File.cxx | 56 ++++++++---------- sal/qa/osl/file/test_cpy_wrt_file.cxx | 6 - sax/source/expatwrap/sax_expat.cxx | 14 ++-- shell/source/win32/shlxthandler/infotips/infotips.cxx | 2 vcl/win/gdi/winlayout.cxx | 2 winaccessibility/source/service/msaaservice_impl.cxx | 3 22 files changed, 74 insertions(+), 105 deletions(-)
New commits: commit 404a3c806ffdf094c2f4a95a722765fea132fad5 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Tue Oct 1 09:17:15 2019 +0200 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Tue Oct 1 10:51:48 2019 +0200 loplugin:simplifyconstruct (clang-cl) Change-Id: I08da288a88c2bce1d4250ec77f17bd483e6bc09c Reviewed-on: https://gerrit.libreoffice.org/79911 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/canvas/source/directx/dx_canvashelper.cxx b/canvas/source/directx/dx_canvashelper.cxx index 0db0f187d595..d606aab9a621 100644 --- a/canvas/source/directx/dx_canvashelper.cxx +++ b/canvas/source/directx/dx_canvashelper.cxx @@ -147,7 +147,7 @@ namespace dxcanvas if( needOutput() ) { GraphicsSharedPtr pGraphics( mpGraphicsProvider->getGraphics() ); - Gdiplus::Color aClearColor = Gdiplus::Color(Gdiplus::ARGB(Gdiplus::Color::White)); + Gdiplus::Color aClearColor{Gdiplus::ARGB(Gdiplus::Color::White)}; ENSURE_OR_THROW( Gdiplus::Ok == pGraphics->SetCompositingMode( diff --git a/connectivity/source/drivers/ado/ADriver.cxx b/connectivity/source/drivers/ado/ADriver.cxx index eae5ee686996..c19df1794285 100644 --- a/connectivity/source/drivers/ado/ADriver.cxx +++ b/connectivity/source/drivers/ado/ADriver.cxx @@ -260,7 +260,7 @@ void ADOS::ThrowException(ADOConnection* _pAdoCon,const Reference< XInterface >& aException = SQLException(aErr.GetDescription(),_xInterface,aErr.GetSQLState(),aErr.GetNumber(),Any()); else { - SQLException aTemp = SQLException(aErr.GetDescription(), + SQLException aTemp(aErr.GetDescription(), _xInterface,aErr.GetSQLState(),aErr.GetNumber(),makeAny(aException)); aTemp.NextException <<= aException; aException = aTemp; diff --git a/dtrans/source/win32/dtobj/FmtFilter.cxx b/dtrans/source/win32/dtobj/FmtFilter.cxx index 007d04ac08c5..2130c42ba578 100644 --- a/dtrans/source/win32/dtobj/FmtFilter.cxx +++ b/dtrans/source/win32/dtobj/FmtFilter.cxx @@ -227,13 +227,13 @@ static std::string GetHtmlFormatHeader(size_t startHtml, size_t endHtml, size_t // the case of these tags has to match what we output in our filters // both tags don't allow parameters -const std::string TAG_HTML = std::string("<html>"); -const std::string TAG_END_HTML = std::string("</html>"); +const std::string TAG_HTML("<html>"); +const std::string TAG_END_HTML("</html>"); // The body tag may have parameters so we need to search for the // closing '>' manually e.g. <body param> #92840# -const std::string TAG_BODY = std::string("<body"); -const std::string TAG_END_BODY = std::string("</body"); +const std::string TAG_BODY("<body"); +const std::string TAG_END_BODY("</body"); Sequence<sal_Int8> TextHtmlToHTMLFormat(Sequence<sal_Int8> const & aTextHtml) { diff --git a/extensions/source/ole/unoconversionutilities.hxx b/extensions/source/ole/unoconversionutilities.hxx index 5e4a96a2ef0d..0fffbaacb695 100644 --- a/extensions/source/ole/unoconversionutilities.hxx +++ b/extensions/source/ole/unoconversionutilities.hxx @@ -1661,7 +1661,7 @@ Any UnoConversionUtilities<T>::createOleObjectWrapper(VARIANT* pVar, const Type& spDispatch2.QueryInterface( & spUnknown.p); } - static Type VOID_TYPE= Type(); + static Type VOID_TYPE; Any ret; //If no Type is provided and pVar contains IUnknown then we return a XInterface. //If pVar contains an IDispatch then we return a XInvocation. diff --git a/sal/osl/all/log.cxx b/sal/osl/all/log.cxx index 94aef6b17d24..5a6ffdff9110 100644 --- a/sal/osl/all/log.cxx +++ b/sal/osl/all/log.cxx @@ -96,7 +96,7 @@ char const* setEnvFromLoggingIniFile(const char* env, const char* key) char const* sResult = nullptr; wchar_t buffer[MAX_PATH]; GetModuleFileNameW(nullptr, buffer, MAX_PATH); - std::wstring sProgramDirectory = std::wstring(buffer); + std::wstring sProgramDirectory(buffer); std::wstring::size_type pos = sProgramDirectory.find_last_of(L"\\/"); sProgramDirectory = sProgramDirectory.substr(0, pos+1); sProgramDirectory += L"logging.ini"; diff --git a/sal/osl/w32/procimpl.cxx b/sal/osl/w32/procimpl.cxx index 9f0595395dad..27212eec17d5 100644 --- a/sal/osl/w32/procimpl.cxx +++ b/sal/osl/w32/procimpl.cxx @@ -128,7 +128,7 @@ namespace /* private */ for (sal_uInt32 i = 0; i < env_vars_count; i++) { - OUString env_var = OUString(env_vars[i]); + OUString env_var(env_vars[i]); if (env_var.getLength() == 0) return false; diff --git a/shell/source/win32/shlxthandler/infotips/infotips.cxx b/shell/source/win32/shlxthandler/infotips/infotips.cxx index e87e42997099..aa061eb25490 100644 --- a/shell/source/win32/shlxthandler/infotips/infotips.cxx +++ b/shell/source/win32/shlxthandler/infotips/infotips.cxx @@ -36,7 +36,7 @@ #define MAX_STRING 80 #define KB 1024.0 -const std::wstring WSPACE = std::wstring(SPACE); +const std::wstring WSPACE(SPACE); CInfoTip::CInfoTip(long RefCnt) : diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx index 25949dc0692e..b67f191c0b47 100644 --- a/vcl/win/gdi/winlayout.cxx +++ b/vcl/win/gdi/winlayout.cxx @@ -432,7 +432,7 @@ bool WinSalGraphics::DrawCachedGlyphs(const GenericSalLayout& rLayout) rLayout.GetBoundRect(aRect); COLORREF color = GetTextColor(hDC); - Color salColor = Color(GetRValue(color), GetGValue(color), GetBValue(color)); + Color salColor(GetRValue(color), GetGValue(color), GetBValue(color)); WinOpenGLSalGraphicsImpl *pImpl = dynamic_cast<WinOpenGLSalGraphicsImpl*>(mpImpl.get()); if (!pImpl) diff --git a/winaccessibility/source/service/msaaservice_impl.cxx b/winaccessibility/source/service/msaaservice_impl.cxx index 1025b597c08c..89b5d9a4a0d7 100644 --- a/winaccessibility/source/service/msaaservice_impl.cxx +++ b/winaccessibility/source/service/msaaservice_impl.cxx @@ -253,8 +253,7 @@ static Reference< XInterface > create_MSAAServiceImpl( Reference< XComponentCont MSAAServiceImpl::MSAAServiceImpl() { - Reference< XExtendedToolkit > xToolkit = - Reference< XExtendedToolkit >(Application::GetVCLToolkit(), UNO_QUERY); + Reference< XExtendedToolkit > xToolkit(Application::GetVCLToolkit(), UNO_QUERY); if( xToolkit.is() ) { commit b74c4b7c675883e23bea9fd52682ae89d36539f6 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Mon Sep 30 15:11:25 2019 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Oct 1 10:51:39 2019 +0200 loplugin:stringadd in package..sax Change-Id: I1f8b626ae99bca6e31e7c4aa9c8a1fc016b76e5c Reviewed-on: https://gerrit.libreoffice.org/79890 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/package/qa/cppunit/test_package.cxx b/package/qa/cppunit/test_package.cxx index ec65d7a88351..2353e7b3de07 100644 --- a/package/qa/cppunit/test_package.cxx +++ b/package/qa/cppunit/test_package.cxx @@ -152,8 +152,7 @@ namespace for (char c = 'a'; c <= 'z'; ++c, ++itBuf) { - OUString aName(c); - aName += ".txt"; + OUString aName = OUString(c) + ".txt"; uno::Reference<io::XInputStream> xStrm; mxNA->getByName(aName) >>= xStrm; @@ -175,8 +174,7 @@ namespace for (char c = 'a'; c <= 'z'; ++c, ++itBuf) { - OUString aName(c); - aName += ".txt"; + OUString aName = OUString(c) + ".txt"; uno::Reference<io::XInputStream> xStrm; //Size of each stream is 1mb (>10000) => XBufferedThreadedStream diff --git a/package/source/manifest/ManifestImport.cxx b/package/source/manifest/ManifestImport.cxx index b333cf5c9831..4014bf3d0a4d 100644 --- a/package/source/manifest/ManifestImport.cxx +++ b/package/source/manifest/ManifestImport.cxx @@ -581,8 +581,7 @@ OUString ManifestImport::ConvertNameWithNamespace( const OUString& aName, const if ( aIter != aNamespaces.end() && ( aIter->second == MANIFEST_NAMESPACE || aIter->second == MANIFEST_OASIS_NAMESPACE ) ) { // no check for manifest.xml consistency currently since the old versions have supported inconsistent documents as well - aResult = MANIFEST_NSPREFIX; - aResult += aPureName; + aResult = MANIFEST_NSPREFIX + aPureName; } return aResult; diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx index e4935b94c81d..a781dc4bdac9 100644 --- a/package/source/xstor/owriteablestream.cxx +++ b/package/source/xstor/owriteablestream.cxx @@ -1510,11 +1510,8 @@ void OWriteStream_Impl::CommitStreamRelInfo( const uno::Reference< embed::XStora if ( m_nRelInfoStatus == RELINFO_BROKEN || m_nRelInfoStatus == RELINFO_CHANGED_BROKEN ) throw io::IOException(); // TODO: - OUString aOrigRelStreamName = aOrigStreamName; - aOrigRelStreamName += ".rels"; - - OUString aNewRelStreamName = aNewStreamName; - aNewRelStreamName += ".rels"; + OUString aOrigRelStreamName = aOrigStreamName + ".rels"; + OUString aNewRelStreamName = aNewStreamName + ".rels"; bool bRenamed = aOrigRelStreamName != aNewRelStreamName; if ( m_nRelInfoStatus == RELINFO_CHANGED diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index 5a375e4bfcfa..6a5b62a6edd2 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -1591,8 +1591,7 @@ void OStorage_Impl::RemoveStreamRelInfo( const OUString& aOriginalName ) if ( m_nStorageType == embed::StorageFormats::OFOPXML && m_xRelStorage.is() ) { - OUString aRelStreamName = aOriginalName; - aRelStreamName += ".rels"; + OUString aRelStreamName = aOriginalName + ".rels"; if ( m_xRelStorage->hasByName( aRelStreamName ) ) m_xRelStorage->removeElement( aRelStreamName ); @@ -1654,8 +1653,7 @@ uno::Reference< io::XInputStream > OStorage_Impl::GetRelInfoStreamForName( const ReadContents(); if ( m_xRelStorage.is() ) { - OUString aRelStreamName = aName; - aRelStreamName += ".rels"; + OUString aRelStreamName = aName + ".rels"; if ( m_xRelStorage->hasByName( aRelStreamName ) ) { uno::Reference< io::XStream > xStream = m_xRelStorage->openStreamElement( aRelStreamName, embed::ElementModes::READ ); diff --git a/registry/source/keyimpl.cxx b/registry/source/keyimpl.cxx index e5aef0675199..d969cbaa32c5 100644 --- a/registry/source/keyimpl.cxx +++ b/registry/source/keyimpl.cxx @@ -228,8 +228,7 @@ RegError ORegKey::getValueInfo(const OUString& valueName, RegValueType* pValueTy accessMode = storeAccessMode::ReadOnly; } - OUString sImplValueName( VALUE_PREFIX ); - sImplValueName += valueName; + OUString sImplValueName = VALUE_PREFIX + valueName; REG_GUARD(m_pRegistry->m_mutex); @@ -288,8 +287,7 @@ RegError ORegKey::setValue(const OUString& valueName, RegValueType vType, RegVal return RegError::INVALID_VALUE; } - OUString sImplValueName( VALUE_PREFIX ); - sImplValueName += valueName; + OUString sImplValueName = VALUE_PREFIX + valueName; REG_GUARD(m_pRegistry->m_mutex); @@ -355,8 +353,7 @@ RegError ORegKey::setLongListValue(const OUString& valueName, sal_Int32 const * return RegError::REGISTRY_READONLY; } - OUString sImplValueName( VALUE_PREFIX ); - sImplValueName += valueName; + OUString sImplValueName = VALUE_PREFIX + valueName; REG_GUARD(m_pRegistry->m_mutex); @@ -411,8 +408,7 @@ RegError ORegKey::setStringListValue(const OUString& valueName, sal_Char** pValu return RegError::REGISTRY_READONLY; } - OUString sImplValueName( VALUE_PREFIX ); - sImplValueName += valueName; + OUString sImplValueName = VALUE_PREFIX + valueName; REG_GUARD(m_pRegistry->m_mutex); @@ -476,8 +472,7 @@ RegError ORegKey::setUnicodeListValue(const OUString& valueName, sal_Unicode** p return RegError::REGISTRY_READONLY; } - OUString sImplValueName( VALUE_PREFIX ); - sImplValueName += valueName; + OUString sImplValueName = VALUE_PREFIX + valueName; REG_GUARD(m_pRegistry->m_mutex); @@ -544,8 +539,7 @@ RegError ORegKey::getValue(const OUString& valueName, RegValue value) const accessMode = storeAccessMode::ReadOnly; } - OUString sImplValueName( VALUE_PREFIX ); - sImplValueName += valueName; + OUString sImplValueName = VALUE_PREFIX + valueName; REG_GUARD(m_pRegistry->m_mutex); @@ -630,8 +624,7 @@ RegError ORegKey::getLongListValue(const OUString& valueName, sal_Int32** pValue accessMode = storeAccessMode::ReadOnly; } - OUString sImplValueName( VALUE_PREFIX ); - sImplValueName += valueName; + OUString sImplValueName = VALUE_PREFIX + valueName; REG_GUARD(m_pRegistry->m_mutex); @@ -734,8 +727,7 @@ RegError ORegKey::getStringListValue(const OUString& valueName, sal_Char*** pVal accessMode = storeAccessMode::ReadOnly; } - OUString sImplValueName( VALUE_PREFIX ); - sImplValueName += valueName; + OUString sImplValueName = VALUE_PREFIX + valueName; REG_GUARD(m_pRegistry->m_mutex); @@ -832,8 +824,7 @@ RegError ORegKey::getUnicodeListValue(const OUString& valueName, sal_Unicode*** accessMode = storeAccessMode::ReadOnly; } - OUString sImplValueName( VALUE_PREFIX ); - sImplValueName += valueName; + OUString sImplValueName = VALUE_PREFIX + valueName; REG_GUARD(m_pRegistry->m_mutex); diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx index 63c937a1109a..ab7dcb09888e 100644 --- a/registry/source/regimpl.cxx +++ b/registry/source/regimpl.cxx @@ -796,8 +796,7 @@ RegError ORegistry::eraseKey(ORegKey* pKey, const OUString& keyName) return _ret; } - OUString tmpName(sRelativKey); - tmpName += ROOT; + OUString tmpName = sRelativKey + ROOT; OStoreFile sFile(pKey->getStoreFile()); if (sFile.isValid() && sFile.remove(sFullPath, tmpName)) @@ -1198,8 +1197,7 @@ RegError ORegistry::loadAndSaveKeys(ORegKey* pTargetKey, if (sRelPath.getLength() > 1 || sFullPath.isEmpty()) sFullPath += ROOT; - OUString sFullKeyName = sFullPath; - sFullKeyName += keyName; + OUString sFullKeyName = sFullPath + keyName; OStoreDirectory rStoreDir; if (rStoreDir.create(pTargetKey->getStoreFile(), sFullPath, keyName, storeAccessMode::Create)) diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx index 4c991cd87732..b548f991dcc6 100644 --- a/reportdesign/source/filter/xml/xmlExport.cxx +++ b/reportdesign/source/filter/xml/xmlExport.cxx @@ -1082,14 +1082,11 @@ void ORptExport::exportGroup(const Reference<XReportDefinition>& _xReportDefinit sExpression = sExpression.replaceAt(nIndex, 1, "\"\""); nIndex = sExpression.indexOf('"',nIndex+2); } - OUString sFormula("rpt:HASCHANGED(\""); TGroupFunctionMap::const_iterator aGroupFind = m_aGroupFunctionMap.find(xGroup); if ( aGroupFind != m_aGroupFunctionMap.end() ) sExpression = aGroupFind->second->getName(); - sFormula += sExpression; - sFormula += "\")"; - sExpression = sFormula; + sExpression = "rpt:HASCHANGED(\"" + sExpression + "\")"; } AddAttribute(XML_NAMESPACE_REPORT, XML_SORT_EXPRESSION, sField); AddAttribute(XML_NAMESPACE_REPORT, XML_GROUP_EXPRESSION,sExpression); @@ -1556,10 +1553,7 @@ void ORptExport::exportGroupsExpressionAsFunction(const Reference< XGroups>& _xG xFunction->setName(sFunctionName); if ( !sInitialFormula.isEmpty() ) xFunction->setInitialFormula(beans::Optional< OUString>(true, sInitialFormula)); - sFunction = "rpt:" + sFunction; - sFunction += "(["; - sFunction += sExpression; - sFunction += "]"; + sFunction = "rpt:" + sFunction + "([" + sExpression + "]"; if ( !sPrefix.isEmpty() ) sFunction += sPrefix; diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx index 20e37bf6413c..eaf9d679f509 100644 --- a/reportdesign/source/ui/inspection/GeometryHandler.cxx +++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx @@ -2157,8 +2157,7 @@ void GeometryHandler::impl_setCounterFunction_throw() { OUString sNamePostfix; fillScope_throw(sNamePostfix); - OUString sFunctionName = m_aCounterFunction.m_sName; - sFunctionName += sNamePostfix; + OUString sFunctionName = m_aCounterFunction.m_sName + sNamePostfix; const OUString sQuotedFunctionName = lcl_getQuotedFunctionName(sFunctionName); OUString sScope; if ( !(!sFunctionName.isEmpty() && m_aFunctionNames.find(sQuotedFunctionName) != m_aFunctionNames.end() && impl_isCounterFunction_throw(sQuotedFunctionName,sScope)) ) diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx index bde0449a34b1..51d7b5e7cf69 100644 --- a/reportdesign/source/ui/misc/UITools.cxx +++ b/reportdesign/source/ui/misc/UITools.cxx @@ -162,15 +162,13 @@ void adjustSectionName(const uno::Reference< report::XGroup >& _xGroup,sal_Int32 OSL_ENSURE(_xGroup.is(),"Group is NULL -> GPF"); if ( _xGroup->getHeaderOn() && _xGroup->getHeader()->getName().isEmpty() ) { - OUString sName = RptResId(RID_STR_GROUPHEADER); - sName += OUString::number(_nPos); + OUString sName = RptResId(RID_STR_GROUPHEADER) + OUString::number(_nPos); _xGroup->getHeader()->setName(sName); } if ( _xGroup->getFooterOn() && _xGroup->getFooter()->getName().isEmpty() ) { - OUString sName = RptResId(RID_STR_GROUPFOOTER); - sName += OUString::number(_nPos); + OUString sName = RptResId(RID_STR_GROUPFOOTER) + OUString::number(_nPos); _xGroup->getFooter()->setName(sName); } } diff --git a/reportdesign/source/ui/report/propbrw.cxx b/reportdesign/source/ui/report/propbrw.cxx index 633d5faea46a..ad6d8f1d494e 100644 --- a/reportdesign/source/ui/report/propbrw.cxx +++ b/reportdesign/source/ui/report/propbrw.cxx @@ -389,8 +389,8 @@ OUString PropBrw::GetHeadlineName( const uno::Sequence< Reference<uno::XInterfac } else // multiselection { - aName = RptResId(RID_STR_BRWTITLE_PROPERTIES); - aName += RptResId(RID_STR_BRWTITLE_MULTISELECT); + aName = RptResId(RID_STR_BRWTITLE_PROPERTIES) + + RptResId(RID_STR_BRWTITLE_MULTISELECT); } return aName; diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx index 1b32320803e9..cf8875b020ac 100644 --- a/sal/qa/osl/file/osl_File.cxx +++ b/sal/qa/osl/file/osl_File.cxx @@ -86,10 +86,9 @@ static OString errorToString(const osl::FileBase::RC _nError) static OString errorToStr(osl::FileBase::RC const& nError) { - OString suBuf; - suBuf += "The returned error is: " ; - suBuf += errorToString(nError); - suBuf += "!\n"; + OString suBuf = "The returned error is: " + + errorToString(nError) + + "!\n"; return suBuf; } @@ -263,8 +262,8 @@ static void deleteTestDirectory(const OUString& dirname) nError = Directory::remove(aPathURL); - OString strError ("In deleteTestDirectory function: remove Directory "); - strError += OUStringToOString(aPathURL, RTL_TEXTENCODING_ASCII_US); + OString strError = OString("In deleteTestDirectory function: remove Directory ") + + OUStringToOString(aPathURL, RTL_TEXTENCODING_ASCII_US); CPPUNIT_ASSERT_MESSAGE(strError.getStr(), (osl::FileBase::E_None == nError) || (nError == osl::FileBase::E_NOENT)); } @@ -368,16 +367,15 @@ static bool checkDirectory(const OUString& str, oslCheckMode nCheckMode) */ static OString outputError(const OString & returnVal, const OString & rightVal, const sal_Char * msg = "") { - OString aString; if (returnVal == rightVal) - return aString; - - aString += msg; - aString += ": the returned value is '"; - aString += returnVal; - aString += "', but the value should be '"; - aString += rightVal; - aString += "'."; + return OString(); + + OString aString = OString(msg) + + ": the returned value is '" + + returnVal + + "', but the value should be '" + + rightVal + + "'."; return aString; } @@ -969,9 +967,9 @@ namespace osl_FileBase bool bOk = compareFileName(aUStr, aUResultURL); - OString sError("test for getSystemPathFromFileURL(' "); - sError += OUStringToOString(aUNormalURL, RTL_TEXTENCODING_ASCII_US); - sError += " ') function:use an absolute file URL, "; + OString sError = "test for getSystemPathFromFileURL(' " + + OUStringToOString(aUNormalURL, RTL_TEXTENCODING_ASCII_US) + + " ') function:use an absolute file URL, "; sError += outputError(OUStringToOString(aUStr, RTL_TEXTENCODING_ASCII_US), OUStringToOString(aUResultURL, RTL_TEXTENCODING_ASCII_US)); @@ -992,9 +990,9 @@ namespace osl_FileBase bool bOk = compareFileName(aUStr, aUResultURL); - OString sError("test for getSystemPathFromFileURL(' "); - sError += OUStringToOString(aUNormalURL, RTL_TEXTENCODING_ASCII_US); - sError += " ') function:use a CJK coded absolute URL, "; + OString sError = "test for getSystemPathFromFileURL(' " + + OUStringToOString(aUNormalURL, RTL_TEXTENCODING_ASCII_US) + + " ') function:use a CJK coded absolute URL, "; sError += outputError(OUStringToOString(aUStr, RTL_TEXTENCODING_ASCII_US), OUStringToOString(aUResultURL, RTL_TEXTENCODING_ASCII_US)); deleteTestDirectory(aTmpName10); @@ -4773,9 +4771,9 @@ namespace osl_Directory CPPUNIT_ASSERT_EQUAL_MESSAGE("temp File removal failed", osl::FileBase::E_None, nError1); nError1 = Directory::create(aTmpDir); - OString sError("test for create function: create a directory '"); - sError += OUStringToOString(aTmpDir, RTL_TEXTENCODING_ASCII_US); - sError += "' and check its existence."; + OString sError = "test for create function: create a directory '" + + OUStringToOString(aTmpDir, RTL_TEXTENCODING_ASCII_US) + + "' and check its existence."; CPPUNIT_ASSERT_EQUAL_MESSAGE(sError.getStr(), osl::FileBase::E_None, nError1); osl_setFileAttributes(aTmpDir.pData, 0); // no access allowed now @@ -4789,9 +4787,9 @@ namespace osl_Directory osl_File_Attribute_OwnWrite | osl_File_Attribute_OwnExe); deleteTestDirectory(aTmpDir); - sError = OString("test for create function: create a directory under '"); - sError += OUStringToOString(aTmpDir, RTL_TEXTENCODING_ASCII_US); - sError += "' for access test."; + sError = OString("test for create function: create a directory under '") + + OUStringToOString(aTmpDir, RTL_TEXTENCODING_ASCII_US) + + "' for access test."; CPPUNIT_ASSERT_EQUAL_MESSAGE(sError.getStr(), osl::FileBase::E_ACCES, nError1); #endif } @@ -4888,8 +4886,8 @@ namespace osl_Directory nError1 = Directory::remove(aTmpName3); deleteTestFile(aTmpName4); deleteTestDirectory(aTmpName3); - OString sError = "test for remove function: try to remove a directory that is not empty."; - sError += errorToStr(nError1).getStr(); + OString sError = "test for remove function: try to remove a directory that is not empty." + + errorToStr(nError1); #if defined(__sun) // on UNX, the implementation uses rmdir(), which EEXIST is thrown on Solaris when the directory is not empty, refer to: 'man -s 2 rmdir', while on linux, ENOTEMPTY is thrown. // EEXIST The directory contains entries other than those for "." and "..". diff --git a/sal/qa/osl/file/test_cpy_wrt_file.cxx b/sal/qa/osl/file/test_cpy_wrt_file.cxx index 41e9f88c9fea..6843d10b362a 100644 --- a/sal/qa/osl/file/test_cpy_wrt_file.cxx +++ b/sal/qa/osl/file/test_cpy_wrt_file.cxx @@ -43,9 +43,9 @@ public: File tmp_file(aTmpFile); err = tmp_file.open(osl_File_OpenFlag_Write | osl_File_OpenFlag_Create); - OString sErrorMsg = "Expected that '"; - sErrorMsg += OUStringToOString(aTmpFile, RTL_TEXTENCODING_ASCII_US); - sErrorMsg += "' would exist!"; + OString sErrorMsg = "Expected that '" + + OUStringToOString(aTmpFile, RTL_TEXTENCODING_ASCII_US) + + "' would exist!"; CPPUNIT_ASSERT_EQUAL_MESSAGE(sErrorMsg.getStr(), FileBase::E_EXIST, err); char buffer[1]; diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx index 3030b5f001e0..c55cea3f2d04 100644 --- a/sax/source/expatwrap/sax_expat.cxx +++ b/sax/source/expatwrap/sax_expat.cxx @@ -614,13 +614,13 @@ OUString getErrorMessage( XML_Error xmlE, const OUString& sSystemId , sal_Int32 Message = "not standalone"; } - OUString str("["); - str += sSystemId; - str += " line "; - str += OUString::number( nLine ); - str += "]: "; - str += Message; - str += "error"; + OUString str = "[" + + sSystemId + + " line " + + OUString::number( nLine ) + + "]: " + + Message + + "error"; return str; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits