diff options
Diffstat (limited to 'unotools/source/config/lingucfg.cxx')
-rw-r--r-- | unotools/source/config/lingucfg.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx index a38fb51b61b7..03ad0747ad34 100644 --- a/unotools/source/config/lingucfg.cxx +++ b/unotools/source/config/lingucfg.cxx @@ -926,6 +926,27 @@ bool SvtLinguConfig::GetSupportedDictionaryFormatsFor( return bSuccess; } +bool SvtLinguConfig::GetLocaleListFor( const OUString &rSetName, const OUString &rSetEntry, css::uno::Sequence< OUString > &rLocaleList ) const +{ + if (rSetName.isEmpty() || rSetEntry.isEmpty()) + return false; + bool bSuccess = false; + try + { + uno::Reference< container::XNameAccess > xNA( GetMainUpdateAccess(), uno::UNO_QUERY_THROW ); + xNA.set( xNA->getByName("ServiceManager"), uno::UNO_QUERY_THROW ); + xNA.set( xNA->getByName( rSetName ), uno::UNO_QUERY_THROW ); + xNA.set( xNA->getByName( rSetEntry ), uno::UNO_QUERY_THROW ); + if (xNA->getByName( "Locales" ) >>= rLocaleList) + bSuccess = true; + DBG_ASSERT( rLocaleList.hasElements(), "Locale list is empty" ); + } + catch (uno::Exception &) + { + } + return bSuccess; +} + static bool lcl_GetFileUrlFromOrigin( OUString /*out*/ &rFileUrl, const OUString &rOrigin ) |