Kaydet (Commit) 34af964c authored tarafından Eike Rathke's avatar Eike Rathke

use get*LocaleServiceName

Change-Id: I24e10da4b511d0413268fe31ed02afe5f3b3734e
üst d066560a
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
#include <assert.h> #include <assert.h>
#include <textconversionImpl.hxx> #include <textconversionImpl.hxx>
#include <localedata.hxx>
#include <i18nlangtag/languagetag.hxx>
using namespace com::sun::star::lang; using namespace com::sun::star::lang;
using namespace com::sun::star::uno; using namespace com::sun::star::uno;
...@@ -85,21 +87,21 @@ TextConversionImpl::getLocaleSpecificTextConversion(const Locale& rLocale) throw ...@@ -85,21 +87,21 @@ TextConversionImpl::getLocaleSpecificTextConversion(const Locale& rLocale) throw
if (rLocale != aLocale) { if (rLocale != aLocale) {
aLocale = rLocale; aLocale = rLocale;
OUString aPrefix("com.sun.star.i18n.TextConversion_");
Reference < XInterface > xI; Reference < XInterface > xI;
xI = m_xContext->getServiceManager()->createInstanceWithContext( xI = m_xContext->getServiceManager()->createInstanceWithContext(
OUString("com.sun.star.i18n.TextConversion_") + aLocale.Language, m_xContext); aPrefix + LocaleDataImpl::getFirstLocaleServiceName( aLocale), m_xContext);
if (!xI.is())
if ( ! xI.is() ) {
xI = m_xContext->getServiceManager()->createInstanceWithContext( ::std::vector< OUString > aFallbacks( LocaleDataImpl::getFallbackLocaleServiceNames( aLocale));
OUString("com.sun.star.i18n.TextConversion_") + aLocale.Language + for (::std::vector< OUString >::const_iterator it( aFallbacks.begin()); it != aFallbacks.end(); ++it)
OUString("_") + aLocale.Country, m_xContext); {
if ( ! xI.is() ) xI = m_xContext->getServiceManager()->createInstanceWithContext( aPrefix + *it, m_xContext);
xI = m_xContext->getServiceManager()->createInstanceWithContext( if (xI.is())
OUString("com.sun.star.i18n.TextConversion_") + aLocale.Language + break;
OUString("_") + aLocale.Country + }
OUString("_") + aLocale.Variant, m_xContext); }
if (xI.is()) if (xI.is())
xTC.set( xI, UNO_QUERY ); xTC.set( xI, UNO_QUERY );
else if (xTC.is()) else if (xTC.is())
......
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