summaryrefslogtreecommitdiff
path: root/framework
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 /framework
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 'framework')
-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
15 files changed, 80 insertions, 101 deletions
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>