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 /odk/examples/cpp | |
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 'odk/examples/cpp')
-rw-r--r-- | odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx b/odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx index 98a897acc22d..71537c5454c6 100644 --- a/odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx +++ b/odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx @@ -43,6 +43,7 @@ #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/frame/XControlNotificationListener.hpp> #include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/awt/Toolkitr.hpp> #include <com/sun/star/awt/XWindowPeer.hpp> #include <com/sun/star/awt/WindowAttribute.hpp> #include <com/sun/star/awt/XMessageBox.hpp> @@ -53,6 +54,7 @@ #include <com/sun/star/frame/XStorable.hpp> #include <com/sun/star/container/XContainerQuery.hpp> +#include <compphelper/componentcontext.hxx> #include <osl/file.hxx> using namespace com::sun::star::uno; @@ -77,9 +79,8 @@ ListenerHelper aListenerHelper; void BaseDispatch::ShowMessageBox( const Reference< XFrame >& rFrame, const ::rtl::OUString& aTitle, const ::rtl::OUString& aMsgText ) { if ( !mxToolkit.is() ) - mxToolkit = Reference< XToolkit > ( mxMSF->createInstance( - ::rtl::OUString( "com.sun.star.awt.Toolkit" )), UNO_QUERY ); - if ( rFrame.is() && mxToolkit.is() ) + mxToolkit = Reference< XToolkit > ( Toolkit::create(comphelper::getComponentContext(mxMSF)), UNO_QUERY_THROW ); + if ( rFrame.is() ) { // describe window properties. WindowDescriptor aDescriptor; |