diff options
author | Noel Grandin <noel@peralex.com> | 2013-01-16 16:28:45 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-02-11 08:02:11 +0200 |
commit | c4d051c5dbee532264e1bfc2ccdb337c6dcf83ed (patch) | |
tree | d6a6bd49e9cfcfc46e3cd8fd905526fc97e2ed85 /cui | |
parent | a00fe5cd4aa115e131919c4dbfea87c94b51e044 (diff) |
fdo#46808, Adapt ConversionDictionaryList UNO service to new style
Change-Id: I16efc7466a2dbcccb4dddefdccada8549e7252f8
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/hangulhanjadlg.cxx | 43 |
1 files changed, 17 insertions, 26 deletions
diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx index 0c623d38ec4b..d994258066f2 100644 --- a/cui/source/dialogs/hangulhanjadlg.cxx +++ b/cui/source/dialogs/hangulhanjadlg.cxx @@ -32,7 +32,7 @@ #include <unotools/linguprops.hxx> #include <com/sun/star/linguistic2/ConversionDictionaryType.hpp> #include <com/sun/star/linguistic2/ConversionDirection.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/linguistic2/ConversionDictionaryList.hpp> #include <com/sun/star/i18n/TextConversionOption.hpp> #include <com/sun/star/util/XFlushable.hpp> @@ -932,41 +932,32 @@ namespace svx { if( !m_xConversionDictionaryList.is() ) { - Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() ); - if( xMgr.is() ) - { - m_xConversionDictionaryList = Reference< XConversionDictionaryList >( xMgr->createInstance( - OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.linguistic2.ConversionDictionaryList")) ), - UNO_QUERY ); - } + m_xConversionDictionaryList = ConversionDictionaryList::create( ::comphelper::getProcessComponentContext() ); } m_aDictList.clear(); m_aDictsLB.Clear(); - if( m_xConversionDictionaryList.is() ) + Reference< XNameContainer > xNameCont = m_xConversionDictionaryList->getDictionaryContainer(); + Reference< XNameAccess > xNameAccess = Reference< XNameAccess >( xNameCont, UNO_QUERY ); + if( xNameAccess.is() ) { - Reference< XNameContainer > xNameCont = m_xConversionDictionaryList->getDictionaryContainer(); - Reference< XNameAccess > xNameAccess = Reference< XNameAccess >( xNameCont, UNO_QUERY ); - if( xNameAccess.is() ) - { - Sequence< ::rtl::OUString > aDictNames( xNameAccess->getElementNames() ); + Sequence< ::rtl::OUString > aDictNames( xNameAccess->getElementNames() ); - const ::rtl::OUString* pDic = aDictNames.getConstArray(); - sal_Int32 nCount = aDictNames.getLength(); + const ::rtl::OUString* pDic = aDictNames.getConstArray(); + sal_Int32 nCount = aDictNames.getLength(); - sal_Int32 i; - for( i = 0 ; i < nCount ; ++i ) + sal_Int32 i; + for( i = 0 ; i < nCount ; ++i ) + { + Any aAny( xNameAccess->getByName( pDic[ i ] ) ); + Reference< XConversionDictionary > xDic; + if( ( aAny >>= xDic ) && xDic.is() ) { - Any aAny( xNameAccess->getByName( pDic[ i ] ) ); - Reference< XConversionDictionary > xDic; - if( ( aAny >>= xDic ) && xDic.is() ) + if( LANGUAGE_KOREAN == LanguageTag( xDic->getLocale() ).getLanguageType() ) { - if( LANGUAGE_KOREAN == LanguageTag( xDic->getLocale() ).getLanguageType() ) - { - m_aDictList.push_back( xDic ); - AddDict( xDic->getName(), xDic->isActive() ); - } + m_aDictList.push_back( xDic ); + AddDict( xDic->getName(), xDic->isActive() ); } } } |