[Libreoffice-commits] core.git: basctl/source
Muhammet Kara
muhammet.kara at pardus.org.tr
Thu Jun 23 14:01:53 UTC 2016
basctl/source/basicide/localizationmgr.cxx | 53 +++++++++++++----------------
1 file changed, 25 insertions(+), 28 deletions(-)
New commits:
commit 456902abb40397e45f30efdfa2433d9d773d5344
Author: Muhammet Kara <muhammet.kara at pardus.org.tr>
Date: Thu Jun 23 10:54:49 2016 +0300
Improve readability of OUString concatanation in LocalizationMgr
It is more readable and more efficient as a bonus.
See: https://goo.gl/jsVAwy:
Change-Id: I56ba7aa1477361a686ffb50955525b73cce24197
Reviewed-on: https://gerrit.libreoffice.org/26585
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/basctl/source/basicide/localizationmgr.cxx b/basctl/source/basicide/localizationmgr.cxx
index 19604dc..e9dbf62 100644
--- a/basctl/source/basicide/localizationmgr.cxx
+++ b/basctl/source/basicide/localizationmgr.cxx
@@ -171,10 +171,10 @@ OUString implCreatePureResourceId
const Reference< XStringResourceManager >& xStringResourceManager )
{
sal_Int32 nUniqueId = xStringResourceManager->getUniqueNumericId();
- OUString aPureIdStr = OUString::number( nUniqueId );
- aPureIdStr += aDot;
- aPureIdStr += aDialogName;
- aPureIdStr += aDot;
+ OUString aPureIdStr = OUString::number( nUniqueId )
+ + aDot
+ + aDialogName
+ + aDot;
if( !aCtrlName.isEmpty() )
{
aPureIdStr += aCtrlName;
@@ -402,10 +402,10 @@ sal_Int32 LocalizationMgr::implHandleControlResourceProperties
aIdStrings.realloc( nPropStringCount );
OUString* pIdStrings = aIdStrings.getArray();
- OUString aIdStrBase = aDot;
- aIdStrBase += aCtrlName;
- aIdStrBase += aDot;
- aIdStrBase += aPropName;
+ OUString aIdStrBase = aDot
+ + aCtrlName
+ + aDot
+ + aPropName;
const Locale* pLocales = aLocaleSeq.getConstArray();
sal_Int32 i;
@@ -420,8 +420,8 @@ sal_Int32 LocalizationMgr::implHandleControlResourceProperties
}
sal_Int32 nUniqueId = xStringResourceManager->getUniqueNumericId();
- OUString aPureIdStr = OUString::number( nUniqueId );
- aPureIdStr += aIdStrBase;
+ OUString aPureIdStr = OUString::number( nUniqueId )
+ + aIdStrBase;
// Set Id for all locales
for( sal_Int32 iLocale = 0 ; iLocale < nLocaleCount ; iLocale++ )
@@ -430,8 +430,7 @@ sal_Int32 LocalizationMgr::implHandleControlResourceProperties
xStringResourceManager->setStringForLocale( aPureIdStr, aPropStr, rLocale );
}
- OUString aPropIdStr = aEsc;
- aPropIdStr += aPureIdStr;
+ OUString aPropIdStr = aEsc + aPureIdStr;
pIdStrings[i] = aPropIdStr;
}
xPropertySet->setPropertyValue( aPropName, Any(aIdStrings) );
@@ -499,10 +498,10 @@ sal_Int32 LocalizationMgr::implHandleControlResourceProperties
aIdStrings.realloc( nPropStringCount );
OUString* pIdStrings = aIdStrings.getArray();
- OUString aIdStrBase = aDot;
- aIdStrBase += aCtrlName;
- aIdStrBase += aDot;
- aIdStrBase += aPropName;
+ OUString aIdStrBase = aDot
+ + aCtrlName
+ + aDot
+ + aPropName;
const Locale* pLocales = aLocaleSeq.getConstArray();
sal_Int32 i;
@@ -512,8 +511,8 @@ sal_Int32 LocalizationMgr::implHandleControlResourceProperties
OUString aPureSourceIdStr = aSourceIdStr.copy( 1 );
sal_Int32 nUniqueId = xStringResourceManager->getUniqueNumericId();
- OUString aPureIdStr = OUString::number( nUniqueId );
- aPureIdStr += aIdStrBase;
+ OUString aPureIdStr = OUString::number( nUniqueId )
+ + aIdStrBase;
// Set Id for all locales
for( sal_Int32 iLocale = 0 ; iLocale < nLocaleCount ; iLocale++ )
@@ -532,8 +531,7 @@ sal_Int32 LocalizationMgr::implHandleControlResourceProperties
{}
}
- OUString aPropIdStr = aEsc;
- aPropIdStr += aPureIdStr;
+ OUString aPropIdStr = aEsc + aPureIdStr;
pIdStrings[i] = aPropIdStr;
}
xPropertySet->setPropertyValue( aPropName, Any(aIdStrings) );
@@ -545,10 +543,10 @@ sal_Int32 LocalizationMgr::implHandleControlResourceProperties
aIdStrings.realloc( nPropStringCount );
OUString* pIdStrings = aIdStrings.getArray();
- OUString aIdStrBase = aDot;
- aIdStrBase += aCtrlName;
- aIdStrBase += aDot;
- aIdStrBase += aPropName;
+ OUString aIdStrBase = aDot
+ + aCtrlName
+ + aDot
+ + aPropName;
const Locale& rDefaultLocale = xSourceStringResolver->getDefaultLocale();
@@ -560,8 +558,8 @@ sal_Int32 LocalizationMgr::implHandleControlResourceProperties
OUString aPureSourceIdStr = aSourceIdStr.copy( 1 );
sal_Int32 nUniqueId = xStringResourceManager->getUniqueNumericId();
- OUString aPureIdStr = OUString::number( nUniqueId );
- aPureIdStr += aIdStrBase;
+ OUString aPureIdStr = OUString::number( nUniqueId )
+ + aIdStrBase;
// Set Id for all locales
for( sal_Int32 iLocale = 0 ; iLocale < nLocaleCount ; iLocale++ )
@@ -582,8 +580,7 @@ sal_Int32 LocalizationMgr::implHandleControlResourceProperties
xStringResourceManager->setStringForLocale( aPureIdStr, aResStr, rLocale );
}
- OUString aPropIdStr = aEsc;
- aPropIdStr += aPureIdStr;
+ OUString aPropIdStr = aEsc + aPureIdStr;
pIdStrings[i] = aPropIdStr;
}
xPropertySet->setPropertyValue( aPropName, Any(aIdStrings) );
More information about the Libreoffice-commits
mailing list