summaryrefslogtreecommitdiff
path: root/odk
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-10-17 10:52:52 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-10-24 16:49:49 +0200
commit33a0f8ce656c8c5bb9c3c3deaa10c182e262b374 (patch)
treeabd469ffb224c8d7b2de1cf76e3aada03e035fc1 /odk
parentf252b332dd2652abb02851ba0c2521c045787801 (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')
-rw-r--r--odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.cxx7
-rw-r--r--odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx7
2 files changed, 7 insertions, 7 deletions
diff --git a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.cxx b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.cxx
index daf02152559d..fb35eeda7321 100644
--- a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.cxx
+++ b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.cxx
@@ -36,11 +36,12 @@
#include <addon.hxx>
#include <osl/diagnose.h>
#include <rtl/ustring.hxx>
+#include <comphelper/componentcontext.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/frame/XController.hpp>
-#include <com/sun/star/awt/XToolkit.hpp>
+#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/XWindowPeer.hpp>
#include <com/sun/star/awt/WindowAttribute.hpp>
#include <com/sun/star/awt/XMessageBox.hpp>
@@ -104,9 +105,7 @@ void SAL_CALL Addon::initialize( const Sequence< Any >& aArguments ) throw ( Exc
}
// Create the toolkit to have access to it later
- mxToolkit = Reference< XToolkit >( mxMSF->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.awt.Toolkit" ))), UNO_QUERY );
+ mxToolkit = Reference< XToolkit >( Toolkit::create(comphelper::getComponentContext(mxMSF)), UNO_QUERY_THROW );
}
/**
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;