summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-02-01 13:51:04 +0200
committerNoel Grandin <noel@peralex.com>2013-02-11 08:02:19 +0200
commiteb2f8c5a63df0bfcd3cc13b2071ea2194fa425f0 (patch)
tree8b699d6dace733bdb6ea67ce704936fbf9e8d7a5 /framework
parent0cd4caa547a75316c6b3f2992dd66b2294c6f1ae (diff)
fdo#46808, use linguistic2::LanguageGuessing service constructor
Change-Id: I5c650a96ea99a1cf16ca8aa61f2db4986790040b
Diffstat (limited to 'framework')
-rw-r--r--framework/inc/helper/mischelper.hxx4
-rw-r--r--framework/source/fwi/helper/mischelper.cxx6
-rw-r--r--framework/source/uielement/langselectionmenucontroller.cxx2
-rw-r--r--framework/source/uielement/langselectionstatusbarcontroller.cxx2
4 files changed, 6 insertions, 8 deletions
diff --git a/framework/inc/helper/mischelper.hxx b/framework/inc/helper/mischelper.hxx
index b559de74707e..f74f69ae907b 100644
--- a/framework/inc/helper/mischelper.hxx
+++ b/framework/inc/helper/mischelper.hxx
@@ -92,10 +92,10 @@ inline bool IsScriptTypeMatchingToLanguage( sal_Int16 nScriptType, LanguageType
class FWI_DLLPUBLIC LanguageGuessingHelper
{
mutable ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XLanguageGuessing > m_xLanguageGuesser;
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
public:
- LanguageGuessingHelper(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xServiceManager) : m_xServiceManager(_xServiceManager){}
+ LanguageGuessingHelper(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _xContext) : m_xContext(_xContext){}
::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XLanguageGuessing > GetGuesser() const;
};
diff --git a/framework/source/fwi/helper/mischelper.cxx b/framework/source/fwi/helper/mischelper.cxx
index cc22e5b1e668..5245808255c8 100644
--- a/framework/source/fwi/helper/mischelper.cxx
+++ b/framework/source/fwi/helper/mischelper.cxx
@@ -23,6 +23,7 @@
#include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/frame/UICommandDescription.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/linguistic2/LanguageGuessing.hpp>
#include <tools/debug.hxx>
#include <vcl/settings.hxx>
@@ -53,10 +54,7 @@ uno::Reference< linguistic2::XLanguageGuessing > LanguageGuessingHelper::GetGues
{
try
{
- m_xLanguageGuesser = uno::Reference< linguistic2::XLanguageGuessing >(
- m_xServiceManager->createInstance(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.linguistic2.LanguageGuessing")) ),
- uno::UNO_QUERY );
+ m_xLanguageGuesser = linguistic2::LanguageGuessing::create( m_xContext );
}
catch (const uno::Exception &)
{
diff --git a/framework/source/uielement/langselectionmenucontroller.cxx b/framework/source/uielement/langselectionmenucontroller.cxx
index c3e96b0e5e46..c6ad1bf77b40 100644
--- a/framework/source/uielement/langselectionmenucontroller.cxx
+++ b/framework/source/uielement/langselectionmenucontroller.cxx
@@ -80,7 +80,7 @@ DEFINE_INIT_SERVICE ( LanguageSelectionMenuController, {}
LanguageSelectionMenuController::LanguageSelectionMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ) :
svt::PopupMenuControllerBase( xServiceManager ),
m_bShowMenu( sal_True ),
- m_aLangGuessHelper( xServiceManager )
+ m_aLangGuessHelper( comphelper::getComponentContext(xServiceManager) )
{
}
diff --git a/framework/source/uielement/langselectionstatusbarcontroller.cxx b/framework/source/uielement/langselectionstatusbarcontroller.cxx
index ebb83c0b87e9..83e60fd8e2b1 100644
--- a/framework/source/uielement/langselectionstatusbarcontroller.cxx
+++ b/framework/source/uielement/langselectionstatusbarcontroller.cxx
@@ -90,7 +90,7 @@ LangSelectionStatusbarController::LangSelectionStatusbarController( const uno::R
svt::StatusbarController( xServiceManager, uno::Reference< frame::XFrame >(), OUString(), 0 ),
m_bShowMenu( sal_True ),
m_nScriptType( LS_SCRIPT_LATIN | LS_SCRIPT_ASIAN | LS_SCRIPT_COMPLEX ),
- m_aLangGuessHelper( xServiceManager )
+ m_aLangGuessHelper( comphelper::getComponentContext(xServiceManager) )
{
}