summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-07-10 13:22:15 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-07-11 09:59:10 +0100
commitb18e1e705148348392632596ec686206ec213019 (patch)
tree2d96c8a6f1313dc234bfd8d9a078050f0da41244 /editeng
parente18f1d6216b13c38525d37448da882a63a3d0055 (diff)
Related: rhbz#836937 halve calls to expensive getAvailableServices
getAvailableServices is very expensive, so halve the amount of calls to it that we need. This should be logically equivalent Change-Id: I5627ed539695fd837a497362cf9873debd254013
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/misc/unolingu.cxx25
1 files changed, 9 insertions, 16 deletions
diff --git a/editeng/source/misc/unolingu.cxx b/editeng/source/misc/unolingu.cxx
index 486052e9a634..d9cc031c89f9 100644
--- a/editeng/source/misc/unolingu.cxx
+++ b/editeng/source/misc/unolingu.cxx
@@ -267,7 +267,9 @@ void SvxLinguConfigUpdate::UpdateAll( sal_Bool bForceCheck )
}
//
- // add new available language/servcice entries
+ // add new available language/service entries
+ // and
+ // set last found services to currently available ones
//
uno::Reference< XAvailableLocales > xAvail( xLngSvcMgr, UNO_QUERY );
Sequence< Locale > aAvailLocales( xAvail->getAvailableLocales(aService) );
@@ -275,15 +277,19 @@ void SvxLinguConfigUpdate::UpdateAll( sal_Bool bForceCheck )
const Locale *pAvailLocale = aAvailLocales.getConstArray();
for (i = 0; i < nAvailLocales; ++i)
{
+ OUString aCfgLocaleStr( MsLangId::convertLanguageToIsoString(
+ SvxLocaleToLanguage( pAvailLocale[i] ) ) );
+
Sequence< OUString > aAvailSvcs(
xLngSvcMgr->getAvailableServices( aService, pAvailLocale[i] ));
+
+ aLastFoundSvcs[k][ aCfgLocaleStr ] = aAvailSvcs;
+
Sequence< OUString > aLastSvcs(
lcl_GetLastFoundSvcs( aCfg, aLastFoundList , pAvailLocale[i] ));
Sequence< OUString > aNewSvcs =
lcl_GetNewEntries( aLastSvcs, aAvailSvcs );
- OUString aCfgLocaleStr( MsLangId::convertLanguageToIsoString(
- SvxLocaleToLanguage( pAvailLocale[i] ) ) );
Sequence< OUString > aCfgSvcs( aCurSvcs[k][ aCfgLocaleStr ] );
// merge services list (previously configured to be listed first).
@@ -291,19 +297,6 @@ void SvxLinguConfigUpdate::UpdateAll( sal_Bool bForceCheck )
aCurSvcs[k][ aCfgLocaleStr ] = aCfgSvcs;
}
-
- //
- // set last found services to currently available ones
- //
- for (i = 0; i < nAvailLocales; ++i)
- {
- Sequence< OUString > aSvcImplNames(
- xLngSvcMgr->getAvailableServices( aService, pAvailLocale[i] ) );
-
- OUString aCfgLocaleStr( MsLangId::convertLanguageToIsoString(
- SvxLocaleToLanguage( pAvailLocale[i] ) ) );
- aLastFoundSvcs[k][ aCfgLocaleStr ] = aSvcImplNames;
- }
}
//