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

use get*LocaleServiceName

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