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

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/26585Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst 1413c5d3
...@@ -171,10 +171,10 @@ OUString implCreatePureResourceId ...@@ -171,10 +171,10 @@ OUString implCreatePureResourceId
const Reference< XStringResourceManager >& xStringResourceManager ) const Reference< XStringResourceManager >& xStringResourceManager )
{ {
sal_Int32 nUniqueId = xStringResourceManager->getUniqueNumericId(); sal_Int32 nUniqueId = xStringResourceManager->getUniqueNumericId();
OUString aPureIdStr = OUString::number( nUniqueId ); OUString aPureIdStr = OUString::number( nUniqueId )
aPureIdStr += aDot; + aDot
aPureIdStr += aDialogName; + aDialogName
aPureIdStr += aDot; + aDot;
if( !aCtrlName.isEmpty() ) if( !aCtrlName.isEmpty() )
{ {
aPureIdStr += aCtrlName; aPureIdStr += aCtrlName;
...@@ -402,10 +402,10 @@ sal_Int32 LocalizationMgr::implHandleControlResourceProperties ...@@ -402,10 +402,10 @@ sal_Int32 LocalizationMgr::implHandleControlResourceProperties
aIdStrings.realloc( nPropStringCount ); aIdStrings.realloc( nPropStringCount );
OUString* pIdStrings = aIdStrings.getArray(); OUString* pIdStrings = aIdStrings.getArray();
OUString aIdStrBase = aDot; OUString aIdStrBase = aDot
aIdStrBase += aCtrlName; + aCtrlName
aIdStrBase += aDot; + aDot
aIdStrBase += aPropName; + aPropName;
const Locale* pLocales = aLocaleSeq.getConstArray(); const Locale* pLocales = aLocaleSeq.getConstArray();
sal_Int32 i; sal_Int32 i;
...@@ -420,8 +420,8 @@ sal_Int32 LocalizationMgr::implHandleControlResourceProperties ...@@ -420,8 +420,8 @@ sal_Int32 LocalizationMgr::implHandleControlResourceProperties
} }
sal_Int32 nUniqueId = xStringResourceManager->getUniqueNumericId(); sal_Int32 nUniqueId = xStringResourceManager->getUniqueNumericId();
OUString aPureIdStr = OUString::number( nUniqueId ); OUString aPureIdStr = OUString::number( nUniqueId )
aPureIdStr += aIdStrBase; + aIdStrBase;
// Set Id for all locales // Set Id for all locales
for( sal_Int32 iLocale = 0 ; iLocale < nLocaleCount ; iLocale++ ) for( sal_Int32 iLocale = 0 ; iLocale < nLocaleCount ; iLocale++ )
...@@ -430,8 +430,7 @@ sal_Int32 LocalizationMgr::implHandleControlResourceProperties ...@@ -430,8 +430,7 @@ sal_Int32 LocalizationMgr::implHandleControlResourceProperties
xStringResourceManager->setStringForLocale( aPureIdStr, aPropStr, rLocale ); xStringResourceManager->setStringForLocale( aPureIdStr, aPropStr, rLocale );
} }
OUString aPropIdStr = aEsc; OUString aPropIdStr = aEsc + aPureIdStr;
aPropIdStr += aPureIdStr;
pIdStrings[i] = aPropIdStr; pIdStrings[i] = aPropIdStr;
} }
xPropertySet->setPropertyValue( aPropName, Any(aIdStrings) ); xPropertySet->setPropertyValue( aPropName, Any(aIdStrings) );
...@@ -499,10 +498,10 @@ sal_Int32 LocalizationMgr::implHandleControlResourceProperties ...@@ -499,10 +498,10 @@ sal_Int32 LocalizationMgr::implHandleControlResourceProperties
aIdStrings.realloc( nPropStringCount ); aIdStrings.realloc( nPropStringCount );
OUString* pIdStrings = aIdStrings.getArray(); OUString* pIdStrings = aIdStrings.getArray();
OUString aIdStrBase = aDot; OUString aIdStrBase = aDot
aIdStrBase += aCtrlName; + aCtrlName
aIdStrBase += aDot; + aDot
aIdStrBase += aPropName; + aPropName;
const Locale* pLocales = aLocaleSeq.getConstArray(); const Locale* pLocales = aLocaleSeq.getConstArray();
sal_Int32 i; sal_Int32 i;
...@@ -512,8 +511,8 @@ sal_Int32 LocalizationMgr::implHandleControlResourceProperties ...@@ -512,8 +511,8 @@ sal_Int32 LocalizationMgr::implHandleControlResourceProperties
OUString aPureSourceIdStr = aSourceIdStr.copy( 1 ); OUString aPureSourceIdStr = aSourceIdStr.copy( 1 );
sal_Int32 nUniqueId = xStringResourceManager->getUniqueNumericId(); sal_Int32 nUniqueId = xStringResourceManager->getUniqueNumericId();
OUString aPureIdStr = OUString::number( nUniqueId ); OUString aPureIdStr = OUString::number( nUniqueId )
aPureIdStr += aIdStrBase; + aIdStrBase;
// Set Id for all locales // Set Id for all locales
for( sal_Int32 iLocale = 0 ; iLocale < nLocaleCount ; iLocale++ ) for( sal_Int32 iLocale = 0 ; iLocale < nLocaleCount ; iLocale++ )
...@@ -532,8 +531,7 @@ sal_Int32 LocalizationMgr::implHandleControlResourceProperties ...@@ -532,8 +531,7 @@ sal_Int32 LocalizationMgr::implHandleControlResourceProperties
{} {}
} }
OUString aPropIdStr = aEsc; OUString aPropIdStr = aEsc + aPureIdStr;
aPropIdStr += aPureIdStr;
pIdStrings[i] = aPropIdStr; pIdStrings[i] = aPropIdStr;
} }
xPropertySet->setPropertyValue( aPropName, Any(aIdStrings) ); xPropertySet->setPropertyValue( aPropName, Any(aIdStrings) );
...@@ -545,10 +543,10 @@ sal_Int32 LocalizationMgr::implHandleControlResourceProperties ...@@ -545,10 +543,10 @@ sal_Int32 LocalizationMgr::implHandleControlResourceProperties
aIdStrings.realloc( nPropStringCount ); aIdStrings.realloc( nPropStringCount );
OUString* pIdStrings = aIdStrings.getArray(); OUString* pIdStrings = aIdStrings.getArray();
OUString aIdStrBase = aDot; OUString aIdStrBase = aDot
aIdStrBase += aCtrlName; + aCtrlName
aIdStrBase += aDot; + aDot
aIdStrBase += aPropName; + aPropName;
const Locale& rDefaultLocale = xSourceStringResolver->getDefaultLocale(); const Locale& rDefaultLocale = xSourceStringResolver->getDefaultLocale();
...@@ -560,8 +558,8 @@ sal_Int32 LocalizationMgr::implHandleControlResourceProperties ...@@ -560,8 +558,8 @@ sal_Int32 LocalizationMgr::implHandleControlResourceProperties
OUString aPureSourceIdStr = aSourceIdStr.copy( 1 ); OUString aPureSourceIdStr = aSourceIdStr.copy( 1 );
sal_Int32 nUniqueId = xStringResourceManager->getUniqueNumericId(); sal_Int32 nUniqueId = xStringResourceManager->getUniqueNumericId();
OUString aPureIdStr = OUString::number( nUniqueId ); OUString aPureIdStr = OUString::number( nUniqueId )
aPureIdStr += aIdStrBase; + aIdStrBase;
// Set Id for all locales // Set Id for all locales
for( sal_Int32 iLocale = 0 ; iLocale < nLocaleCount ; iLocale++ ) for( sal_Int32 iLocale = 0 ; iLocale < nLocaleCount ; iLocale++ )
...@@ -582,8 +580,7 @@ sal_Int32 LocalizationMgr::implHandleControlResourceProperties ...@@ -582,8 +580,7 @@ sal_Int32 LocalizationMgr::implHandleControlResourceProperties
xStringResourceManager->setStringForLocale( aPureIdStr, aResStr, rLocale ); xStringResourceManager->setStringForLocale( aPureIdStr, aResStr, rLocale );
} }
OUString aPropIdStr = aEsc; OUString aPropIdStr = aEsc + aPureIdStr;
aPropIdStr += aPureIdStr;
pIdStrings[i] = aPropIdStr; pIdStrings[i] = aPropIdStr;
} }
xPropertySet->setPropertyValue( aPropName, Any(aIdStrings) ); xPropertySet->setPropertyValue( aPropName, Any(aIdStrings) );
......
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