summaryrefslogtreecommitdiff
path: root/xmlhelp
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 /xmlhelp
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 'xmlhelp')
-rw-r--r--xmlhelp/source/cxxhelp/provider/content.cxx10
-rw-r--r--xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx23
-rw-r--r--xmlhelp/source/cxxhelp/provider/resultsetforquery.hxx4
3 files changed, 16 insertions, 21 deletions
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,