Kaydet (Commit) d5784e91 authored tarafından Muhammet Kara's avatar Muhammet Kara Kaydeden (comit) Markus Mohrhard

Improve readability of OUString concatanation in LibPage

, ScriptDocument
, PropBrw
, VBATest
, SbUnoClass
, SbModule
, and SbiSymPool

It is more readable and more efficient as a bonus.
See: https://goo.gl/jsVAwy:

Change-Id: I73926989345193b133e538d5aeca36f12723162c
Reviewed-on: https://gerrit.libreoffice.org/26853Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst bad68fd0
......@@ -747,18 +747,18 @@ void LibPage::InsertLib()
// filter
OUString aTitle(IDEResId(RID_STR_BASIC).toString());
OUString aFilter;
aFilter = "*.sbl;*.xlc;*.xlb" ; // library files
aFilter += ";*.sdw;*.sxw;*.odt" ; // text
aFilter += ";*.vor;*.stw;*.ott" ; // text template
aFilter += ";*.sgl;*.sxg;*.odm" ; // master document
aFilter += ";*.oth" ; // html document template
aFilter += ";*.sdc;*.sxc;*.ods" ; // spreadsheet
aFilter += ";*.stc;*.ots" ; // spreadsheet template
aFilter += ";*.sda;*.sxd;*.odg" ; // drawing
aFilter += ";*.std;*.otg" ; // drawing template
aFilter += ";*.sdd;*.sxi;*.odp" ; // presentation
aFilter += ";*.sti;*.otp" ; // presentation template
aFilter += ";*.sxm;*.odf" ; // formula
aFilter = OUString("*.sbl;*.xlc;*.xlb") // library files
+ ";*.sdw;*.sxw;*.odt" // text
+ ";*.vor;*.stw;*.ott" // text template
+ ";*.sgl;*.sxg;*.odm" // master document
+ ";*.oth" // html document template
+ ";*.sdc;*.sxc;*.ods" // spreadsheet
+ ";*.stc;*.ots" // spreadsheet template
+ ";*.sda;*.sxd;*.odg" // drawing
+ ";*.std;*.otg" // drawing template
+ ";*.sdd;*.sxi;*.odp" // presentation
+ ";*.sti;*.otp" // presentation template
+ ";*.sxm;*.odf" ; // formula
xFP->appendFilter( aTitle, aFilter );
// set display directory and filter
......@@ -1271,8 +1271,8 @@ void LibPage::ExportAsPackage( const OUString& aLibName )
const OUString strFullPath = "FullPath" ;
const OUString strBasicMediaType = "application/vnd.sun.star.basic-library" ;
OUString fullPath = aLibName;
fullPath += "/" ;
OUString fullPath = aLibName
+ "/" ;
auto attribs(::comphelper::InitPropertySequence({
{ strFullPath, makeAny(fullPath) },
{ strMediaType, makeAny(strBasicMediaType) }
......
......@@ -1269,8 +1269,8 @@ namespace basctl
sal_Int32 i = 1;
while ( !bValid )
{
aObjectName = aBaseName;
aObjectName += OUString::number( i );
aObjectName = aBaseName
+ OUString::number( i );
if ( aUsedNamesCheck.find( aObjectName ) == aUsedNamesCheck.end() )
bValid = true;
......
......@@ -284,8 +284,8 @@ void PropBrw::implSetNewObjectSequence
{
xObjectInspector->inspect( _rObjectSeq );
OUString aText = IDE_RESSTR(RID_STR_BRWTITLE_PROPERTIES);
aText += IDE_RESSTR(RID_STR_BRWTITLE_MULTISELECT);
OUString aText = IDE_RESSTR(RID_STR_BRWTITLE_PROPERTIES)
+ IDE_RESSTR(RID_STR_BRWTITLE_MULTISELECT);
SetText( aText );
}
}
......
......@@ -69,8 +69,8 @@ void VBATest::testMiscVBAFunctions()
for ( sal_uInt32 i=0; i<SAL_N_ELEMENTS( macroSource ); ++i )
{
OUString sMacroURL( sMacroPathURL );
sMacroURL += OUString::createFromAscii( macroSource[ i ] );
OUString sMacroURL = sMacroPathURL
+ OUString::createFromAscii( macroSource[ i ] );
MacroSnippet myMacro;
myMacro.LoadSourceFromFile( sMacroURL );
......@@ -133,16 +133,16 @@ void VBATest::testMiscOLEStuff()
uno::Sequence< uno::Any > aArgs(1);
// path to test document
OUString sPath = m_directories.getPathFromSrc("/basic/qa/vba_tests/data/");
sPath += "ADODBdata.xls";
OUString sPath = m_directories.getPathFromSrc("/basic/qa/vba_tests/data/")
+ "ADODBdata.xls";
sPath = sPath.replaceAll( "/", "\\" );
aArgs[ 0 ] = uno::makeAny( sPath );
for ( sal_uInt32 i=0; i<SAL_N_ELEMENTS( macroSource ); ++i )
{
OUString sMacroURL( sMacroPathURL );
sMacroURL += OUString::createFromAscii( macroSource[ i ] );
OUString sMacroURL = sMacroPathURL
+ OUString::createFromAscii( macroSource[ i ] );
MacroSnippet myMacro;
myMacro.LoadSourceFromFile( sMacroURL );
SbxVariableRef pReturn = myMacro.Run( aArgs );
......
......@@ -3396,9 +3396,9 @@ SbxVariable* SbUnoClass::Find( const OUString& rName, SbxClassType )
else
{
// expand fully qualified name
OUString aNewName = GetName();
aNewName += ".";
aNewName += rName;
OUString aNewName = GetName()
+ "."
+ rName;
// get CoreReflection
Reference< XIdlReflection > xCoreReflection = getCoreReflection_Impl();
......@@ -3808,8 +3808,8 @@ void SbUnoSingleton::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
Any aRetAny;
if( xContextToUse.is() )
{
OUString aSingletonName( "/singletons/" );
aSingletonName += GetName();
OUString aSingletonName = "/singletons/"
+ GetName();
Reference < XInterface > xRet;
xContextToUse->getValueByName( aSingletonName ) >>= xRet;
aRetAny <<= xRet;
......@@ -4306,9 +4306,9 @@ void SAL_CALL ModuleInvocationProxy::setValue(const OUString& rProperty, const A
SolarMutexGuard guard;
OUString aPropertyFunctionName( "Property Set " );
aPropertyFunctionName += m_aPrefix;
aPropertyFunctionName += rProperty;
OUString aPropertyFunctionName = "Property Set "
+ m_aPrefix
+ rProperty;
SbxVariable* p = m_xScopeObj->Find( aPropertyFunctionName, SbxClassType::Method );
SbMethod* pMeth = p != nullptr ? dynamic_cast<SbMethod*>( p ) : nullptr;
......@@ -4345,9 +4345,9 @@ Any SAL_CALL ModuleInvocationProxy::getValue(const OUString& rProperty)
}
SolarMutexGuard guard;
OUString aPropertyFunctionName( "Property Get " );
aPropertyFunctionName += m_aPrefix;
aPropertyFunctionName += rProperty;
OUString aPropertyFunctionName = "Property Get "
+ m_aPrefix
+ rProperty;
SbxVariable* p = m_xScopeObj->Find( aPropertyFunctionName, SbxClassType::Method );
SbMethod* pMeth = p != nullptr ? dynamic_cast<SbMethod*>( p ) : nullptr;
......@@ -4390,8 +4390,8 @@ Any SAL_CALL ModuleInvocationProxy::invoke( const OUString& rFunction,
{
return aRet;
}
OUString aFunctionName = m_aPrefix;
aFunctionName += rFunction;
OUString aFunctionName = m_aPrefix
+ rFunction;
bool bSetRescheduleBack = false;
bool bOldReschedule = true;
......
......@@ -742,8 +742,8 @@ void SbModule::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
if( pHint->GetId() == SBX_HINT_DATAWANTED )
{
OUString aProcName("Property Get ");
aProcName += pProcProperty->GetName();
OUString aProcName = "Property Get "
+ pProcProperty->GetName();
SbxVariable* pMethVar = Find( aProcName, SbxClassType::Method );
if( pMethVar )
......@@ -784,14 +784,14 @@ void SbModule::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
pProcProperty->setSet( false );
OUString aProcName("Property Set ");
aProcName += pProcProperty->GetName();
OUString aProcName = "Property Set "
+ pProcProperty->GetName();
pMethVar = Find( aProcName, SbxClassType::Method );
}
if( !pMethVar ) // Let
{
OUString aProcName("Property Let " );
aProcName += pProcProperty->GetName();
OUString aProcName = "Property Let "
+ pProcProperty->GetName();
pMethVar = Find( aProcName, SbxClassType::Method );
}
......@@ -1871,8 +1871,8 @@ void SbModule::handleProcedureProperties( SfxBroadcaster& rBC, const SfxHint& rH
if( pHint->GetId() == SBX_HINT_DATAWANTED )
{
OUString aProcName("Property Get ");
aProcName += pProcProperty->GetName();
OUString aProcName = "Property Get "
+ pProcProperty->GetName();
SbxVariable* pMeth = Find( aProcName, SbxClassType::Method );
if( pMeth )
......@@ -1913,14 +1913,14 @@ void SbModule::handleProcedureProperties( SfxBroadcaster& rBC, const SfxHint& rH
{
pProcProperty->setSet( false );
OUString aProcName("Property Set " );
aProcName += pProcProperty->GetName();
OUString aProcName = "Property Set "
+ pProcProperty->GetName();
pMeth = Find( aProcName, SbxClassType::Method );
}
if( !pMeth ) // Let
{
OUString aProcName("Property Let " );
aProcName += pProcProperty->GetName();
OUString aProcName = "Property Let "
+ pProcProperty->GetName();
pMeth = Find( aProcName, SbxClassType::Method );
}
......
......@@ -160,9 +160,9 @@ void SbiSymPool::Add( SbiSymDef* pDef )
OUString aName( pDef->aName );
if( pDef->IsStatic() )
{
aName = pParser->aGblStrings.Find( nProcId );
aName += ":";
aName += pDef->aName;
aName = pParser->aGblStrings.Find( nProcId )
+ ":"
+ pDef->aName;
}
pDef->nId = rStrings.Add( aName );
}
......
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