summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--UnoControls/inc/basecontainercontrol.hxx2
-rw-r--r--UnoControls/inc/basecontrol.hxx6
-rw-r--r--UnoControls/source/base/basecontainercontrol.cxx4
-rw-r--r--UnoControls/source/base/basecontrol.cxx15
-rw-r--r--UnoControls/source/base/registercontrols.cxx3
-rw-r--r--UnoControls/source/controls/framecontrol.cxx12
-rw-r--r--UnoControls/source/controls/progressbar.cxx4
-rw-r--r--UnoControls/source/controls/progressmonitor.cxx28
-rw-r--r--UnoControls/source/controls/statusindicator.cxx10
-rw-r--r--UnoControls/source/inc/framecontrol.hxx2
-rw-r--r--UnoControls/source/inc/progressbar.hxx2
-rw-r--r--UnoControls/source/inc/progressmonitor.hxx2
-rw-r--r--UnoControls/source/inc/statusindicator.hxx2
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatedialog.cxx14
-rw-r--r--desktop/test/deployment/active/active_native.cxx10
-rw-r--r--desktop/test/deployment/passive/passive_native.cxx10
-rw-r--r--embeddedobj/source/general/docholder.cxx8
-rw-r--r--embedserv/source/embed/docholder.cxx60
-rw-r--r--extensions/source/nsplugin/source/so_instance.cxx15
-rw-r--r--framework/inc/services.h1
-rw-r--r--framework/inc/tabwin/tabwinfactory.hxx4
-rw-r--r--framework/source/dispatch/menudispatcher.cxx1
-rw-r--r--framework/source/dispatch/popupmenudispatcher.cxx1
-rw-r--r--framework/source/layoutmanager/helpers.cxx38
-rw-r--r--framework/source/layoutmanager/helpers.hxx6
-rw-r--r--framework/source/layoutmanager/toolbarlayoutmanager.cxx11
-rw-r--r--framework/source/layoutmanager/toolbarlayoutmanager.hxx3
-rw-r--r--framework/source/services/backingcomp.cxx27
-rw-r--r--framework/source/services/desktop.cxx1
-rw-r--r--framework/source/services/frame.cxx27
-rw-r--r--framework/source/services/taskcreatorsrv.cxx3
-rw-r--r--framework/source/tabwin/tabwindow.cxx6
-rw-r--r--framework/source/tabwin/tabwinfactory.cxx51
-rw-r--r--framework/source/uifactory/windowcontentfactorymanager.cxx1
-rw-r--r--odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.cxx7
-rw-r--r--odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx7
-rw-r--r--offapi/UnoApi_offapi.mk3
-rw-r--r--offapi/com/sun/star/awt/Toolkit.idl19
-rw-r--r--offapi/com/sun/star/awt/XToolkit2.idl59
-rw-r--r--offapi/com/sun/star/awt/XToolkitExperimental.idl4
-rw-r--r--offapi/type_reference/types.rdbbin7655424 -> 7655424 bytes
-rw-r--r--scripting/source/dlgprov/dlgprov.cxx7
-rw-r--r--sd/workben/custompanel/ctp_panel.cxx7
-rw-r--r--sdext/source/minimizer/unodialog.cxx3
-rw-r--r--sdext/source/presenter/PresenterSlideShowView.cxx7
-rw-r--r--sfx2/workben/custompanel/ctp_panel.cxx7
-rw-r--r--slideshow/source/engine/shapes/viewappletshape.cxx8
-rw-r--r--sw/source/ui/utlui/unotools.cxx76
-rw-r--r--toolkit/inc/toolkit/awt/vclxtoolkit.hxx15
-rw-r--r--toolkit/source/awt/vclxtoolkit.cxx9
-rw-r--r--toolkit/source/helper/vclunohelper.cxx12
-rw-r--r--vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx3
-rw-r--r--vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx3
-rw-r--r--xmlhelp/source/cxxhelp/provider/databases.cxx26
54 files changed, 322 insertions, 350 deletions
diff --git a/UnoControls/inc/basecontainercontrol.hxx b/UnoControls/inc/basecontainercontrol.hxx
index 857a8d7c50a2..a6a0906bdb08 100644
--- a/UnoControls/inc/basecontainercontrol.hxx
+++ b/UnoControls/inc/basecontainercontrol.hxx
@@ -78,7 +78,7 @@ public:
@onerror -
*/
- BaseContainerControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
+ BaseContainerControl( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
/**_______________________________________________________________________________________________________
@short -
diff --git a/UnoControls/inc/basecontrol.hxx b/UnoControls/inc/basecontrol.hxx
index f54033ef84d8..0aa633d41f95 100644
--- a/UnoControls/inc/basecontrol.hxx
+++ b/UnoControls/inc/basecontrol.hxx
@@ -144,7 +144,7 @@ public:
@onerror -
*/
- BaseControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
+ BaseControl( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
/**_______________________________________________________________________________________________________
@short -
@@ -1049,7 +1049,7 @@ protected:
@onerror -
*/
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > impl_getMultiServiceFactory();
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > impl_getComponentContext();
/**_______________________________________________________________________________________________________
@short -
@@ -1217,7 +1217,7 @@ private:
private:
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory ;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xComponentContext ;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xDelegator ;
OMRCListenerMultiplexerHelper* m_pMultiplexer ; // multiplex events
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xMultiplexer ;
diff --git a/UnoControls/source/base/basecontainercontrol.cxx b/UnoControls/source/base/basecontainercontrol.cxx
index 83bedbf3cfc5..2ef9a9e6e1de 100644
--- a/UnoControls/source/base/basecontainercontrol.cxx
+++ b/UnoControls/source/base/basecontainercontrol.cxx
@@ -39,8 +39,8 @@ namespace unocontrols{
// construct/destruct
//____________________________________________________________________________________________________________
-BaseContainerControl::BaseContainerControl( const Reference< XMultiServiceFactory >& xFactory )
- : BaseControl ( xFactory )
+BaseContainerControl::BaseContainerControl( const Reference< XComponentContext >& rxContext )
+ : BaseControl ( rxContext )
, m_aListeners ( m_aMutex )
{
}
diff --git a/UnoControls/source/base/basecontrol.cxx b/UnoControls/source/base/basecontrol.cxx
index 068317b9075b..02e3a04dbe0f 100644
--- a/UnoControls/source/base/basecontrol.cxx
+++ b/UnoControls/source/base/basecontrol.cxx
@@ -24,6 +24,8 @@
#include <com/sun/star/awt/DeviceInfo.hpp>
#include <com/sun/star/awt/WindowAttribute.hpp>
#include <com/sun/star/awt/PosSize.hpp>
+#include <com/sun/star/awt/Toolkit.hpp>
+#include <comphelper/processfactory.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
@@ -48,16 +50,15 @@ namespace unocontrols{
#define DEFAULT_VISIBLE sal_False
#define DEFAULT_INDESIGNMODE sal_False
#define DEFAULT_ENABLE sal_True
-#define SERVICE_VCLTOOLKIT "com.sun.star.awt.Toolkit"
//____________________________________________________________________________________________________________
// construct/destruct
//____________________________________________________________________________________________________________
-BaseControl::BaseControl( const Reference< XMultiServiceFactory >& xFactory )
+BaseControl::BaseControl( const Reference< XComponentContext >& rxContext )
: IMPL_MutexContainer ( )
, OComponentHelper ( m_aMutex )
- , m_xFactory ( xFactory )
+ , m_xComponentContext ( rxContext )
, m_pMultiplexer ( DEFAULT_PMULTIPLEXER )
, m_nX ( DEFAULT_X )
, m_nY ( DEFAULT_Y )
@@ -335,8 +336,8 @@ void SAL_CALL BaseControl::createPeer( const Reference< XToolkit >& xToo
Reference< XToolkit > xLocalToolkit = xToolkit ;
if ( xLocalToolkit.is() == sal_False )
{
- // but first create wellknown toolkit, if it not exist
- xLocalToolkit = Reference< XToolkit > ( m_xFactory->createInstance( SERVICE_VCLTOOLKIT ), UNO_QUERY );
+ // but first create well known toolkit, if it not exist
+ xLocalToolkit = Reference< XToolkit > ( Toolkit::create(m_xComponentContext), UNO_QUERY_THROW );
}
m_xPeer = xLocalToolkit->createWindow( *pDescriptor );
m_xPeerWindow = Reference< XWindow >( m_xPeer, UNO_QUERY );
@@ -848,9 +849,9 @@ const OUString BaseControl::impl_getStaticImplementationName()
// protected method
//____________________________________________________________________________________________________________
-const Reference< XMultiServiceFactory > BaseControl::impl_getMultiServiceFactory()
+const Reference< XComponentContext > BaseControl::impl_getComponentContext()
{
- return m_xFactory ;
+ return m_xComponentContext ;
}
//____________________________________________________________________________________________________________
diff --git a/UnoControls/source/base/registercontrols.cxx b/UnoControls/source/base/registercontrols.cxx
index 5738fec896b9..dfcdfb0d8f67 100644
--- a/UnoControls/source/base/registercontrols.cxx
+++ b/UnoControls/source/base/registercontrols.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <comphelper/processfactory.hxx>
#include <cppuhelper/factory.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
@@ -55,7 +56,7 @@ using namespace ::com::sun::star::registry ;
\
static Reference< XInterface > SAL_CALL CLASS##_createInstance ( const Reference< XMultiServiceFactory >& rServiceManager ) throw ( Exception ) \
{ \
- return Reference< XInterface >( *(OWeakObject*)(new CLASS( rServiceManager )) ); \
+ return Reference< XInterface >( *(OWeakObject*)(new CLASS( comphelper::getComponentContext(rServiceManager) )) ); \
}
//******************************************************************************************************************************
diff --git a/UnoControls/source/controls/framecontrol.cxx b/UnoControls/source/controls/framecontrol.cxx
index 53f2ce080daf..27afd5d4e83b 100644
--- a/UnoControls/source/controls/framecontrol.cxx
+++ b/UnoControls/source/controls/framecontrol.cxx
@@ -49,8 +49,8 @@ namespace unocontrols{
// construct/destruct
//______________________________________________________________________________________________________________
-FrameControl::FrameControl( const Reference< XMultiServiceFactory >& xFactory )
- : BaseControl ( xFactory )
+FrameControl::FrameControl( const Reference< XComponentContext >& rxContext)
+ : BaseControl ( rxContext )
, OBroadcastHelper ( m_aMutex )
, OPropertySetHelper ( *(static_cast< OBroadcastHelper * >(this)) )
, m_aInterfaceContainer ( m_aMutex )
@@ -467,7 +467,9 @@ void FrameControl::impl_createFrame( const Reference< XWindowPeer >& xPee
xOldFrame = m_xFrame ;
}
- xNewFrame = Reference< XFrame > ( impl_getMultiServiceFactory()->createInstance ( "com.sun.star.frame.Frame" ), UNO_QUERY ) ;
+
+
+ xNewFrame = Reference< XFrame > ( impl_getComponentContext()->getServiceManager()->createInstanceWithContext("com.sun.star.frame.Frame", impl_getComponentContext()), UNO_QUERY ) ;
Reference< XDispatchProvider > xDSP ( xNewFrame, UNO_QUERY ) ;
if (xDSP.is())
@@ -478,9 +480,7 @@ void FrameControl::impl_createFrame( const Reference< XWindowPeer >& xPee
// option
//xFrame->setName( "WhatYouWant" );
- Reference< XURLTransformer > xTrans (
- URLTransformer::create(
- ::comphelper::getComponentContext( impl_getMultiServiceFactory() ) ) );
+ Reference< XURLTransformer > xTrans = URLTransformer::create( impl_getComponentContext() );
// load file
URL aURL ;
diff --git a/UnoControls/source/controls/progressbar.cxx b/UnoControls/source/controls/progressbar.cxx
index aff0ff069907..ce7c5eb2c1e8 100644
--- a/UnoControls/source/controls/progressbar.cxx
+++ b/UnoControls/source/controls/progressbar.cxx
@@ -42,8 +42,8 @@ namespace unocontrols{
// construct/destruct
//____________________________________________________________________________________________________________
-ProgressBar::ProgressBar( const Reference< XMultiServiceFactory >& xFactory )
- : BaseControl ( xFactory )
+ProgressBar::ProgressBar( const Reference< XComponentContext >& rxContext )
+ : BaseControl ( rxContext )
, m_bHorizontal ( PROGRESSBAR_DEFAULT_HORIZONTAL )
, m_aBlockSize ( PROGRESSBAR_DEFAULT_BLOCKDIMENSION )
, m_nForegroundColor ( PROGRESSBAR_DEFAULT_FOREGROUNDCOLOR )
diff --git a/UnoControls/source/controls/progressmonitor.cxx b/UnoControls/source/controls/progressmonitor.cxx
index cea1990b81f8..ef4d53f01797 100644
--- a/UnoControls/source/controls/progressmonitor.cxx
+++ b/UnoControls/source/controls/progressmonitor.cxx
@@ -47,20 +47,21 @@ namespace unocontrols{
// construct/destruct
//____________________________________________________________________________________________________________
-ProgressMonitor::ProgressMonitor( const Reference< XMultiServiceFactory >& xFactory )
- : BaseContainerControl ( xFactory )
+ProgressMonitor::ProgressMonitor( const Reference< XComponentContext >& rxContext )
+ : BaseContainerControl ( rxContext )
{
// Its not allowed to work with member in this method (refcounter !!!)
// But with a HACK (++refcount) its "OK" :-(
++m_refCount ;
// Create instances for fixedtext, button and progress ...
- m_xTopic_Top = Reference< XFixedText > ( xFactory->createInstance ( FIXEDTEXT_SERVICENAME ), UNO_QUERY ) ;
- m_xText_Top = Reference< XFixedText > ( xFactory->createInstance ( FIXEDTEXT_SERVICENAME ), UNO_QUERY ) ;
- m_xTopic_Bottom = Reference< XFixedText > ( xFactory->createInstance ( FIXEDTEXT_SERVICENAME ), UNO_QUERY ) ;
- m_xText_Bottom = Reference< XFixedText > ( xFactory->createInstance ( FIXEDTEXT_SERVICENAME ), UNO_QUERY ) ;
- m_xButton = Reference< XButton > ( xFactory->createInstance ( BUTTON_SERVICENAME ), UNO_QUERY ) ;
- m_xProgressBar = Reference< XProgressBar > ( xFactory->createInstance ( SERVICENAME_PROGRESSBAR ), UNO_QUERY ) ;
+
+ m_xTopic_Top = Reference< XFixedText > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_SERVICENAME, rxContext ), UNO_QUERY ) ;
+ m_xText_Top = Reference< XFixedText > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_SERVICENAME, rxContext ), UNO_QUERY ) ;
+ m_xTopic_Bottom = Reference< XFixedText > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_SERVICENAME, rxContext ), UNO_QUERY ) ;
+ m_xText_Bottom = Reference< XFixedText > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_SERVICENAME, rxContext ), UNO_QUERY ) ;
+ m_xButton = Reference< XButton > ( rxContext->getServiceManager()->createInstanceWithContext( BUTTON_SERVICENAME, rxContext ), UNO_QUERY ) ;
+ m_xProgressBar = Reference< XProgressBar > ( rxContext->getServiceManager()->createInstanceWithContext( SERVICENAME_PROGRESSBAR, rxContext ), UNO_QUERY ) ;
// ... cast controls to Reference< XControl > (for "setModel"!) ...
Reference< XControl > xRef_Topic_Top ( m_xTopic_Top , UNO_QUERY ) ;
@@ -70,12 +71,13 @@ ProgressMonitor::ProgressMonitor( const Reference< XMultiServiceFactory >& xFact
Reference< XControl > xRef_Button ( m_xButton , UNO_QUERY ) ;
Reference< XControl > xRef_ProgressBar ( m_xProgressBar , UNO_QUERY ) ;
+
// ... set models ...
- xRef_Topic_Top->setModel ( Reference< XControlModel > ( xFactory->createInstance ( FIXEDTEXT_MODELNAME ), UNO_QUERY ) ) ;
- xRef_Text_Top->setModel ( Reference< XControlModel > ( xFactory->createInstance ( FIXEDTEXT_MODELNAME ), UNO_QUERY ) ) ;
- xRef_Topic_Bottom->setModel ( Reference< XControlModel > ( xFactory->createInstance ( FIXEDTEXT_MODELNAME ), UNO_QUERY ) ) ;
- xRef_Text_Bottom->setModel ( Reference< XControlModel > ( xFactory->createInstance ( FIXEDTEXT_MODELNAME ), UNO_QUERY ) ) ;
- xRef_Button->setModel ( Reference< XControlModel > ( xFactory->createInstance ( BUTTON_MODELNAME ), UNO_QUERY ) ) ;
+ xRef_Topic_Top->setModel ( Reference< XControlModel > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_MODELNAME, rxContext ), UNO_QUERY ) ) ;
+ xRef_Text_Top->setModel ( Reference< XControlModel > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_MODELNAME, rxContext ), UNO_QUERY ) ) ;
+ xRef_Topic_Bottom->setModel ( Reference< XControlModel > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_MODELNAME, rxContext ), UNO_QUERY ) ) ;
+ xRef_Text_Bottom->setModel ( Reference< XControlModel > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_MODELNAME, rxContext ), UNO_QUERY ) ) ;
+ xRef_Button->setModel ( Reference< XControlModel > ( rxContext->getServiceManager()->createInstanceWithContext( BUTTON_MODELNAME, rxContext ), UNO_QUERY ) ) ;
// ProgressBar has no model !!!
// ... and add controls to basecontainercontrol!
diff --git a/UnoControls/source/controls/statusindicator.cxx b/UnoControls/source/controls/statusindicator.cxx
index 87d44a2a2395..a3e9515eb551 100644
--- a/UnoControls/source/controls/statusindicator.cxx
+++ b/UnoControls/source/controls/statusindicator.cxx
@@ -39,21 +39,21 @@ namespace unocontrols{
// construct/destruct
//____________________________________________________________________________________________________________
-StatusIndicator::StatusIndicator( const Reference< XMultiServiceFactory >& xFactory )
- : BaseContainerControl ( xFactory )
+StatusIndicator::StatusIndicator( const Reference< XComponentContext >& rxContext )
+ : BaseContainerControl ( rxContext )
{
// Its not allowed to work with member in this method (refcounter !!!)
// But with a HACK (++refcount) its "OK" :-(
++m_refCount ;
// Create instances for fixedtext and progress ...
- m_xText = Reference< XFixedText > ( xFactory->createInstance( FIXEDTEXT_SERVICENAME ), UNO_QUERY );
- m_xProgressBar = Reference< XProgressBar > ( xFactory->createInstance( SERVICENAME_PROGRESSBAR ), UNO_QUERY );
+ m_xText = Reference< XFixedText > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_SERVICENAME, rxContext ), UNO_QUERY );
+ m_xProgressBar = Reference< XProgressBar > ( rxContext->getServiceManager()->createInstanceWithContext( SERVICENAME_PROGRESSBAR, rxContext ), UNO_QUERY );
// ... cast controls to Reference< XControl > and set model ...
// ( ProgressBar has no model !!! )
Reference< XControl > xTextControl ( m_xText , UNO_QUERY );
Reference< XControl > xProgressControl ( m_xProgressBar, UNO_QUERY );
- xTextControl->setModel( Reference< XControlModel >( xFactory->createInstance( FIXEDTEXT_MODELNAME ), UNO_QUERY ) );
+ xTextControl->setModel( Reference< XControlModel >( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_MODELNAME, rxContext ), UNO_QUERY ) );
// ... and add controls to basecontainercontrol!
addControl( CONTROLNAME_TEXT, xTextControl );
addControl( CONTROLNAME_PROGRESSBAR, xProgressControl );
diff --git a/UnoControls/source/inc/framecontrol.hxx b/UnoControls/source/inc/framecontrol.hxx
index 7f4340ccd808..ca913f638a77 100644
--- a/UnoControls/source/inc/framecontrol.hxx
+++ b/UnoControls/source/inc/framecontrol.hxx
@@ -84,7 +84,7 @@ public:
@onerror
*/
- FrameControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
+ FrameControl( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
/**_________________________________________________________________________________________________________
@short
diff --git a/UnoControls/source/inc/progressbar.hxx b/UnoControls/source/inc/progressbar.hxx
index 8fb3d8bcdeab..1c8d89255512 100644
--- a/UnoControls/source/inc/progressbar.hxx
+++ b/UnoControls/source/inc/progressbar.hxx
@@ -73,7 +73,7 @@ public:
@onerror
*/
- ProgressBar( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
+ ProgressBar( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
/**_________________________________________________________________________________________________________
@short
diff --git a/UnoControls/source/inc/progressmonitor.hxx b/UnoControls/source/inc/progressmonitor.hxx
index 3915b46509fc..163dc0963626 100644
--- a/UnoControls/source/inc/progressmonitor.hxx
+++ b/UnoControls/source/inc/progressmonitor.hxx
@@ -128,7 +128,7 @@ public:
@onerror
*/
- ProgressMonitor( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
+ ProgressMonitor( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
/**_______________________________________________________________________________________________________
@short
diff --git a/UnoControls/source/inc/statusindicator.hxx b/UnoControls/source/inc/statusindicator.hxx
index 688e18689a82..300cfc6711c3 100644
--- a/UnoControls/source/inc/statusindicator.hxx
+++ b/UnoControls/source/inc/statusindicator.hxx
@@ -84,7 +84,7 @@ class StatusIndicator : public ::com::sun::star::awt::XLayoutConstrains
@onerror
*/
- StatusIndicator( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
+ StatusIndicator( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
/**_______________________________________________________________________________________________________
@short
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
index 27ca935f394f..129663a28dec 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
@@ -42,7 +42,7 @@
#include "com/sun/star/awt/WindowAttribute.hpp"
#include "com/sun/star/awt/WindowClass.hpp"
#include "com/sun/star/awt/WindowDescriptor.hpp"
-#include "com/sun/star/awt/XToolkit.hpp"
+#include "com/sun/star/awt/Toolkit.hpp"
#include "com/sun/star/awt/XWindow.hpp"
#include "com/sun/star/awt/XWindowPeer.hpp"
#include "com/sun/star/beans/NamedValue.hpp"
@@ -554,17 +554,9 @@ UpdateDialog::UpdateDialog(
m_xExtensionManager = deployment::ExtensionManager::get( context );
- uno::Reference< awt::XToolkit > toolkit;
+ uno::Reference< awt::XToolkit2 > toolkit;
try {
- toolkit = uno::Reference< awt::XToolkit >(
- (uno::Reference< lang::XMultiComponentFactory >(
- m_context->getServiceManager(),
- uno::UNO_QUERY_THROW)->
- createInstanceWithContext(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.Toolkit")),
- m_context)),
- uno::UNO_QUERY_THROW);
+ toolkit = awt::Toolkit::create(m_context);
} catch (const uno::RuntimeException &) {
throw;
} catch (const uno::Exception & e) {
diff --git a/desktop/test/deployment/active/active_native.cxx b/desktop/test/deployment/active/active_native.cxx
index 9845fd511168..493728d44c3a 100644
--- a/desktop/test/deployment/active/active_native.cxx
+++ b/desktop/test/deployment/active/active_native.cxx
@@ -31,6 +31,7 @@
#include "boost/noncopyable.hpp"
#include "com/sun/star/awt/MessageBoxButtons.hpp"
#include "com/sun/star/awt/Rectangle.hpp"
+#include "com/sun/star/awt/Toolkit.hpp"
#include "com/sun/star/awt/XMessageBox.hpp"
#include "com/sun/star/awt/XMessageBoxFactory.hpp"
#include "com/sun/star/awt/XWindowPeer.hpp"
@@ -235,13 +236,12 @@ void Dispatch::dispatch(
css::uno::Sequence< css::beans::PropertyValue > const &)
throw (css::uno::RuntimeException)
{
- css::uno::Reference< css::lang::XMultiComponentFactory > smgr(
- context_->getServiceManager(), css::uno::UNO_SET_THROW);
+ css::uno::Reference< css::lang::XMultiComponentFactory > smgr( context_->getServiceManager(), css::uno::UNO_SET_THROW);
+ css::uno::Reference< css::awt::XToolkit > toolkit( css::awt::Toolkit::create(context_), css::uno::UNO_SET_THROW);
+
css::uno::Reference< css::awt::XMessageBox > box(
css::uno::Reference< css::awt::XMessageBoxFactory >(
- smgr->createInstanceWithContext(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.awt.Toolkit")), context_),
+ toolkit,
css::uno::UNO_QUERY_THROW)->createMessageBox(
css::uno::Reference< css::awt::XWindowPeer >(
css::uno::Reference< css::frame::XFrame >(
diff --git a/desktop/test/deployment/passive/passive_native.cxx b/desktop/test/deployment/passive/passive_native.cxx
index 0da885d5a31d..5e409f6cb30d 100644
--- a/desktop/test/deployment/passive/passive_native.cxx
+++ b/desktop/test/deployment/passive/passive_native.cxx
@@ -32,6 +32,7 @@
#include "com/sun/star/awt/MessageBoxButtons.hpp"
#include "com/sun/star/awt/Rectangle.hpp"
#include "com/sun/star/awt/XMessageBox.hpp"
+#include "com/sun/star/awt/Toolkit.hpp"
#include "com/sun/star/awt/XMessageBoxFactory.hpp"
#include "com/sun/star/awt/XWindowPeer.hpp"
#include "com/sun/star/beans/PropertyValue.hpp"
@@ -233,13 +234,12 @@ void Dispatch::dispatch(
css::uno::Sequence< css::beans::PropertyValue > const &)
throw (css::uno::RuntimeException)
{
- css::uno::Reference< css::lang::XMultiComponentFactory > smgr(
- context_->getServiceManager(), css::uno::UNO_SET_THROW);
+ css::uno::Reference< css::lang::XMultiComponentFactory > smgr(context_->getServiceManager(), css::uno::UNO_SET_THROW);
+ css::uno::Reference< css::awt::XToolkit > toolkit( css::awt::Toolkit::create(context_), css::uno::UNO_SET_THROW);
+
css::uno::Reference< css::awt::XMessageBox > box(
css::uno::Reference< css::awt::XMessageBoxFactory >(
- smgr->createInstanceWithContext(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.awt.Toolkit")), context_),
+ toolkit,
css::uno::UNO_QUERY_THROW)->createMessageBox(
css::uno::Reference< css::awt::XWindowPeer >(
css::uno::Reference< css::frame::XFrame >(
diff --git a/embeddedobj/source/general/docholder.cxx b/embeddedobj/source/general/docholder.cxx
index 75643c901bda..c7e63d86ee03 100644
--- a/embeddedobj/source/general/docholder.cxx
+++ b/embeddedobj/source/general/docholder.cxx
@@ -38,6 +38,7 @@
#include <com/sun/star/frame/XControllerBorder.hpp>
#include <com/sun/star/util/XModifyBroadcaster.hpp>
#include <com/sun/star/frame/XDispatchProviderInterception.hpp>
+#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/awt/XView.hpp>
@@ -454,11 +455,8 @@ sal_Bool DocumentHolder::ShowInplace( const uno::Reference< awt::XWindowPeer >&
awt::Rectangle(),//aOwnRectangle,
awt::WindowAttribute::SHOW | awt::VclWindowPeerAttribute::CLIPCHILDREN );
- uno::Reference< awt::XToolkit > xToolkit(
- m_xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.Toolkit" )) ),
- uno::UNO_QUERY );
- if ( !xToolkit.is() )
- throw uno::RuntimeException();
+ uno::Reference< awt::XToolkit2 > xToolkit =
+ awt::Toolkit::create(comphelper::getComponentContext(m_xFactory));
uno::Reference< awt::XWindowPeer > xNewWinPeer = xToolkit->createWindow( aOwnWinDescriptor );
uno::Reference< awt::XWindow > xOwnWindow( xNewWinPeer, uno::UNO_QUERY );
diff --git a/embedserv/source/embed/docholder.cxx b/embedserv/source/embed/docholder.cxx
index a2a91a524202..cf2b71c4c9d9 100644
--- a/embedserv/source/embed/docholder.cxx
+++ b/embedserv/source/embed/docholder.cxx
@@ -31,6 +31,7 @@
#include "common.h"
#include <Windows.h>
#include <com/sun/star/lang/SystemDependent.hpp>
+#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/XSystemChildFactory.hpp>
#include <com/sun/star/awt/XSystemDependentWindowPeer.hpp>
#include <com/sun/star/awt/XSystemDependentMenuPeer.hpp>
@@ -283,36 +284,32 @@ HRESULT DocumentHolder::InPlaceActivate(
HWND hWndxWinParent(0);
uno::Reference<awt::XWindow> xWin;
- static const ::rtl::OUString aToolkitServiceName(
- RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.awt.Toolkit" ) );
- uno::Reference<awt::XSystemChildFactory> xToolkit(
- m_xFactory->createInstance(aToolkitServiceName ),uno::UNO_QUERY);
-
- if(xToolkit.is()) {
- // create system window wrapper for hwnd
- if( !m_pCHatchWin )
- m_pCHatchWin = new winwrap::CHatchWin(
- m_hInstance,this);
-
- if(m_pCHatchWin->Init(hWndSite,/*ID_HATCHWINDOW*/2000, NULL)) {
- m_pCHatchWin->RectsSet(&rcPos,&rcClip); //set visible area
- hWndxWinParent = m_pCHatchWin->Window();
- ShowWindow(hWndxWinParent,SW_SHOW); //Make visible.
- }
- else {
- // no success initializing hatch window
- delete m_pCHatchWin, m_pCHatchWin = 0;
- hWndxWinParent = hWndSite;
- }
+ uno::Reference<awt::XToolkit2> xToolkit =
+ awt::Toolkit::create(comphelper::getComponentContext(m_xFactory));
- aAny <<= sal_Int32(hWndxWinParent);
- xWin = uno::Reference<awt::XWindow>(
- xToolkit->createSystemChild(
- aAny,
- aProcessIdent,
- lang::SystemDependent::SYSTEM_WIN32),
- uno::UNO_QUERY);
+ // create system window wrapper for hwnd
+ if( !m_pCHatchWin )
+ m_pCHatchWin = new winwrap::CHatchWin(
+ m_hInstance,this);
+
+ if(m_pCHatchWin->Init(hWndSite,/*ID_HATCHWINDOW*/2000, NULL)) {
+ m_pCHatchWin->RectsSet(&rcPos,&rcClip); //set visible area
+ hWndxWinParent = m_pCHatchWin->Window();
+ ShowWindow(hWndxWinParent,SW_SHOW); //Make visible.
}
+ else {
+ // no success initializing hatch window
+ delete m_pCHatchWin, m_pCHatchWin = 0;
+ hWndxWinParent = hWndSite;
+ }
+
+ aAny <<= sal_Int32(hWndxWinParent);
+ xWin = uno::Reference<awt::XWindow>(
+ xToolkit->createSystemChild(
+ aAny,
+ aProcessIdent,
+ lang::SystemDependent::SYSTEM_WIN32),
+ uno::UNO_QUERY);
if(xWin.is()) {
xWin->setPosSize(
@@ -1301,12 +1298,9 @@ DocumentHolder::getContainerWindow(
uno::Reference<awt::XWindow> xWin(0);
- static const ::rtl::OUString aToolkitServiceName(
- RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.awt.Toolkit" ) );
- uno::Reference<awt::XSystemChildFactory> xToolkit(
- m_xFactory->createInstance(aToolkitServiceName ),uno::UNO_QUERY);
+ uno::Reference<awt::XToolkit2> xToolkit = awt::Toolkit::create( comphelper::getComponentContext(m_xFactory) );
- if(xToolkit.is() && m_pIOleIPFrame) {
+ if(m_pIOleIPFrame) {
HWND hWnd;
m_pIOleIPFrame->GetWindow(&hWnd);
diff --git a/extensions/source/nsplugin/source/so_instance.cxx b/extensions/source/nsplugin/source/so_instance.cxx
index 4aeb45a645f7..a86ddbeec814 100644
--- a/extensions/source/nsplugin/source/so_instance.cxx
+++ b/extensions/source/nsplugin/source/so_instance.cxx
@@ -31,6 +31,7 @@
#include <com/sun/star/frame/DispatchHelper.hpp>
#include <com/sun/star/frame/XDispatchProviderInterception.hpp>
#include <com/sun/star/lang/SystemDependent.hpp>
+#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/XSystemChildFactory.hpp>
#include <com/sun/star/awt/XVclWindowPeer.hpp>
#include <com/sun/star/util/XCloseable.hpp>
@@ -132,15 +133,11 @@ sal_Bool SoPluginInstance::LoadDocument(NSP_HWND hParent)
try
{
+ Reference< beans::XPropertySet > xFactoryProperties( mxRemoteMSF, uno::UNO_QUERY );
+ Reference< uno::XComponentContext > xContext( xFactoryProperties->getPropertyValue( "DefaultContext" ), UNO_QUERY );
+
// try to create netscape plugin window
- Reference< awt::XToolkit > xToolkit(
- mxRemoteMSF->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.Toolkit")) ),
- uno::UNO_QUERY );
- if( !xToolkit.is() )
- {
- debug_fprintf(NSP_LOG_APPEND, "Can not create Toolkit!\n");
- return sal_False;
- }
+ Reference< awt::XToolkit > xToolkit( awt::Toolkit::create(xContext), uno::UNO_QUERY_THROW );
// prepare parameters for plugin window
css::uno::Any hwndParent = css::uno::makeAny((sal_Int32)hParent);
@@ -240,8 +237,6 @@ sal_Bool SoPluginInstance::LoadDocument(NSP_HWND hParent)
}
//create stream for the document
- Reference< uno::XComponentContext > xContext(
- comphelper::getComponentContext( mxRemoteMSF ) );
Reference< ucb::XSimpleFileAccess2 > xSimpleFileAccess( ucb::SimpleFileAccess::create(xContext) );
Reference<io::XInputStream> xInputStream = xSimpleFileAccess->openFileRead( m_sURL );
diff --git a/framework/inc/services.h b/framework/inc/services.h
index 993330937a70..763c8d0c8517 100644
--- a/framework/inc/services.h
+++ b/framework/inc/services.h
@@ -38,7 +38,6 @@ namespace framework{
#define SERVICENAME_MEDIATYPEDETECTIONHELPER DECLARE_ASCII("com.sun.star.frame.MediaTypeDetectionHelper" )
#define SERVICENAME_LOGINDIALOG DECLARE_ASCII("com.sun.star.framework.LoginDialog" )
#define SERVICENAME_CONFIGURATION DECLARE_ASCII("com.sun.star.configuration.ConfigurationRegistry" )
-#define SERVICENAME_VCLTOOLKIT DECLARE_ASCII("com.sun.star.awt.Toolkit" )
#define SERVICENAME_SIMPLEREGISTRY DECLARE_ASCII("com.sun.star.registry.SimpleRegistry" )
#define SERVICENAME_NESTEDREGISTRY DECLARE_ASCII("com.sun.star.registry.NestedRegistry" )
#define SERVICENAME_GENERICFRAMELOADER DECLARE_ASCII("com.sun.star.comp.office.FilterDetect" )
diff --git a/framework/inc/tabwin/tabwinfactory.hxx b/framework/inc/tabwin/tabwinfactory.hxx
index a594b2a548a3..fb08f20aafbb 100644
--- a/framework/inc/tabwin/tabwinfactory.hxx
+++ b/framework/inc/tabwin/tabwinfactory.hxx
@@ -33,7 +33,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XSingleComponentFactory.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/awt/XToolkit.hpp>
+#include <com/sun/star/awt/XToolkit2.hpp>
#include <cppuhelper/implbase2.hxx>
#include <rtl/ustring.hxx>
@@ -57,7 +57,7 @@ class TabWinFactory : protected ThreadHelpBase
private:
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit > m_xToolkit;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit2 > m_xToolkit;
};
}
diff --git a/framework/source/dispatch/menudispatcher.cxx b/framework/source/dispatch/menudispatcher.cxx
index f5661d4ed4d7..f13af3d85765 100644
--- a/framework/source/dispatch/menudispatcher.cxx
+++ b/framework/source/dispatch/menudispatcher.cxx
@@ -33,7 +33,6 @@
#include <services.h>
#include <com/sun/star/frame/FrameSearchFlag.hpp>
-#include <com/sun/star/awt/XToolkit.hpp>
#include <com/sun/star/awt/WindowAttribute.hpp>
#include <com/sun/star/awt/WindowDescriptor.hpp>
#include <com/sun/star/awt/PosSize.hpp>
diff --git a/framework/source/dispatch/popupmenudispatcher.cxx b/framework/source/dispatch/popupmenudispatcher.cxx
index c13e80f47c7d..37132b424b6f 100644
--- a/framework/source/dispatch/popupmenudispatcher.cxx
+++ b/framework/source/dispatch/popupmenudispatcher.cxx
@@ -34,7 +34,6 @@
#include <properties.h>
#include <com/sun/star/frame/FrameSearchFlag.hpp>
-#include <com/sun/star/awt/XToolkit.hpp>
#include <com/sun/star/awt/WindowAttribute.hpp>
#include <com/sun/star/awt/WindowDescriptor.hpp>
#include <com/sun/star/awt/PosSize.hpp>
diff --git a/framework/source/layoutmanager/helpers.cxx b/framework/source/layoutmanager/helpers.cxx
index 1f9a03742686..ef48be24888e 100644
--- a/framework/source/layoutmanager/helpers.cxx
+++ b/framework/source/layoutmanager/helpers.cxx
@@ -31,6 +31,7 @@
#include <services.h>
#include <com/sun/star/ui/DockingArea.hpp>
+#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
#include <com/sun/star/frame/XDispatchHelper.hpp>
#include <com/sun/star/awt/XDockableWindow.hpp>
@@ -38,6 +39,7 @@
#include <com/sun/star/awt/XWindowListener.hpp>
#include <com/sun/star/ui/XUIElement.hpp>
+#include <comphelper/processfactory.hxx>
#include <comphelper/mediadescriptor.hxx>
#include <vcl/svapp.hxx>
#include <toolkit/unohlp.hxx>
@@ -169,29 +171,21 @@ bool lcl_checkUIElement(const uno::Reference< ui::XUIElement >& xUIElement, awt:
return bRet;
}
-uno::Reference< awt::XWindowPeer > createToolkitWindow( const uno::Reference< lang::XMultiServiceFactory >& rFactory, const uno::Reference< awt::XWindowPeer >& rParent, const char* pService )
+uno::Reference< awt::XWindowPeer > createToolkitWindow( const uno::Reference< uno::XComponentContext >& rxContext, const uno::Reference< awt::XWindowPeer >& rParent, const char* pService )
{
- const rtl::OUString aAWTToolkit( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.Toolkit" ));
-
- uno::Reference< awt::XWindowPeer > xPeer;
- if ( rFactory.is() )
- {
- uno::Reference< awt::XToolkit > xToolkit( rFactory->createInstance( aAWTToolkit ), uno::UNO_QUERY_THROW );
- if ( xToolkit.is() )
- {
- // describe window properties.
- css::awt::WindowDescriptor aDescriptor;
- aDescriptor.Type = awt::WindowClass_SIMPLE;
- aDescriptor.WindowServiceName = ::rtl::OUString::createFromAscii( pService );
- aDescriptor.ParentIndex = -1;
- aDescriptor.Parent = uno::Reference< awt::XWindowPeer >( rParent, uno::UNO_QUERY );
- aDescriptor.Bounds = awt::Rectangle(0,0,0,0);
- aDescriptor.WindowAttributes = 0;
-
- // create a awt window
- xPeer = xToolkit->createWindow( aDescriptor );
- }
- }
+ uno::Reference< awt::XToolkit2 > xToolkit = awt::Toolkit::create( rxContext );
+
+ // describe window properties.
+ css::awt::WindowDescriptor aDescriptor;
+ aDescriptor.Type = awt::WindowClass_SIMPLE;
+ aDescriptor.WindowServiceName = ::rtl::OUString::createFromAscii( pService );
+ aDescriptor.ParentIndex = -1;
+ aDescriptor.Parent = uno::Reference< awt::XWindowPeer >( rParent, uno::UNO_QUERY );
+ aDescriptor.Bounds = awt::Rectangle(0,0,0,0);
+ aDescriptor.WindowAttributes = 0;
+
+ // create a awt window
+ uno::Reference< awt::XWindowPeer > xPeer = xToolkit->createWindow( aDescriptor );
return xPeer;
}
diff --git a/framework/source/layoutmanager/helpers.hxx b/framework/source/layoutmanager/helpers.hxx
index 3d11ee5bc19f..dbe1cd0b5a0e 100644
--- a/framework/source/layoutmanager/helpers.hxx
+++ b/framework/source/layoutmanager/helpers.hxx
@@ -34,6 +34,8 @@
#include <properties.h>
#include <com/sun/star/awt/XWindowPeer.hpp>
+#include <com/sun/star/awt/XToolkit2.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/ui/XUIElement.hpp>
@@ -66,7 +68,7 @@ SystemWindow* getTopSystemWindow( const ::com::sun::star::uno::Reference< ::com:
bool equalRectangles( const css::awt::Rectangle& rRect1, const css::awt::Rectangle& rRect2 );
void setZeroRectangle( ::Rectangle& rRect );
bool lcl_checkUIElement(const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement >& xUIElement,::com::sun::star::awt::Rectangle& _rPosSize, ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& _xWindow);
-::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > createToolkitWindow( const css::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rFactory, const css::uno::Reference< ::com::sun::star::awt::XWindowPeer >& rParent, const char* pService );
+::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > createToolkitWindow( const css::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, const css::uno::Reference< ::com::sun::star::awt::XWindowPeer >& rParent, const char* pService );
WindowAlign ImplConvertAlignment( sal_Int16 aAlignment );
::rtl::OUString getElementTypeFromResourceURL( const ::rtl::OUString& aResourceURL );
void parseResourceURL( const rtl::OUString& aResourceURL, rtl::OUString& aElementType, rtl::OUString& aElementName );
@@ -77,7 +79,7 @@ sal_Bool implts_isPreviewModel( const ::com::sun::star::uno::Reference< ::com::s
sal_Bool implts_isFrameOrWindowTop( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame );
void impl_setDockingWindowVisibility( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& rSMGR, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& rDockingWindowName, bool bVisible );
void impl_addWindowListeners( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xThis, const ::com::sun::star::uno::Reference< css::ui::XUIElement >& xUIElement );
-::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > implts_createToolkitWindow( const css::uno::Reference< ::com::sun::star::awt::XToolkit >& rToolkit, const css::uno::Reference< ::com::sun::star::awt::XWindowPeer >& rParent );
+::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > implts_createToolkitWindow( const css::uno::Reference< ::com::sun::star::awt::XToolkit2 >& rToolkit, const css::uno::Reference< ::com::sun::star::awt::XWindowPeer >& rParent );
}
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
index 179725afd338..0a67895c9b42 100644
--- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
@@ -34,6 +34,7 @@
#include <uiconfiguration/windowstateconfiguration.hxx>
#include <com/sun/star/awt/PosSize.hpp>
+#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/ui/UIElementType.hpp>
#include <com/sun/star/container/XNameReplace.hpp>
@@ -82,7 +83,7 @@ ToolbarLayoutManager::ToolbarLayoutManager(
setZeroRectangle( m_aDockingArea );
// create toolkit object
- m_xToolkit = uno::Reference< awt::XToolkit >( m_xSMGR->createInstance( SERVICENAME_VCLTOOLKIT ), uno::UNO_QUERY );
+ m_xToolkit = awt::Toolkit::create( comphelper::getComponentContext(m_xSMGR) );
}
ToolbarLayoutManager::~ToolbarLayoutManager()
@@ -912,10 +913,10 @@ void ToolbarLayoutManager::setParentWindow(
{
static const char DOCKINGAREASTRING[] = "dockingarea";
- uno::Reference< awt::XWindow > xTopDockWindow = uno::Reference< awt::XWindow >( createToolkitWindow( m_xSMGR, xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
- uno::Reference< awt::XWindow > xLeftDockWindow = uno::Reference< awt::XWindow >( createToolkitWindow( m_xSMGR, xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
- uno::Reference< awt::XWindow > xRightDockWindow = uno::Reference< awt::XWindow >( createToolkitWindow( m_xSMGR, xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
- uno::Reference< awt::XWindow > xBottomDockWindow = uno::Reference< awt::XWindow >( createToolkitWindow( m_xSMGR, xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
+ uno::Reference< awt::XWindow > xTopDockWindow = uno::Reference< awt::XWindow >( createToolkitWindow( comphelper::getComponentContext(m_xSMGR), xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
+ uno::Reference< awt::XWindow > xLeftDockWindow = uno::Reference< awt::XWindow >( createToolkitWindow( comphelper::getComponentContext(m_xSMGR), xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
+ uno::Reference< awt::XWindow > xRightDockWindow = uno::Reference< awt::XWindow >( createToolkitWindow( comphelper::getComponentContext(m_xSMGR), xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
+ uno::Reference< awt::XWindow > xBottomDockWindow = uno::Reference< awt::XWindow >( createToolkitWindow( comphelper::getComponentContext(m_xSMGR), xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
WriteGuard aWriteLock( m_aLock );
m_xContainerWindow = uno::Reference< awt::XWindow2 >( xParentWindow, uno::UNO_QUERY );
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.hxx b/framework/source/layoutmanager/toolbarlayoutmanager.hxx
index 0f4d2b7ac212..2d4389428ea2 100644
--- a/framework/source/layoutmanager/toolbarlayoutmanager.hxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.hxx
@@ -63,6 +63,7 @@
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/ui/XUIElementFactory.hpp>
#include <com/sun/star/ui/DockingArea.hpp>
+#include <com/sun/star/awt/XToolkit2.hpp>
#include <com/sun/star/awt/XTopWindow2.hpp>
#include <com/sun/star/awt/XWindow2.hpp>
#include <com/sun/star/awt/XDockableWindow.hpp>
@@ -305,7 +306,7 @@ class ToolbarLayoutManager : public ::cppu::WeakImplHelper3< ::com::sun::star::a
css::uno::Reference< ::com::sun::star::ui::XUIElementFactory > m_xUIElementFactoryManager;
css::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > m_xModuleCfgMgr;
css::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > m_xDocCfgMgr;
- css::uno::Reference< ::com::sun::star::awt::XToolkit > m_xToolkit;
+ css::uno::Reference< ::com::sun::star::awt::XToolkit2 > m_xToolkit;
css::uno::Reference< ::com::sun::star::container::XNameAccess > m_xPersistentWindowState;
ILayoutNotifications* m_pParentLayouter;
diff --git a/framework/source/services/backingcomp.cxx b/framework/source/services/backingcomp.cxx
index 9058790ef086..a411b4b9575d 100644
--- a/framework/source/services/backingcomp.cxx
+++ b/framework/source/services/backingcomp.cxx
@@ -44,6 +44,7 @@
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/XDataTransferProviderAccess.hpp>
#include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
#include <com/sun/star/awt/KeyEvent.hpp>
@@ -471,15 +472,12 @@ void SAL_CALL BackingComp::attachFrame( /*IN*/ const css::uno::Reference< css::f
::framework::DropTargetListener* pDropListener = new ::framework::DropTargetListener(m_xSMGR, m_xFrame);
m_xDropTargetListener = css::uno::Reference< css::datatransfer::dnd::XDropTargetListener >(static_cast< ::cppu::OWeakObject* >(pDropListener), css::uno::UNO_QUERY);
- css::uno::Reference< css::awt::XDataTransferProviderAccess > xTransfer(m_xSMGR->createInstance(SERVICENAME_VCLTOOLKIT), css::uno::UNO_QUERY);
- if (xTransfer.is())
+ css::uno::Reference< css::awt::XToolkit2 > xToolkit = css::awt::Toolkit::create( comphelper::getComponentContext(m_xSMGR) );
+ css::uno::Reference< css::datatransfer::dnd::XDropTarget > xDropTarget = xToolkit->getDropTarget(m_xWindow);
+ if (xDropTarget.is())
{
- css::uno::Reference< css::datatransfer::dnd::XDropTarget > xDropTarget = xTransfer->getDropTarget(m_xWindow);
- if (xDropTarget.is())
- {
- xDropTarget->addDropTargetListener(m_xDropTargetListener);
- xDropTarget->setActive(sal_True);
- }
+ xDropTarget->addDropTargetListener(m_xDropTargetListener);
+ xDropTarget->setActive(sal_True);
}
// initialize the component and it's parent window
@@ -690,15 +688,12 @@ void SAL_CALL BackingComp::dispose()
// deregister drag&drop helper
if (m_xDropTargetListener.is())
{
- css::uno::Reference< css::awt::XDataTransferProviderAccess > xTransfer(m_xSMGR->createInstance(SERVICENAME_VCLTOOLKIT), css::uno::UNO_QUERY);
- if (xTransfer.is())
+ css::uno::Reference< css::awt::XToolkit2 > xToolkit = css::awt::Toolkit::create( comphelper::getComponentContext(m_xSMGR) );
+ css::uno::Reference< css::datatransfer::dnd::XDropTarget > xDropTarget = xToolkit->getDropTarget(m_xWindow);
+ if (xDropTarget.is())
{
- css::uno::Reference< css::datatransfer::dnd::XDropTarget > xDropTarget = xTransfer->getDropTarget(m_xWindow);
- if (xDropTarget.is())
- {
- xDropTarget->removeDropTargetListener(m_xDropTargetListener);
- xDropTarget->setActive(sal_False);
- }
+ xDropTarget->removeDropTargetListener(m_xDropTargetListener);
+ xDropTarget->setActive(sal_False);
}
m_xDropTargetListener = css::uno::Reference< css::datatransfer::dnd::XDropTargetListener >();
}
diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx
index 713ad4ad93e1..5f0629dc32be 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -48,7 +48,6 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/frame/FrameSearchFlag.hpp>
-#include <com/sun/star/awt/XToolkit.hpp>
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/awt/XWindowPeer.hpp>
#include <com/sun/star/awt/WindowDescriptor.hpp>
diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx
index b56b561e34ba..5d956076d5bc 100644
--- a/framework/source/services/frame.cxx
+++ b/framework/source/services/frame.cxx
@@ -54,6 +54,7 @@
#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/util/XCloseable.hpp>
+#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/XDevice.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
#include <com/sun/star/frame/XDesktop.hpp>
@@ -2926,15 +2927,12 @@ void Frame::implts_startWindowListening()
{
xTopWindow->addTopWindowListener( xTopWindowListener );
- css::uno::Reference< css::awt::XDataTransferProviderAccess > xTransfer( xFactory->createInstance( SERVICENAME_VCLTOOLKIT ), css::uno::UNO_QUERY );
- if( xTransfer.is() == sal_True )
+ css::uno::Reference< css::awt::XToolkit2 > xToolkit = css::awt::Toolkit::create( comphelper::getComponentContext(xFactory) );
+ css::uno::Reference< css::datatransfer::dnd::XDropTarget > xDropTarget = xToolkit->getDropTarget( xContainerWindow );
+ if( xDropTarget.is() == sal_True )
{
- css::uno::Reference< css::datatransfer::dnd::XDropTarget > xDropTarget = xTransfer->getDropTarget( xContainerWindow );
- if( xDropTarget.is() == sal_True )
- {
- xDropTarget->addDropTargetListener( xDragDropListener );
- xDropTarget->setActive( sal_True );
- }
+ xDropTarget->addDropTargetListener( xDragDropListener );
+ xDropTarget->setActive( sal_True );
}
}
}
@@ -2969,15 +2967,12 @@ void Frame::implts_stopWindowListening()
{
xTopWindow->removeTopWindowListener( xTopWindowListener );
- css::uno::Reference< css::awt::XDataTransferProviderAccess > xTransfer( xFactory->createInstance( SERVICENAME_VCLTOOLKIT ), css::uno::UNO_QUERY );
- if( xTransfer.is() == sal_True )
+ css::uno::Reference< css::awt::XToolkit2 > xToolkit = css::awt::Toolkit::create( comphelper::getComponentContext(xFactory) );
+ css::uno::Reference< css::datatransfer::dnd::XDropTarget > xDropTarget = xToolkit->getDropTarget( xContainerWindow );
+ if( xDropTarget.is() == sal_True )
{
- css::uno::Reference< css::datatransfer::dnd::XDropTarget > xDropTarget = xTransfer->getDropTarget( xContainerWindow );
- if( xDropTarget.is() == sal_True )
- {
- xDropTarget->removeDropTargetListener( xDragDropListener );
- xDropTarget->setActive( sal_False );
- }
+ xDropTarget->removeDropTargetListener( xDragDropListener );
+ xDropTarget->setActive( sal_False );
}
}
}
diff --git a/framework/source/services/taskcreatorsrv.cxx b/framework/source/services/taskcreatorsrv.cxx
index 56a308f88045..d7fb64392ecd 100644
--- a/framework/source/services/taskcreatorsrv.cxx
+++ b/framework/source/services/taskcreatorsrv.cxx
@@ -40,6 +40,7 @@
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/frame/XDesktop.hpp>
+#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
#include <com/sun/star/awt/WindowDescriptor.hpp>
#include <com/sun/star/awt/WindowAttribute.hpp>
@@ -220,7 +221,7 @@ css::uno::Reference< css::awt::XWindow > TaskCreatorService::implts_createContai
// <- SAFE
// get toolkit to create task container window
- css::uno::Reference< css::awt::XToolkit > xToolkit( xSMGR->createInstance( SERVICENAME_VCLTOOLKIT ), css::uno::UNO_QUERY_THROW);
+ css::uno::Reference< css::awt::XToolkit2 > xToolkit = css::awt::Toolkit::create( comphelper::getComponentContext(xSMGR) );
// Check if child frames can be created realy. We need at least a valid window at the parent frame ...
css::uno::Reference< css::awt::XWindowPeer > xParentWindowPeer;
diff --git a/framework/source/tabwin/tabwindow.cxx b/framework/source/tabwin/tabwindow.cxx
index d1b287492639..e0bdb92bfb2f 100644
--- a/framework/source/tabwin/tabwindow.cxx
+++ b/framework/source/tabwin/tabwindow.cxx
@@ -32,6 +32,7 @@
#include <threadhelp/resetableguard.hxx>
#include <com/sun/star/util/XURLTransformer.hpp>
+#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/awt/WindowDescriptor.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
@@ -299,15 +300,14 @@ throw (css::uno::Exception, css::uno::RuntimeException)
{
css::beans::PropertyValue aPropValue;
css::uno::Reference< css::awt::XTopWindow > xTopWindow;
- css::uno::Reference< css::awt::XToolkit > xToolkit;
+ css::uno::Reference< css::awt::XToolkit2 > xToolkit;
css::awt::WindowDescriptor aDescriptor;
if ( xSMGR.is() )
{
try
{
- xToolkit = css::uno::Reference< css::awt::XToolkit >(
- xSMGR->createInstance( SERVICENAME_VCLTOOLKIT ), css::uno::UNO_QUERY );
+ xToolkit = css::awt::Toolkit::create( comphelper::getComponentContext(xSMGR) );
}
catch ( const css::uno::RuntimeException& )
{
diff --git a/framework/source/tabwin/tabwinfactory.cxx b/framework/source/tabwin/tabwinfactory.cxx
index a3d7815fd7ce..89a58d2928a9 100644
--- a/framework/source/tabwin/tabwinfactory.cxx
+++ b/framework/source/tabwin/tabwinfactory.cxx
@@ -33,6 +33,7 @@
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
#include <com/sun/star/awt/WindowAttribute.hpp>
@@ -90,7 +91,7 @@ throw ( css::uno::Exception, css::uno::RuntimeException )
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
ResetableGuard aLock( m_aLock );
- css::uno::Reference< css::awt::XToolkit > xToolkit = m_xToolkit;
+ css::uno::Reference< css::awt::XToolkit2 > xToolkit = m_xToolkit;
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR( m_xServiceManager );
aLock.unlock();
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
@@ -110,37 +111,31 @@ throw ( css::uno::Exception, css::uno::RuntimeException )
if ( !xToolkit.is() && xSMGR.is() )
{
- xToolkit = css::uno::Reference< css::awt::XToolkit >( xSMGR->createInstance( SERVICENAME_VCLTOOLKIT ), css::uno::UNO_QUERY );
- if ( xToolkit.is() )
- {
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- aLock.lock();
- m_xToolkit = xToolkit;
- aLock.unlock();
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- }
+ xToolkit = css::awt::Toolkit::create( comphelper::getComponentContext(xSMGR) );
+ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
+ aLock.lock();
+ m_xToolkit = xToolkit;
+ aLock.unlock();
+ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
}
if ( !xTopWindow.is() )
{
- if ( xToolkit.is() )
- {
- // describe window properties.
- css::awt::WindowDescriptor aDescriptor;
- aDescriptor.Type = css::awt::WindowClass_TOP ;
- aDescriptor.ParentIndex = -1 ;
- aDescriptor.Parent = css::uno::Reference< css::awt::XWindowPeer >() ;
- aDescriptor.Bounds = css::awt::Rectangle(0,0,0,0) ;
- aDescriptor.WindowAttributes = css::awt::WindowAttribute::BORDER|
- css::awt::WindowAttribute::SIZEABLE|
- css::awt::WindowAttribute::MOVEABLE|
- css::awt::WindowAttribute::CLOSEABLE|
- css::awt::WindowAttribute::MINSIZE;
-
- // create a parent window
- xTopWindow = css::uno::Reference< css::awt::XTopWindow >(
- xToolkit->createWindow( aDescriptor ), css::uno::UNO_QUERY );
- }
+ // describe window properties.
+ css::awt::WindowDescriptor aDescriptor;
+ aDescriptor.Type = css::awt::WindowClass_TOP ;
+ aDescriptor.ParentIndex = -1 ;
+ aDescriptor.Parent = css::uno::Reference< css::awt::XWindowPeer >() ;
+ aDescriptor.Bounds = css::awt::Rectangle(0,0,0,0) ;
+ aDescriptor.WindowAttributes = css::awt::WindowAttribute::BORDER|
+ css::awt::WindowAttribute::SIZEABLE|
+ css::awt::WindowAttribute::MOVEABLE|
+ css::awt::WindowAttribute::CLOSEABLE|
+ css::awt::WindowAttribute::MINSIZE;
+
+ // create a parent window
+ xTopWindow = css::uno::Reference< css::awt::XTopWindow >(
+ xToolkit->createWindow( aDescriptor ), css::uno::UNO_QUERY );
}
if ( xTopWindow.is() )
diff --git a/framework/source/uifactory/windowcontentfactorymanager.cxx b/framework/source/uifactory/windowcontentfactorymanager.cxx
index 23c7c97df4e9..a6a950bf2d5c 100644
--- a/framework/source/uifactory/windowcontentfactorymanager.cxx
+++ b/framework/source/uifactory/windowcontentfactorymanager.cxx
@@ -38,7 +38,6 @@
#include <com/sun/star/container/XContainer.hpp>
#include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/frame/XFrame.hpp>
-#include <com/sun/star/awt/XToolkit.hpp>
#include <com/sun/star/awt/XControlModel.hpp>
#include <com/sun/star/awt/XControl.hpp>
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;
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index b248cf33c8a3..c590daca339d 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -54,6 +54,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/awt,\
MenuBar \
PopupMenu \
TabController \
+ Toolkit \
UnoControlDialogModelProvider \
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/awt/grid,\
@@ -374,7 +375,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/awt,\
RoadmapItem \
SpinningProgressControlModel \
TabControllerModel \
- Toolkit \
UnoControl \
UnoControlButton \
UnoControlButtonModel \
@@ -1822,6 +1822,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/awt,\
XTimeField \
XToggleButton \
XToolkit \
+ XToolkit2 \
XToolkitExperimental \
XTopWindow \
XTopWindow2 \
diff --git a/offapi/com/sun/star/awt/Toolkit.idl b/offapi/com/sun/star/awt/Toolkit.idl
index 20cf21dfa7fa..2290688c4672 100644
--- a/offapi/com/sun/star/awt/Toolkit.idl
+++ b/offapi/com/sun/star/awt/Toolkit.idl
@@ -19,16 +19,11 @@
#ifndef __com_sun_star_awt_Toolkit_idl__
#define __com_sun_star_awt_Toolkit_idl__
-#include <com/sun/star/awt/XToolkit.idl>
-#include <com/sun/star/awt/XDataTransferProviderAccess.idl>
-#include <com/sun/star/awt/XSystemChildFactory.idl>
-#include <com/sun/star/awt/XMessageBoxFactory.idl>
-
+#include <com/sun/star/awt/XToolkit2.idl>
module com { module sun { module star { module awt {
-
/** describes a toolkit that creates windows on a screen.
<p>The design of the interfaces for the toolkit implementation
@@ -36,17 +31,7 @@ module com { module sun { module star { module awt {
of the toolkit should be one-way. Too many synchronous calls kill the
remote performance.</p>
*/
-published service Toolkit
-{
- interface XToolkit;
-
- [optional] interface com::sun::star::awt::XDataTransferProviderAccess;
-
- [optional] interface com::sun::star::awt::XSystemChildFactory;
-
- [optional] interface com::sun::star::awt::XMessageBoxFactory;
-
-};
+published service Toolkit : XToolkit2;
}; }; }; };
diff --git a/offapi/com/sun/star/awt/XToolkit2.idl b/offapi/com/sun/star/awt/XToolkit2.idl
new file mode 100644
index 000000000000..2d40d9c6021f
--- /dev/null
+++ b/offapi/com/sun/star/awt/XToolkit2.idl
@@ -0,0 +1,59 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef __com_sun_star_awt_XToolkit2_idl__
+#define __com_sun_star_awt_XToolkit2_idl__
+
+#include <com/sun/star/awt/XToolkit.idl>
+#include <com/sun/star/awt/XDataTransferProviderAccess.idl>
+#include <com/sun/star/awt/XSystemChildFactory.idl>
+#include <com/sun/star/awt/XMessageBoxFactory.idl>
+#include <com/sun/star/awt/XExtendedToolkit.idl>
+#include <com/sun/star/awt/XReschedule.idl>
+
+
+
+module com { module sun { module star { module awt {
+
+
+/**
+ Provides a unified interface for the new-style service Toolkit to implement.
+
+ @since LibreOffice 3.7
+ */
+published interface XToolkit2
+{
+ interface XToolkit;
+
+ interface com::sun::star::awt::XDataTransferProviderAccess;
+
+ interface com::sun::star::awt::XSystemChildFactory;
+
+ interface com::sun::star::awt::XMessageBoxFactory;
+
+ interface com::sun::star::awt::XExtendedToolkit;
+
+ interface com::sun::star::awt::XReschedule;
+};
+
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/com/sun/star/awt/XToolkitExperimental.idl b/offapi/com/sun/star/awt/XToolkitExperimental.idl
index c26d916af6b4..a60b3bc7510f 100644
--- a/offapi/com/sun/star/awt/XToolkitExperimental.idl
+++ b/offapi/com/sun/star/awt/XToolkitExperimental.idl
@@ -10,14 +10,14 @@
#ifndef __com_sun_star_awt_XToolkitExperimental_idl__
#define __com_sun_star_awt_XToolkitExperimental_idl__
-#include <com/sun/star/awt/XToolkit.idl>
+#include <com/sun/star/awt/XToolkit2.idl>
module com { module sun { module star { module awt {
/** Work in progress, don't use unless you know what you are doing.
*/
-interface XToolkitExperimental: XToolkit
+interface XToolkitExperimental : XToolkit2
{
/** Create a bitmap device using a byte buffer allocated outside of UNO territory.
*
diff --git a/offapi/type_reference/types.rdb b/offapi/type_reference/types.rdb
index 34d7172536e8..da0750a56458 100644
--- a/offapi/type_reference/types.rdb
+++ b/offapi/type_reference/types.rdb
Binary files differ
diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx
index 964c595e0be9..4392c99cb37d 100644
--- a/scripting/source/dlgprov/dlgprov.cxx
+++ b/scripting/source/dlgprov/dlgprov.cxx
@@ -21,6 +21,7 @@
#include "DialogModelProvider.hxx"
#include "dlgprov.hxx"
#include "dlgevtatt.hxx"
+#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/XControlContainer.hpp>
#include <com/sun/star/awt/XWindowPeer.hpp>
#include <com/sun/star/io/XInputStreamProvider.hpp>
@@ -519,10 +520,8 @@ static ::rtl::OUString aResourceResolverPropName("ResourceResolver");
}
// create a peer
- Reference< XToolkit> xToolkit( xSMgr->createInstanceWithContext(
- ::rtl::OUString( "com.sun.star.awt.Toolkit" ), m_xContext ), UNO_QUERY );
- if ( xToolkit.is() )
- xDialogControl->createPeer( xToolkit, xPeer );
+ Reference< XToolkit> xToolkit( Toolkit::create( m_xContext ), UNO_QUERY_THROW );
+ xDialogControl->createPeer( xToolkit, xPeer );
}
}
}
diff --git a/sd/workben/custompanel/ctp_panel.cxx b/sd/workben/custompanel/ctp_panel.cxx
index 85a976313ed9..bfe6b18b5db0 100644
--- a/sd/workben/custompanel/ctp_panel.cxx
+++ b/sd/workben/custompanel/ctp_panel.cxx
@@ -23,7 +23,7 @@
#include <com/sun/star/drawing/framework/XPane.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/awt/XWindowPeer.hpp>
-#include <com/sun/star/awt/XToolkit.hpp>
+#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/WindowClass.hpp>
#include <com/sun/star/awt/WindowAttribute.hpp>
#include <com/sun/star/awt/PosSize.hpp>
@@ -83,10 +83,7 @@ namespace sd { namespace colortoolpanel
{
ENSURE_OR_THROW( i_rContext.is(), "illegal component context" );
Reference< XMultiComponentFactory > xFactory( i_rContext->getServiceManager(), UNO_SET_THROW );
- Reference< XToolkit > xToolkit( xFactory->createInstanceWithContext(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.Toolkit" ) ),
- i_rContext
- ), UNO_QUERY_THROW );
+ Reference< XToolkit2 > xToolkit = Toolkit::create(i_rContext);
WindowDescriptor aWindow;
aWindow.Type = WindowClass_SIMPLE;
diff --git a/sdext/source/minimizer/unodialog.cxx b/sdext/source/minimizer/unodialog.cxx
index c39e90106ed0..bb28f1127638 100644
--- a/sdext/source/minimizer/unodialog.cxx
+++ b/sdext/source/minimizer/unodialog.cxx
@@ -25,6 +25,7 @@
#include <com/sun/star/view/XSelectionSupplier.hpp>
#include <com/sun/star/view/XControlAccess.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
+#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/XMessageBoxFactory.hpp>
#include <com/sun/star/awt/MessageBoxButtons.hpp>
@@ -97,7 +98,7 @@ Reference< XWindowPeer > UnoDialog::createWindowPeer( Reference< XWindowPeer > x
throw ( Exception )
{
mxDialogWindow->setVisible( sal_False );
- Reference< XToolkit > xToolkit( mxMSF->getServiceManager()->createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.Toolkit" ) ), mxMSF ), UNO_QUERY_THROW );
+ Reference< XToolkit > xToolkit( Toolkit::create( mxMSF ), UNO_QUERY_THROW );
if ( !xParentPeer.is() )
xParentPeer = xToolkit->getDesktopWindow();
mxReschedule = Reference< XReschedule >( xToolkit, UNO_QUERY );
diff --git a/sdext/source/presenter/PresenterSlideShowView.cxx b/sdext/source/presenter/PresenterSlideShowView.cxx
index ba820ebefe41..2201a1edca2f 100644
--- a/sdext/source/presenter/PresenterSlideShowView.cxx
+++ b/sdext/source/presenter/PresenterSlideShowView.cxx
@@ -25,6 +25,7 @@
#include "PresenterPaneContainer.hxx"
#include <com/sun/star/awt/InvalidateStyle.hpp>
#include <com/sun/star/awt/PosSize.hpp>
+#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/WindowAttribute.hpp>
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/awt/XWindow2.hpp>
@@ -834,11 +835,7 @@ Reference<awt::XWindow> PresenterSlideShowView::CreateViewWindow (
if ( ! xFactory.is())
return xViewWindow;
- Reference<awt::XToolkit> xToolkit (
- xFactory->createInstanceWithContext(
- OUString("com.sun.star.awt.Toolkit"),
- mxComponentContext),
- UNO_QUERY_THROW);
+ Reference<awt::XToolkit2> xToolkit = awt::Toolkit::create(mxComponentContext);
awt::WindowDescriptor aWindowDescriptor (
awt::WindowClass_CONTAINER,
OUString(),
diff --git a/sfx2/workben/custompanel/ctp_panel.cxx b/sfx2/workben/custompanel/ctp_panel.cxx
index 6cde8e4e5fb9..d41f2e64a847 100644
--- a/sfx2/workben/custompanel/ctp_panel.cxx
+++ b/sfx2/workben/custompanel/ctp_panel.cxx
@@ -22,7 +22,7 @@
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/awt/XWindowPeer.hpp>
-#include <com/sun/star/awt/XToolkit.hpp>
+#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/WindowClass.hpp>
#include <com/sun/star/awt/WindowAttribute.hpp>
#include <com/sun/star/awt/PosSize.hpp>
@@ -81,10 +81,7 @@ namespace sd { namespace colortoolpanel
{
ENSURE_OR_THROW( i_rContext.is(), "illegal component context" );
Reference< XMultiComponentFactory > xFactory( i_rContext->getServiceManager(), UNO_SET_THROW );
- Reference< XToolkit > xToolkit( xFactory->createInstanceWithContext(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.Toolkit" ) ),
- i_rContext
- ), UNO_QUERY_THROW );
+ Reference< XToolkit2 > xToolkit = Toolkit::create(i_rContext);
WindowDescriptor aWindow;
aWindow.Type = WindowClass_SIMPLE;
diff --git a/slideshow/source/engine/shapes/viewappletshape.cxx b/slideshow/source/engine/shapes/viewappletshape.cxx
index eb0a53268a05..d4ee1d2b64d7 100644
--- a/slideshow/source/engine/shapes/viewappletshape.cxx
+++ b/slideshow/source/engine/shapes/viewappletshape.cxx
@@ -41,7 +41,7 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/util/XCloseable.hpp>
#include <com/sun/star/awt/WindowDescriptor.hpp>
-#include <com/sun/star/awt/XToolkit.hpp>
+#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/XWindow2.hpp>
#include <com/sun/star/awt/XWindowPeer.hpp>
#include <com/sun/star/awt/WindowAttribute.hpp>
@@ -150,11 +150,7 @@ namespace slideshow
// create an awt window to contain the applet
// ==========================================
- uno::Reference< awt::XToolkit > xToolkit(
- xFactory->createInstanceWithContext(
- ::rtl::OUString("com.sun.star.awt.Toolkit" ),
- mxComponentContext ),
- uno::UNO_QUERY_THROW );
+ uno::Reference< awt::XToolkit2 > xToolkit = awt::Toolkit::create(mxComponentContext);
awt::WindowDescriptor aOwnWinDescriptor( awt::WindowClass_SIMPLE,
::rtl::OUString(),
diff --git a/sw/source/ui/utlui/unotools.cxx b/sw/source/ui/utlui/unotools.cxx
index 6324bddd27a3..e762e720f77b 100644
--- a/sw/source/ui/utlui/unotools.cxx
+++ b/sw/source/ui/utlui/unotools.cxx
@@ -43,6 +43,7 @@
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/style/XStyle.hpp>
#include <com/sun/star/text/XTextDocument.hpp>
+#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/view/XViewSettingsSupplier.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
@@ -123,50 +124,49 @@ void SwOneExampleFrame::CreateControl()
return ;
uno::Reference< lang::XMultiServiceFactory >
xMgr = comphelper::getProcessServiceFactory();
+ uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
uno::Reference< uno::XInterface > xInst = xMgr->createInstance( C2U("com.sun.star.frame.FrameControl") );
_xControl = uno::Reference< awt::XControl >(xInst, uno::UNO_QUERY);
if(_xControl.is())
{
uno::Reference< awt::XWindowPeer > xParent( rWindow.GetComponentInterface() );
- uno::Reference< awt::XToolkit > xToolkit( xMgr->createInstance( C2U("com.sun.star.awt.Toolkit") ), uno::UNO_QUERY );
- if(xToolkit.is())
- {
- _xControl->createPeer( xToolkit, xParent );
-
- uno::Reference< awt::XWindow > xWin( _xControl, uno::UNO_QUERY );
- xWin->setVisible( sal_False );
- Size aWinSize(rWindow.GetOutputSizePixel());
- xWin->setPosSize( 0, 0, aWinSize.Width(), aWinSize.Height(), awt::PosSize::SIZE );
-
- uno::Reference< beans::XPropertySet > xPrSet(xInst, uno::UNO_QUERY);
- uno::Any aURL;
- // create new doc
- rtl::OUString sTempURL(cFactory);
- if(sArgumentURL.Len())
- sTempURL = sArgumentURL;
- aURL <<= sTempURL;
-
- uno::Sequence<beans::PropertyValue> aSeq(3);
- beans::PropertyValue* pValues = aSeq.getArray();
- pValues[0].Name = C2U("ReadOnly");
- sal_Bool bTrue = sal_True;
- pValues[0].Value.setValue(&bTrue, ::getBooleanCppuType());
- pValues[1].Name = C2U("OpenFlags");
- pValues[1].Value <<= C2U("-RB");
- pValues[2].Name = C2U("Referer");
- pValues[2].Value <<= C2U("private:user");
- uno::Any aArgs;
- aArgs.setValue(&aSeq, ::getCppuType((uno::Sequence<beans::PropertyValue>*)0));
-
- xPrSet->setPropertyValue( C2U("LoaderArguments"), aArgs );
- //save and set readonly???
-
- xPrSet->setPropertyValue(C2U("ComponentURL"), aURL);
-
- aLoadedTimer.Start();
- bServiceAvailable = sal_True;
- }
+ uno::Reference< awt::XToolkit > xToolkit( awt::Toolkit::create(xContext), uno::UNO_QUERY_THROW );
+
+ _xControl->createPeer( xToolkit, xParent );
+
+ uno::Reference< awt::XWindow > xWin( _xControl, uno::UNO_QUERY );
+ xWin->setVisible( sal_False );
+ Size aWinSize(rWindow.GetOutputSizePixel());
+ xWin->setPosSize( 0, 0, aWinSize.Width(), aWinSize.Height(), awt::PosSize::SIZE );
+
+ uno::Reference< beans::XPropertySet > xPrSet(xInst, uno::UNO_QUERY);
+ uno::Any aURL;
+ // create new doc
+ rtl::OUString sTempURL(cFactory);
+ if(sArgumentURL.Len())
+ sTempURL = sArgumentURL;
+ aURL <<= sTempURL;
+
+ uno::Sequence<beans::PropertyValue> aSeq(3);
+ beans::PropertyValue* pValues = aSeq.getArray();
+ pValues[0].Name = C2U("ReadOnly");
+ sal_Bool bTrue = sal_True;
+ pValues[0].Value.setValue(&bTrue, ::getBooleanCppuType());
+ pValues[1].Name = C2U("OpenFlags");
+ pValues[1].Value <<= C2U("-RB");
+ pValues[2].Name = C2U("Referer");
+ pValues[2].Value <<= C2U("private:user");
+ uno::Any aArgs;
+ aArgs.setValue(&aSeq, ::getCppuType((uno::Sequence<beans::PropertyValue>*)0));
+
+ xPrSet->setPropertyValue( C2U("LoaderArguments"), aArgs );
+ //save and set readonly???
+
+ xPrSet->setPropertyValue(C2U("ComponentURL"), aURL);
+
+ aLoadedTimer.Start();
+ bServiceAvailable = sal_True;
}
}
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;
}
diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
index 211c163bbcea..5334d8aced83 100644
--- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
+++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
@@ -32,6 +32,7 @@
#undef _LINUX_SOURCE_COMPAT
#endif
+#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
@@ -975,7 +976,7 @@ sal_Int16 SAL_CALL SalGtkFilePicker::execute() throw( uno::RuntimeException )
int btn = GTK_RESPONSE_NO;
uno::Reference< awt::XExtendedToolkit > xToolkit(
- createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.Toolkit")) ),
+ awt::Toolkit::create(m_xContext),
UNO_QUERY_THROW );
uno::Reference< frame::XDesktop > xDesktop(
diff --git a/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx
index fb0d352ec6f6..b90293c18509 100644
--- a/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx
+++ b/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx
@@ -32,6 +32,7 @@
#undef _LINUX_SOURCE_COMPAT
#endif
+#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
@@ -145,7 +146,7 @@ sal_Int16 SAL_CALL SalGtkFolderPicker::execute() throw( uno::RuntimeException )
sal_Int16 retVal = 0;
uno::Reference< awt::XExtendedToolkit > xToolkit(
- createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.Toolkit"))),
+ awt::Toolkit::create(m_xContext),
uno::UNO_QUERY);
uno::Reference< frame::XDesktop > xDesktop(
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index 342923d341f9..1d3ca708d61d 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -33,6 +33,7 @@
#include <rtl/uri.hxx>
#include <osl/file.hxx>
#include <com/sun/star/lang/Locale.hpp>
+#include <com/sun/star/awt/Toolkit.hpp>
#include <rtl/ustrbuf.hxx>
#include "inputstream.hxx"
#include <algorithm>
@@ -1208,24 +1209,17 @@ void Databases::cascadingStylesheet( const rtl::OUString& Language,
if ( aCSS.compareToAscii( "default" ) == 0 )
{
// #i50760: "default" needs to adapt HC mode
- uno::Reference< awt::XToolkit > xToolkit = uno::Reference< awt::XToolkit >(
- ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString( "com.sun.star.awt.Toolkit" ) ), uno::UNO_QUERY );
- if ( xToolkit.is() )
+ uno::Reference< awt::XToolkit2 > xToolkit =
+ awt::Toolkit::create( ::comphelper::getProcessComponentContext() );
+ uno::Reference< awt::XTopWindow > xTopWindow = xToolkit->getActiveTopWindow();
+ if ( xTopWindow.is() )
{
- uno::Reference< awt::XExtendedToolkit > xExtToolkit( xToolkit, uno::UNO_QUERY );
- if ( xExtToolkit.is() )
+ uno::Reference< awt::XVclWindowPeer > xVclWindowPeer( xTopWindow, uno::UNO_QUERY );
+ if ( xVclWindowPeer.is() )
{
- uno::Reference< awt::XTopWindow > xTopWindow = xExtToolkit->getActiveTopWindow();
- if ( xTopWindow.is() )
- {
- uno::Reference< awt::XVclWindowPeer > xVclWindowPeer( xTopWindow, uno::UNO_QUERY );
- if ( xVclWindowPeer.is() )
- {
- uno::Any aHCMode = xVclWindowPeer->getProperty( rtl::OUString( "HighContrastMode" ) );
- if ( ( aHCMode >>= bHighContrastMode ) && bHighContrastMode )
- aCSS = rtl::OUString( "highcontrastblack" );
- }
- }
+ uno::Any aHCMode = xVclWindowPeer->getProperty( rtl::OUString( "HighContrastMode" ) );
+ if ( ( aHCMode >>= bHighContrastMode ) && bHighContrastMode )
+ aCSS = rtl::OUString( "highcontrastblack" );
}
}
}