summaryrefslogtreecommitdiff
path: root/odk/examples
diff options
context:
space:
mode:
Diffstat (limited to 'odk/examples')
-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;