Kaydet (Commit) fafb309d authored tarafından Muhammet Kara's avatar Muhammet Kara Kaydeden (comit) Noel Grandin

prefer OUStringBuffer to concatenating OUString in a loop

And improve OUString readability and efficiency.
See: https://goo.gl/jsVAwy:

Change-Id: I8d847b1ca3cde7cb8733d6f8a649612745cf6aae
Reviewed-on: https://gerrit.libreoffice.org/26511Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst 2fb88cb4
......@@ -1626,29 +1626,32 @@ ErrCode BasicManager::ExecuteMacro( OUString const& i_fullyQualifiedName, OUStri
sArgs.remove( 0, 1 );
sArgs.remove( sArgs.getLength() - 1, 1 );
sQuotedArgs = "(";
OUStringBuffer aBuff;
OUString sArgs2 = sArgs.makeStringAndClear();
sal_Int32 nCount = comphelper::string::getTokenCount(sArgs2, ',');
aBuff.append("(");
for (sal_Int32 n = 0; n < nCount; ++n)
{
sQuotedArgs += "\"";
sQuotedArgs += sArgs2.getToken(n, ',');
sQuotedArgs += "\"";
aBuff.append( "\"" );
aBuff.append( sArgs2.getToken(n, ',') );
aBuff.append( "\"" );
if ( n < nCount - 1 )
{
sQuotedArgs += ",";
aBuff.append( "," );
}
}
aBuff.append( ")" );
sQuotedArgs += ")";
sQuotedArgs = aBuff.makeStringAndClear();
}
// add quoted arguments and do the call
OUString sCall;
sCall += "[";
sCall += pMethod->GetName();
sCall += sQuotedArgs;
sCall += "]";
OUString sCall = "["
+ pMethod->GetName()
+ sQuotedArgs
+ "]";
SbxVariable* pRet = pMethod->GetParent()->Execute( sCall );
if ( pRet && ( pRet != pMethod ) )
......
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