diff options
author | Noel Grandin <noel@peralex.com> | 2012-05-26 13:53:19 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-06-04 16:57:55 +0200 |
commit | b3c76dee6d44d07eae404b8d7341e6c88e6c4429 (patch) | |
tree | c747dd5bddf94c3b4312c7b1861a5087e76e71d6 /framework | |
parent | eb68bf18f2d859486c4a737abb2536a6afe45411 (diff) |
fdo#46808, Adapt UNO services to new style, Part 7, updating ::create
Update calls to factories to use new ::create methods
Change-Id: I01d4417820f52718836c92faf3c2fae0dc96b30d
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>, added some tweaks.
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/services/frame.cxx | 10 | ||||
-rw-r--r-- | framework/source/uielement/langselectionstatusbarcontroller.cxx | 7 |
2 files changed, 9 insertions, 8 deletions
diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx index d100e097ffec..6000e55f4a53 100644 --- a/framework/source/services/frame.cxx +++ b/framework/source/services/frame.cxx @@ -49,6 +49,7 @@ #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/DisposedException.hpp> +#include <com/sun/star/task/JobExecutor.hpp> #include <com/sun/star/task/XJobExecutor.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/util/XCloseable.hpp> @@ -72,6 +73,7 @@ #include <com/sun/star/frame/XTitleChangeBroadcaster.hpp> +#include <comphelper/componentcontext.hxx> #include <comphelper/sequenceashashmap.hxx> #include <cppuhelper/queryinterface.hxx> #include <cppuhelper/typeprovider.hxx> @@ -2396,11 +2398,9 @@ void SAL_CALL Frame::windowShown( const css::lang::EventObject& ) throw(css::uno if (bMustBeTriggered) { - css::uno::Reference< css::task::XJobExecutor > xExecutor( xFactory->createInstance( SERVICENAME_JOBEXECUTOR ), css::uno::UNO_QUERY ); - if (xExecutor.is()) - { - xExecutor->trigger( DECLARE_ASCII("onFirstVisibleTask") ); - } + css::uno::Reference< css::task::XJobExecutor > xExecutor + = css::task::JobExecutor::create( comphelper::ComponentContext(xFactory).getUNOContext() ); + xExecutor->trigger( DECLARE_ASCII("onFirstVisibleTask") ); } } } diff --git a/framework/source/uielement/langselectionstatusbarcontroller.cxx b/framework/source/uielement/langselectionstatusbarcontroller.cxx index 5e67bebe19d4..ed39425ea7d0 100644 --- a/framework/source/uielement/langselectionstatusbarcontroller.cxx +++ b/framework/source/uielement/langselectionstatusbarcontroller.cxx @@ -40,6 +40,7 @@ #include <com/sun/star/frame/XPopupMenuController.hpp> #include <toolkit/helper/vclunohelper.hxx> +#include <com/sun/star/awt/PopupMenu.hpp> #include <com/sun/star/awt/PopupMenuDirection.hpp> #include <svtools/langtab.hxx> #include "sal/types.h" @@ -58,6 +59,7 @@ #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <comphelper/processfactory.hxx> +#include <comphelper/componentcontext.hxx> #include <toolkit/unohlp.hxx> #include <tools/gen.hxx> @@ -186,10 +188,9 @@ throw (::com::sun::star::uno::RuntimeException) return; //add context menu - const static OUString s_sPopupMenu(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.PopupMenu")); - Reference< awt::XPopupMenu > xPopupMenu( m_xServiceManager->createInstance( s_sPopupMenu ), UNO_QUERY ); + Reference< awt::XPopupMenu > xPopupMenu( awt::PopupMenu::create( comphelper::ComponentContext(m_xServiceManager).getUNOContext() ) ); //sub menu that contains all items except the last two items: Separator + Set Language for Paragraph - Reference< awt::XPopupMenu > subPopupMenu(m_xServiceManager->createInstance( s_sPopupMenu ), UNO_QUERY ); + Reference< awt::XPopupMenu > subPopupMenu( awt::PopupMenu::create( comphelper::ComponentContext(m_xServiceManager).getUNOContext() ) ); SvtLanguageTable aLanguageTable; |