Kaydet (Commit) 0c7cf722 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

loplugin:stringconstant: Flag more inefficiencies

Change-Id: I3c7b73ebb50c464e6bca816444324e100bd89d23
üst ca30ba7a
...@@ -190,8 +190,7 @@ bool SfxErrorHandler::CreateString( ...@@ -190,8 +190,7 @@ bool SfxErrorHandler::CreateString(
const StringErrorInfo *pStringInfo = PTR_CAST(StringErrorInfo,pErr); const StringErrorInfo *pStringInfo = PTR_CAST(StringErrorInfo,pErr);
if(pStringInfo) if(pStringInfo)
{ {
rStr = rStr.replaceAll(OUString("$(ARG1)"), rStr = rStr.replaceAll("$(ARG1)", pStringInfo->GetErrorString());
pStringInfo->GetErrorString());
} }
else else
{ {
...@@ -347,7 +346,7 @@ bool SfxErrorHandler::GetErrorString( ...@@ -347,7 +346,7 @@ bool SfxErrorHandler::GetErrorString(
sal_uInt16 nResFlags = aErrorString.GetFlags(); sal_uInt16 nResFlags = aErrorString.GetFlags();
if ( nResFlags ) if ( nResFlags )
nFlags = nResFlags; nFlags = nResFlags;
rStr = rStr.replaceAll(OUString("$(ERROR)"), aErrorString.GetString()); rStr = rStr.replaceAll("$(ERROR)", aErrorString.GetString());
bRet = true; bRet = true;
} }
else else
...@@ -415,7 +414,7 @@ bool SfxErrorContext::GetString(sal_uLong nErrId, OUString &rStr) ...@@ -415,7 +414,7 @@ bool SfxErrorContext::GetString(sal_uLong nErrId, OUString &rStr)
if ( aTestEr ) if ( aTestEr )
{ {
rStr = static_cast<ResString>(aTestEr).GetString(); rStr = static_cast<ResString>(aTestEr).GetString();
rStr = rStr.replaceAll(OUString("$(ARG1)"), aArg1 ); rStr = rStr.replaceAll("$(ARG1)", aArg1);
bRet = true; bRet = true;
} }
else else
...@@ -429,7 +428,7 @@ bool SfxErrorContext::GetString(sal_uLong nErrId, OUString &rStr) ...@@ -429,7 +428,7 @@ bool SfxErrorContext::GetString(sal_uLong nErrId, OUString &rStr)
sal_uInt16 nId = ( nErrId & ERRCODE_WARNING_MASK ) ? ERRCTX_WARNING : ERRCTX_ERROR; sal_uInt16 nId = ( nErrId & ERRCODE_WARNING_MASK ) ? ERRCTX_WARNING : ERRCTX_ERROR;
ResId aSfxResId( RID_ERRCTX, *pMgr ); ResId aSfxResId( RID_ERRCTX, *pMgr );
ErrorResource_Impl aEr( aSfxResId, nId ); ErrorResource_Impl aEr( aSfxResId, nId );
rStr = rStr.replaceAll( OUString("$(ERR)"), static_cast<ResString>(aEr).GetString() ); rStr = rStr.replaceAll("$(ERR)", static_cast<ResString>(aEr).GetString());
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment