summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-11-02 09:46:12 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-11-05 16:43:15 +0100
commitd2c45d0460cf99aadde1aaec11e032f488fa277b (patch)
treec04080649e3d5393d9d73e2ab9326b56ee3cc6cb /i18npool
parentec1c96a9b69a5a2546fe2564cd92fe9e33471fbc (diff)
fdo#46808, Adapt i18n::Transliteration UNO service to new style
Simply make the service implement XExtendedTransliteration, since all of the implementatins already do that. Change-Id: If03bf56a8d33931ad0230743a4603e2ae9b104ac
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/source/search/textsearch.cxx31
1 files changed, 9 insertions, 22 deletions
diff --git a/i18npool/source/search/textsearch.cxx b/i18npool/source/search/textsearch.cxx
index 115e481959e6..b28c23a4539b 100644
--- a/i18npool/source/search/textsearch.cxx
+++ b/i18npool/source/search/textsearch.cxx
@@ -40,6 +40,7 @@
#include <com/sun/star/i18n/ScriptType.hpp>
#include <com/sun/star/i18n/CharacterIteratorMode.hpp>
#include <com/sun/star/i18n/KCharacterType.hpp>
+#include <com/sun/star/i18n/Transliteration.hpp>
#include <com/sun/star/registry/XRegistryKey.hpp>
#include <cppuhelper/factory.hxx>
#include <cppuhelper/weak.hxx>
@@ -112,19 +113,12 @@ void TextSearch::setOptions( const SearchOptions& rOptions ) throw( RuntimeExcep
{
if( !xTranslit.is() )
{
- Reference < XInterface > xI = xMSF->createInstance(
- OUString(
- "com.sun.star.i18n.Transliteration"));
- if ( xI.is() )
- xI->queryInterface( ::getCppuType(
- (const Reference< XExtendedTransliteration >*)0))
- >>= xTranslit;
+ xTranslit.set( Transliteration::create( comphelper::getComponentContext(xMSF) ) );
}
// Load transliteration module
- if( xTranslit.is() )
- xTranslit->loadModule(
- (TransliterationModules)( aSrchPara.transliterateFlags & SIMPLE_TRANS_MASK ),
- aSrchPara.Locale);
+ xTranslit->loadModule(
+ (TransliterationModules)( aSrchPara.transliterateFlags & SIMPLE_TRANS_MASK ),
+ aSrchPara.Locale);
}
else if( xTranslit.is() )
xTranslit = 0;
@@ -134,19 +128,12 @@ void TextSearch::setOptions( const SearchOptions& rOptions ) throw( RuntimeExcep
{
if( !xTranslit2.is() )
{
- Reference < XInterface > xI = xMSF->createInstance(
- OUString(
- "com.sun.star.i18n.Transliteration"));
- if ( xI.is() )
- xI->queryInterface( ::getCppuType(
- (const Reference< XExtendedTransliteration >*)0))
- >>= xTranslit2;
+ xTranslit2.set( Transliteration::create( comphelper::getComponentContext(xMSF) ) );
}
// Load transliteration module
- if( xTranslit2.is() )
- xTranslit2->loadModule(
- (TransliterationModules)( aSrchPara.transliterateFlags & COMPLEX_TRANS_MASK ),
- aSrchPara.Locale);
+ xTranslit2->loadModule(
+ (TransliterationModules)( aSrchPara.transliterateFlags & COMPLEX_TRANS_MASK ),
+ aSrchPara.Locale);
}
if ( !xBreak.is() )