diff options
23 files changed, 66 insertions, 83 deletions
diff --git a/basic/source/classes/global.cxx b/basic/source/classes/global.cxx index 324a18a12aa7..2907b5cdb65f 100644 --- a/basic/source/classes/global.cxx +++ b/basic/source/classes/global.cxx @@ -42,7 +42,7 @@ namespace public: lclTransliterationWrapper() : m_aTransliteration( - comphelper::getProcessServiceFactory(), + comphelper::getProcessComponentContext(), com::sun::star::i18n::TransliterationModules_IGNORE_CASE ) { const LanguageType eOfficeLanguage = Application::GetSettings().GetLanguage(); diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index e189b2866d6d..5dab1a21a084 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -1626,9 +1626,9 @@ RTLFUNC(StrComp) ::utl::TransliterationWrapper* pTransliterationWrapper = GetSbData()->pTransliterationWrapper; if( !pTransliterationWrapper ) { - uno::Reference< lang::XMultiServiceFactory > xSMgr = getProcessServiceFactory(); + uno::Reference< uno::XComponentContext > xContext = getProcessComponentContext(); pTransliterationWrapper = GetSbData()->pTransliterationWrapper = - new ::utl::TransliterationWrapper( xSMgr, + new ::utl::TransliterationWrapper( xContext, i18n::TransliterationModules_IGNORE_CASE | i18n::TransliterationModules_IGNORE_KANA | i18n::TransliterationModules_IGNORE_WIDTH ); @@ -4082,8 +4082,8 @@ RTLFUNC(StrConv) String aNewStr( aOldStr ); if( nType != 0 ) { - uno::Reference< lang::XMultiServiceFactory > xSMgr = getProcessServiceFactory(); - ::utl::TransliterationWrapper aTransliterationWrapper( xSMgr,nType ); + uno::Reference< uno::XComponentContext > xContext = getProcessComponentContext(); + ::utl::TransliterationWrapper aTransliterationWrapper( xContext, nType ); uno::Sequence<sal_Int32> aOffsets; aTransliterationWrapper.loadModuleIfNeeded( nLanguage ); aNewStr = aTransliterationWrapper.transliterate( aOldStr, nLanguage, 0, nOldLen, &aOffsets ); diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index d6ff77ff698c..27a40293ddf1 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -2704,7 +2704,7 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, sal_Bool bLenChanged = sal_False; EditUndoTransliteration* pUndo = NULL; - utl::TransliterationWrapper aTranslitarationWrapper( ::comphelper::getProcessServiceFactory(), nTransliterationMode ); + utl::TransliterationWrapper aTranslitarationWrapper( ::comphelper::getProcessComponentContext(), nTransliterationMode ); sal_Bool bConsiderLanguage = aTranslitarationWrapper.needLanguageForTheMode(); for ( sal_uInt16 nNode = nStartNode; nNode <= nEndNode; nNode++ ) diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index d6995f64d0de..abfbfd7266f1 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -196,7 +196,7 @@ static LocaleDataWrapper& GetLocaleDataWrapper( sal_uInt16 nLang ) static TransliterationWrapper& GetIgnoreTranslWrapper() { static int bIsInit = 0; - static TransliterationWrapper aWrp( GetProcessFact(), + static TransliterationWrapper aWrp( ::comphelper::getProcessComponentContext(), ::com::sun::star::i18n::TransliterationModules_IGNORE_KANA | ::com::sun::star::i18n::TransliterationModules_IGNORE_WIDTH ); if( !bIsInit ) 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() ) diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index f5f641a83c43..27025bb53a2b 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -155,6 +155,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/i18n,\ BreakIterator \ LocaleCalendar \ LocaleData \ + Transliteration \ )) $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/linguistic2,\ LanguageGuessing \ @@ -871,7 +872,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/i18n,\ NumberFormatMapper \ OrdinalSuffix \ TextConversion \ - Transliteration \ )) $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/image,\ ImageMap \ diff --git a/offapi/com/sun/star/i18n/Transliteration.idl b/offapi/com/sun/star/i18n/Transliteration.idl index 2cc2bed30918..7e598f61718a 100644 --- a/offapi/com/sun/star/i18n/Transliteration.idl +++ b/offapi/com/sun/star/i18n/Transliteration.idl @@ -28,12 +28,7 @@ module com { module sun { module star { module i18n { /// Transliteration of characters, such as case folding -published service Transliteration -{ - interface com::sun::star::i18n::XTransliteration; - - [optional] interface com::sun::star::i18n::XExtendedTransliteration; -}; +published service Transliteration : XExtendedTransliteration; }; }; }; }; diff --git a/offapi/type_reference/types.rdb b/offapi/type_reference/types.rdb Binary files differindex 14cba0b4a5c3..af18ea9d7225 100644 --- a/offapi/type_reference/types.rdb +++ b/offapi/type_reference/types.rdb diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index 4b66d43b0031..4286cfd71794 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -1512,7 +1512,7 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nTyp { OSL_ENSURE( rMultiMark.IsMultiMarked(), "TransliterateText: no selection" ); - utl::TransliterationWrapper aTranslitarationWrapper( xServiceManager, nType ); + utl::TransliterationWrapper aTranslitarationWrapper( comphelper::getComponentContext(xServiceManager), nType ); bool bConsiderLanguage = aTranslitarationWrapper.needLanguageForTheMode(); sal_uInt16 nLanguage = LANGUAGE_SYSTEM; diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index 4b9eaa66c6fc..378a2d46bc7b 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -1117,7 +1117,7 @@ utl::TransliterationWrapper* ScGlobal::GetpTransliteration() { const LanguageType eOfficeLanguage = Application::GetSettings().GetLanguage(); pTransliteration = new ::utl::TransliterationWrapper( - ::comphelper::getProcessServiceFactory(), SC_TRANSLITERATION_IGNORECASE ); + ::comphelper::getProcessComponentContext(), SC_TRANSLITERATION_IGNORECASE ); pTransliteration->loadModuleIfNeeded( eOfficeLanguage ); } OSL_ENSURE( @@ -1165,7 +1165,7 @@ CollatorWrapper* ScGlobal::GetCaseCollator() if ( !pCaseTransliteration ) { const LanguageType eOfficeLanguage = Application::GetSettings().GetLanguage(); - pCaseTransliteration = new ::utl::TransliterationWrapper(::comphelper::getProcessServiceFactory(), SC_TRANSLITERATION_CASESENSE ); + pCaseTransliteration = new ::utl::TransliterationWrapper(::comphelper::getProcessComponentContext(), SC_TRANSLITERATION_CASESENSE ); pCaseTransliteration->loadModuleIfNeeded( eOfficeLanguage ); } return pCaseTransliteration; diff --git a/sc/source/core/tool/cellkeytranslator.cxx b/sc/source/core/tool/cellkeytranslator.cxx index ea63b57e6204..1a654b5627ee 100644 --- a/sc/source/core/tool/cellkeytranslator.cxx +++ b/sc/source/core/tool/cellkeytranslator.cxx @@ -179,7 +179,7 @@ void ScCellKeywordTranslator::transKeyword(rtl::OUString& rName, const Locale* p } ScCellKeywordTranslator::ScCellKeywordTranslator() : - maTransWrapper( ::comphelper::getProcessServiceFactory(), + maTransWrapper( ::comphelper::getProcessComponentContext(), i18n::TransliterationModules_LOWERCASE_UPPERCASE ) { init(); diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 3809aa4fee0a..3ff768e41d6e 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -3248,7 +3248,7 @@ void ScInterpreter::ScChar() static ::rtl::OUString lcl_convertIntoHalfWidth( const ::rtl::OUString & rStr ) { static bool bFirstASCCall = true; - static utl::TransliterationWrapper aTrans( ::comphelper::getProcessServiceFactory(), 0 ); + static utl::TransliterationWrapper aTrans( ::comphelper::getProcessComponentContext(), 0 ); if( bFirstASCCall ) { @@ -3263,7 +3263,7 @@ static ::rtl::OUString lcl_convertIntoHalfWidth( const ::rtl::OUString & rStr ) static ::rtl::OUString lcl_convertIntoFullWidth( const ::rtl::OUString & rStr ) { static bool bFirstJISCall = true; - static utl::TransliterationWrapper aTrans( ::comphelper::getProcessServiceFactory(), 0 ); + static utl::TransliterationWrapper aTrans( ::comphelper::getProcessComponentContext(), 0 ); if( bFirstJISCall ) { diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index b56e93776586..6e65a15c0cbf 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -1293,7 +1293,7 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm ) // For date recognition ::utl::TransliterationWrapper aTransliteration( - pDoc->GetServiceManager(), SC_TRANSLITERATION_IGNORECASE ); + comphelper::getComponentContext(pDoc->GetServiceManager()), SC_TRANSLITERATION_IGNORECASE ); aTransliteration.loadModuleIfNeeded( eDocLang ); CalendarWrapper aCalendar( comphelper::getComponentContext(pDoc->GetServiceManager()) ); aCalendar.loadDefaultCalendar( @@ -1303,7 +1303,7 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm ) if ( eDocLang != LANGUAGE_ENGLISH_US ) { pEnglishTransliteration = new ::utl::TransliterationWrapper ( - pDoc->GetServiceManager(), SC_TRANSLITERATION_IGNORECASE ); + comphelper::getComponentContext(pDoc->GetServiceManager()), SC_TRANSLITERATION_IGNORECASE ); aTransliteration.loadModuleIfNeeded( LANGUAGE_ENGLISH_US ); pEnglishCalendar = new CalendarWrapper ( comphelper::getComponentContext(pDoc->GetServiceManager()) ); pEnglishCalendar->loadDefaultCalendar( diff --git a/svl/inc/svl/ondemand.hxx b/svl/inc/svl/ondemand.hxx index 47488504b073..364d48f5f27b 100644 --- a/svl/inc/svl/ondemand.hxx +++ b/svl/inc/svl/ondemand.hxx @@ -32,6 +32,15 @@ #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> +namespace comphelper { + + com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > + getComponentContext( + com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > + const & factory); + +} + /* On demand instanciation and initialization of several i18n wrappers, helping the number formatter to not perform worse than it already does. @@ -300,7 +309,7 @@ public: if ( !bValid ) { if ( !pPtr ) - pPtr = new ::utl::TransliterationWrapper( xSMgr, nType ); + pPtr = new ::utl::TransliterationWrapper( comphelper::getComponentContext(xSMgr), nType ); pPtr->loadModuleIfNeeded( eLanguage ); bValid = true; } @@ -310,7 +319,7 @@ public: const ::utl::TransliterationWrapper* getForModule( const String& rModule, LanguageType eLang ) const { if ( !pPtr ) - pPtr = new ::utl::TransliterationWrapper( xSMgr, nType ); + pPtr = new ::utl::TransliterationWrapper( comphelper::getComponentContext(xSMgr), nType ); pPtr->loadModuleByImplName( rModule, eLang ); bValid = false; // reforce settings change in get() return pPtr; diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx index 71a5a8942ace..3a725a731c09 100644 --- a/sw/source/core/bastyp/init.cxx +++ b/sw/source/core/bastyp/init.cxx @@ -865,9 +865,9 @@ namespace public: TransWrp() { - uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory(); + uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); - xTransWrp.reset(new ::utl::TransliterationWrapper( xMSF, + xTransWrp.reset(new ::utl::TransliterationWrapper( xContext, i18n::TransliterationModules_IGNORE_CASE | i18n::TransliterationModules_IGNORE_KANA | i18n::TransliterationModules_IGNORE_WIDTH )); diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index f216f3b9b6c4..9199073aea5f 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -1126,7 +1126,7 @@ void SwEditShell::SetExtTextInputData( const CommandExtTextInputData& rData ) void SwEditShell::TransliterateText( sal_uInt32 nType ) { - utl::TransliterationWrapper aTrans( ::comphelper::getProcessServiceFactory(), nType ); + utl::TransliterationWrapper aTrans( ::comphelper::getProcessComponentContext(), nType ); StartAllAction(); SET_CURR_SHELL( this ); diff --git a/sw/source/core/undo/unovwr.cxx b/sw/source/core/undo/unovwr.cxx index d5b810f3daa3..3c4899bdef07 100644 --- a/sw/source/core/undo/unovwr.cxx +++ b/sw/source/core/undo/unovwr.cxx @@ -382,7 +382,7 @@ void SwUndoTransliterate::RepeatImpl(::sw::RepeatContext & rContext) void SwUndoTransliterate::DoTransliterate(SwDoc & rDoc, SwPaM & rPam) { - utl::TransliterationWrapper aTrans( ::comphelper::getProcessServiceFactory(), nType ); + utl::TransliterationWrapper aTrans( ::comphelper::getProcessComponentContext(), nType ); rDoc.TransliterateText( rPam, aTrans ); } diff --git a/unotools/inc/unotools/transliterationwrapper.hxx b/unotools/inc/unotools/transliterationwrapper.hxx index 46f0a3917e9a..3a0a8de05042 100644 --- a/unotools/inc/unotools/transliterationwrapper.hxx +++ b/unotools/inc/unotools/transliterationwrapper.hxx @@ -25,8 +25,8 @@ #include <com/sun/star/i18n/XExtendedTransliteration.hpp> namespace com { namespace sun { namespace star { - namespace lang { - class XMultiServiceFactory; + namespace uno { + class XComponentContext; } }}} @@ -36,8 +36,6 @@ namespace utl class UNOTOOLS_DLLPUBLIC TransliterationWrapper { ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory > xSMgr; - ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XExtendedTransliteration > xTrans; ::com::sun::star::lang::Locale aLocale; sal_uInt32 nType; @@ -53,7 +51,7 @@ class UNOTOOLS_DLLPUBLIC TransliterationWrapper public: TransliterationWrapper( const ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory > & xSF, + ::com::sun::star::uno::XComponentContext > & rxContext, sal_uInt32 nType ); ~TransliterationWrapper(); diff --git a/unotools/source/i18n/transliterationwrapper.cxx b/unotools/source/i18n/transliterationwrapper.cxx index f6637521a2b9..517f51008ea1 100644 --- a/unotools/source/i18n/transliterationwrapper.cxx +++ b/unotools/source/i18n/transliterationwrapper.cxx @@ -24,6 +24,7 @@ #include "instance.hxx" #include <com/sun/star/i18n/TransliterationModulesExtra.hpp> +#include <com/sun/star/i18n/Transliteration.hpp> using namespace ::com::sun::star::lang; using namespace ::com::sun::star::i18n; @@ -31,14 +32,11 @@ using namespace ::com::sun::star::uno; using namespace ::utl; TransliterationWrapper::TransliterationWrapper( - const Reference< XMultiServiceFactory > & xSF, + const Reference< XComponentContext > & rxContext, sal_uInt32 nTyp ) - : xSMgr( xSF ), nType( nTyp ), nLanguage( 0 ), bFirstCall( sal_True ) + : nType( nTyp ), nLanguage( 0 ), bFirstCall( sal_True ) { - xTrans = Reference< XExtendedTransliteration > ( - intl_createInstance( xSMgr, "com.sun.star.i18n.Transliteration", - "TransliterationWrapper" ), UNO_QUERY ); - DBG_ASSERT( xTrans.is(), "TransliterationWrapper: no Transliteraion available" ); + xTrans = Transliteration::create(rxContext); } diff --git a/vcl/source/app/i18nhelp.cxx b/vcl/source/app/i18nhelp.cxx index 7e43afa2f87b..3c268108fde1 100644 --- a/vcl/source/app/i18nhelp.cxx +++ b/vcl/source/app/i18nhelp.cxx @@ -27,6 +27,7 @@ ************************************************************************/ +#include "comphelper/processfactory.hxx" #include "unotools/localedatawrapper.hxx" #include "unotools/transliterationwrapper.hxx" @@ -72,7 +73,7 @@ utl::TransliterationWrapper& vcl::I18nHelper::ImplGetTransliterationWrapper() co if ( mbTransliterateIgnoreCase ) nModules |= i18n::TransliterationModules_IGNORE_CASE; - ((vcl::I18nHelper*)this)->mpTransliterationWrapper = new utl::TransliterationWrapper( mxMSF, (i18n::TransliterationModules)nModules ); + ((vcl::I18nHelper*)this)->mpTransliterationWrapper = new utl::TransliterationWrapper( comphelper::getComponentContext(mxMSF), (i18n::TransliterationModules)nModules ); ((vcl::I18nHelper*)this)->mpTransliterationWrapper->loadModuleIfNeeded( MsLangId::convertLocaleToLanguage( maLocale ) ); } return *mpTransliterationWrapper; diff --git a/xmlhelp/source/cxxhelp/provider/content.cxx b/xmlhelp/source/cxxhelp/provider/content.cxx index d4fc1cb668a9..fe166e37abfe 100644 --- a/xmlhelp/source/cxxhelp/provider/content.cxx +++ b/xmlhelp/source/cxxhelp/provider/content.cxx @@ -258,7 +258,7 @@ class ResultSetForQueryFactory { private: - uno::Reference< lang::XMultiServiceFactory > m_xSMgr; + uno::Reference< uno::XComponentContext > m_xContext; uno::Reference< ucb::XContentProvider > m_xProvider; sal_Int32 m_nOpenMode; uno::Sequence< beans::Property > m_seq; @@ -270,14 +270,14 @@ private: public: ResultSetForQueryFactory( - const uno::Reference< lang::XMultiServiceFactory >& xSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, const uno::Reference< ucb::XContentProvider >& xProvider, sal_Int32 nOpenMode, const uno::Sequence< beans::Property >& seq, const uno::Sequence< ucb::NumberedSortingInfo >& seqSort, URLParameter aURLParameter, Databases* pDatabases ) - : m_xSMgr( xSMgr ), + : m_xContext( rxContext ), m_xProvider( xProvider ), m_nOpenMode( nOpenMode ), m_seq( seq ), @@ -289,7 +289,7 @@ public: ResultSetBase* createResultSet() { - return new ResultSetForQuery( m_xSMgr, + return new ResultSetForQuery( m_xContext, m_xProvider, m_nOpenMode, m_seq, @@ -420,7 +420,7 @@ uno::Any SAL_CALL Content::execute( aOpenCommand, Environment, new ResultSetForQueryFactory( - m_xSMgr, + comphelper::getComponentContext(m_xSMgr), m_xProvider.get(), aOpenCommand.Mode, aOpenCommand.Properties, diff --git a/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx b/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx index 93f3e4dfced5..97f32329b3f0 100644 --- a/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx +++ b/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx @@ -29,7 +29,7 @@ #include <comphelper/processfactory.hxx> #include <com/sun/star/ucb/Command.hpp> #include <com/sun/star/ucb/XCommandEnvironment.hpp> -#include <com/sun/star/i18n/XExtendedTransliteration.hpp> +#include <com/sun/star/i18n/Transliteration.hpp> #include <com/sun/star/ucb/XCommandProcessor.hpp> #include <com/sun/star/lang/Locale.hpp> #include <com/sun/star/script/XInvocation.hpp> @@ -88,25 +88,22 @@ struct HitItem } }; -ResultSetForQuery::ResultSetForQuery( const uno::Reference< lang::XMultiServiceFactory >& xMSF, +ResultSetForQuery::ResultSetForQuery( const uno::Reference< uno::XComponentContext >& rxContext, const uno::Reference< XContentProvider >& xProvider, sal_Int32 nOpenMode, const uno::Sequence< beans::Property >& seq, const uno::Sequence< NumberedSortingInfo >& seqSort, URLParameter& aURLParameter, Databases* pDatabases ) - : ResultSetBase( comphelper::getComponentContext(xMSF),xProvider,nOpenMode,seq,seqSort ), + : ResultSetBase( rxContext,xProvider,nOpenMode,seq,seqSort ), m_aURLParameter( aURLParameter ) { - Reference< XTransliteration > xTrans( - xMSF->createInstance( rtl::OUString( "com.sun.star.i18n.Transliteration" ) ), - UNO_QUERY ); + Reference< XExtendedTransliteration > xTrans = Transliteration::create( rxContext ); Locale aLocale( aURLParameter.get_language(), rtl::OUString(), rtl::OUString() ); - if(xTrans.is()) - xTrans->loadModule(TransliterationModules_UPPERCASE_LOWERCASE, - aLocale ); + xTrans->loadModule(TransliterationModules_UPPERCASE_LOWERCASE, + aLocale ); vector< vector< rtl::OUString > > queryList; { @@ -121,11 +118,9 @@ ResultSetForQuery::ResultSetForQuery( const uno::Reference< lang::XMultiServiceF vector< rtl::OUString > currentQuery; rtl::OUString tmp(query.copy( 0,idx )); rtl:: OUString toliterate = tmp; - if(xTrans.is()) { - Sequence<sal_Int32> aSeq; - toliterate = xTrans->transliterate( - tmp,0,tmp.getLength(),aSeq); - } + Sequence<sal_Int32> aSeq; + toliterate = xTrans->transliterate( + tmp,0,tmp.getLength(),aSeq); currentQuery.push_back( toliterate ); queryList.push_back( currentQuery ); diff --git a/xmlhelp/source/cxxhelp/provider/resultsetforquery.hxx b/xmlhelp/source/cxxhelp/provider/resultsetforquery.hxx index 8f7d7f32d1e1..fca1bfbbd390 100644 --- a/xmlhelp/source/cxxhelp/provider/resultsetforquery.hxx +++ b/xmlhelp/source/cxxhelp/provider/resultsetforquery.hxx @@ -19,7 +19,7 @@ #ifndef _RESULTSETFORQUERY_HXX #define _RESULTSETFORQUERY_HXX -#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/ucb/XContentProvider.hpp> #include <com/sun/star/beans/Property.hpp> #include <com/sun/star/ucb/NumberedSortingInfo.hpp> @@ -36,7 +36,7 @@ namespace chelp { { public: - ResultSetForQuery( const com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory>& xMSF, + ResultSetForQuery( const com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>& rxContext, const com::sun::star::uno::Reference<com::sun::star::ucb::XContentProvider>& xProvider, sal_Int32 nOpenMode, const com::sun::star::uno::Sequence< com::sun::star::beans::Property >& seq, |