diff options
author | Noel Grandin <noel@peralex.com> | 2012-10-17 10:52:52 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-10-24 16:49:49 +0200 |
commit | 33a0f8ce656c8c5bb9c3c3deaa10c182e262b374 (patch) | |
tree | abd469ffb224c8d7b2de1cf76e3aada03e035fc1 /toolkit | |
parent | f252b332dd2652abb02851ba0c2521c045787801 (diff) |
fdo#46808, Adapt awt::Toolkit UNO service to new style
Create a merged XToolkit2 interface for this service to implement.
Which is backwards-compatible, but does not require creating a new service.
Also mark sub-interfaces as non-optional.
Change-Id: I278d0288e92be277033013302267cf93f7d70480
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/inc/toolkit/awt/vclxtoolkit.hxx | 15 | ||||
-rw-r--r-- | toolkit/source/awt/vclxtoolkit.cxx | 9 | ||||
-rw-r--r-- | toolkit/source/helper/vclunohelper.cxx | 12 |
3 files changed, 9 insertions, 27 deletions
diff --git a/toolkit/inc/toolkit/awt/vclxtoolkit.hxx b/toolkit/inc/toolkit/awt/vclxtoolkit.hxx index d8bd1c91878c..32a401682ecd 100644 --- a/toolkit/inc/toolkit/awt/vclxtoolkit.hxx +++ b/toolkit/inc/toolkit/awt/vclxtoolkit.hxx @@ -21,14 +21,10 @@ #define _TOOLKIT_AWT_VCLXTOOLKIT_HXX_ #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/awt/XSystemChildFactory.hpp> #include <com/sun/star/awt/XToolkitExperimental.hpp> -#include <com/sun/star/awt/XDataTransferProviderAccess.hpp> #include <com/sun/star/lang/XTypeProvider.hpp> -#include <com/sun/star/awt/XExtendedToolkit.hpp> -#include <com/sun/star/awt/XReschedule.hpp> #include <com/sun/star/awt/XMessageBoxFactory.hpp> -#include <cppuhelper/compbase7.hxx> +#include <cppuhelper/compbase2.hxx> #include "cppuhelper/interfacecontainer.hxx" #include <osl/mutex.hxx> #include <osl/module.h> @@ -69,14 +65,9 @@ protected: }; class VCLXToolkit : public VCLXToolkit_Impl, - public cppu::WeakComponentImplHelper7< + public cppu::WeakComponentImplHelper2< ::com::sun::star::awt::XToolkitExperimental, - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::awt::XSystemChildFactory, - ::com::sun::star::awt::XMessageBoxFactory, - ::com::sun::star::awt::XDataTransferProviderAccess, - ::com::sun::star::awt::XExtendedToolkit, - ::com::sun::star::awt::XReschedule > + ::com::sun::star::lang::XServiceInfo > { ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > mxClipboard; ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > mxSelection; diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index 173d23cfbadf..f320d19b9dac 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -463,14 +463,9 @@ static void SAL_CALL ToolkitWorkerFunction( void* pArgs ) // contructor, which might initialize VCL VCLXToolkit::VCLXToolkit( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr ): - cppu::WeakComponentImplHelper7< + cppu::WeakComponentImplHelper2< ::com::sun::star::awt::XToolkitExperimental, - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::awt::XSystemChildFactory, - ::com::sun::star::awt::XMessageBoxFactory, - ::com::sun::star::awt::XDataTransferProviderAccess, - ::com::sun::star::awt::XExtendedToolkit, - ::com::sun::star::awt::XReschedule>( GetMutex() ), + ::com::sun::star::lang::XServiceInfo>( GetMutex() ), m_aTopWindowListeners(rBHelper.rMutex), m_aKeyHandlers(rBHelper.rMutex), m_aFocusListeners(rBHelper.rMutex), diff --git a/toolkit/source/helper/vclunohelper.cxx b/toolkit/source/helper/vclunohelper.cxx index 0cdffe41e305..496839ad1723 100644 --- a/toolkit/source/helper/vclunohelper.cxx +++ b/toolkit/source/helper/vclunohelper.cxx @@ -53,6 +53,7 @@ #include <vcl/graph.hxx> #include <comphelper/processfactory.hxx> +#include <com/sun/star/awt/Toolkit.hpp> #include <com/sun/star/awt/Size.hpp> #include <com/sun/star/awt/Point.hpp> @@ -62,15 +63,10 @@ using namespace ::com::sun::star; // class VCLUnoHelper // ---------------------------------------------------- -::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit> VCLUnoHelper::CreateToolkit() +uno::Reference< ::com::sun::star::awt::XToolkit> VCLUnoHelper::CreateToolkit() { - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory(); - ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface > xI = xMSF->createInstance( ::rtl::OUString::createFromAscii( szServiceName2_Toolkit ) ); - - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit> xToolkit; - if ( xI.is() ) - xToolkit = ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit>( xI, ::com::sun::star::uno::UNO_QUERY ); - + uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); + uno::Reference< awt::XToolkit> xToolkit( awt::Toolkit::create(xContext), uno::UNO_QUERY_THROW ); return xToolkit; } |