summaryrefslogtreecommitdiff
path: root/vcl/source/window
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/window')
-rw-r--r--vcl/source/window/syschild.cxx5
-rw-r--r--vcl/source/window/toolbox2.cxx7
-rw-r--r--vcl/source/window/window.cxx204
3 files changed, 101 insertions, 115 deletions
diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx
index 4022f2cefd7f..c941e2c1e084 100644
--- a/vcl/source/window/syschild.cxx
+++ b/vcl/source/window/syschild.cxx
@@ -39,7 +39,6 @@
#include <vcl/sysdata.hxx>
#include <vcl/svapp.hxx>
#include <vcl/syschild.hxx>
-#include <vcl/unohelp.hxx>
#include <window.h>
#include <salinst.hxx>
@@ -245,9 +244,9 @@ sal_IntPtr SystemChildWindow::GetParentWindowHandle( sal_Bool bUseJava )
#ifdef SOLAR_JAVA
else
{
- uno::Reference< lang::XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() );
+ uno::Reference< lang::XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory() );
- if( xFactory.is() && ( GetSystemData()->aWindow > 0 ) )
+ if( GetSystemData()->aWindow > 0 )
{
try
{
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index d7920cfe4ab7..73c1fbc4b495 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -26,7 +26,9 @@
*
************************************************************************/
+#include "sal/config.h"
+#include <comphelper/processfactory.hxx>
#include <comphelper/string.hxx>
#include <tools/debug.hxx>
#include <tools/rc.h>
@@ -37,7 +39,6 @@
#include <vcl/toolbox.hxx>
#include <vcl/mnemonic.hxx>
#include <vcl/menu.hxx>
-#include <vcl/unohelp.hxx>
#include <vcl/ImageListProvider.hxx>
#include <svdata.hxx>
@@ -2139,7 +2140,7 @@ sal_Bool ToolBox::AlwaysLocked()
nAlwaysLocked = 0; // ask configuration only once
utl::OConfigurationNode aNode = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory(
- vcl::unohelper::GetMultiServiceFactory(),
+ comphelper::getProcessServiceFactory(),
OUString("/org.openoffice.Office.UI.GlobalSettings/Toolbars") ); // note: case sensitive !
if ( aNode.isValid() )
{
@@ -2152,7 +2153,7 @@ sal_Bool ToolBox::AlwaysLocked()
{
// now read the locking state
utl::OConfigurationNode aNode2 = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory(
- vcl::unohelper::GetMultiServiceFactory(),
+ comphelper::getProcessServiceFactory(),
OUString("/org.openoffice.Office.UI.GlobalSettings/Toolbars/States") ); // note: case sensitive !
sal_Bool bLocked = sal_Bool();
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index b154eab540a7..2663644579c0 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -36,7 +36,6 @@
#include "unotools/confignode.hxx"
#include "vcl/layout.hxx"
-#include "vcl/unohelp.hxx"
#include "vcl/salgtype.hxx"
#include "vcl/event.hxx"
#include "vcl/help.hxx"
@@ -486,7 +485,7 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl
{
sal_Bool bTmp = sal_False, bAutoHCMode = sal_True;
utl::OConfigurationNode aNode = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory(
- vcl::unohelper::GetMultiServiceFactory(),
+ comphelper::getProcessServiceFactory(),
OUString("org.openoffice.Office.Common/Accessibility") ); // note: case sensitive !
if ( aNode.isValid() )
{
@@ -8355,55 +8354,52 @@ uno::Reference< XDragSource > Window::GetDragSource()
{
try
{
- uno::Reference< XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory();
- if ( xFactory.is() )
- {
- const SystemEnvData * pEnvData = GetSystemData();
+ uno::Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
+ const SystemEnvData * pEnvData = GetSystemData();
- if( pEnvData )
- {
- Sequence< Any > aDragSourceAL( 2 ), aDropTargetAL( 2 );
- OUString aDragSourceSN, aDropTargetSN;
+ if( pEnvData )
+ {
+ Sequence< Any > aDragSourceAL( 2 ), aDropTargetAL( 2 );
+ OUString aDragSourceSN, aDropTargetSN;
#if defined WNT
- aDragSourceSN = OUString("com.sun.star.datatransfer.dnd.OleDragSource");
- aDropTargetSN = OUString("com.sun.star.datatransfer.dnd.OleDropTarget");
- aDragSourceAL[ 1 ] = makeAny( (sal_uInt32) pEnvData->hWnd );
- aDropTargetAL[ 0 ] = makeAny( (sal_uInt32) pEnvData->hWnd );
+ aDragSourceSN = OUString("com.sun.star.datatransfer.dnd.OleDragSource");
+ aDropTargetSN = OUString("com.sun.star.datatransfer.dnd.OleDropTarget");
+ aDragSourceAL[ 1 ] = makeAny( (sal_uInt32) pEnvData->hWnd );
+ aDropTargetAL[ 0 ] = makeAny( (sal_uInt32) pEnvData->hWnd );
#elif defined QUARTZ
/* FIXME: Mac OS X specific dnd interface does not exist! *
* Using Windows based dnd as a temporary solution */
- aDragSourceSN = OUString("com.sun.star.datatransfer.dnd.OleDragSource");
- aDropTargetSN = OUString("com.sun.star.datatransfer.dnd.OleDropTarget");
- aDragSourceAL[ 1 ] = makeAny( static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->pView) ) );
- aDropTargetAL[ 0 ] = makeAny( static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->pView) ) );
+ aDragSourceSN = OUString("com.sun.star.datatransfer.dnd.OleDragSource");
+ aDropTargetSN = OUString("com.sun.star.datatransfer.dnd.OleDropTarget");
+ aDragSourceAL[ 1 ] = makeAny( static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->pView) ) );
+ aDropTargetAL[ 0 ] = makeAny( static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->pView) ) );
#elif defined IOS
/* What does LibreOffice's use of DND concepts mean on
* iOS, huh, is this both inter-app DND (which clearly is
* meaningless), or intra-app? Anyway, use the same code
* as for MacOSX for now, even if meaningless...
*/
- aDragSourceSN = OUString("com.sun.star.datatransfer.dnd.OleDragSource");
- aDropTargetSN = OUString("com.sun.star.datatransfer.dnd.OleDropTarget");
- aDragSourceAL[ 1 ] = makeAny( static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->pView) ) );
- aDropTargetAL[ 0 ] = makeAny( static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->pView) ) );
+ aDragSourceSN = OUString("com.sun.star.datatransfer.dnd.OleDragSource");
+ aDropTargetSN = OUString("com.sun.star.datatransfer.dnd.OleDropTarget");
+ aDragSourceAL[ 1 ] = makeAny( static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->pView) ) );
+ aDropTargetAL[ 0 ] = makeAny( static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->pView) ) );
#elif defined UNX
- aDropTargetAL.realloc( 3 );
- aDragSourceAL.realloc( 3 );
- aDragSourceSN = OUString("com.sun.star.datatransfer.dnd.X11DragSource");
- aDropTargetSN = OUString("com.sun.star.datatransfer.dnd.X11DropTarget");
-
- aDragSourceAL[ 0 ] = makeAny( Application::GetDisplayConnection() );
- aDragSourceAL[ 2 ] = makeAny( vcl::createBmpConverter() );
- aDropTargetAL[ 0 ] = makeAny( Application::GetDisplayConnection() );
- aDropTargetAL[ 1 ] = makeAny( (sal_Size)(pEnvData->aShellWindow) );
- aDropTargetAL[ 2 ] = makeAny( vcl::createBmpConverter() );
+ aDropTargetAL.realloc( 3 );
+ aDragSourceAL.realloc( 3 );
+ aDragSourceSN = OUString("com.sun.star.datatransfer.dnd.X11DragSource");
+ aDropTargetSN = OUString("com.sun.star.datatransfer.dnd.X11DropTarget");
+
+ aDragSourceAL[ 0 ] = makeAny( Application::GetDisplayConnection() );
+ aDragSourceAL[ 2 ] = makeAny( vcl::createBmpConverter() );
+ aDropTargetAL[ 0 ] = makeAny( Application::GetDisplayConnection() );
+ aDropTargetAL[ 1 ] = makeAny( (sal_Size)(pEnvData->aShellWindow) );
+ aDropTargetAL[ 2 ] = makeAny( vcl::createBmpConverter() );
#endif
- if( !aDragSourceSN.isEmpty() )
- mpWindowImpl->mpFrameData->mxDragSource = uno::Reference< XDragSource > ( xFactory->createInstanceWithArguments( aDragSourceSN, aDragSourceAL ), UNO_QUERY );
+ if( !aDragSourceSN.isEmpty() )
+ mpWindowImpl->mpFrameData->mxDragSource = uno::Reference< XDragSource > ( xFactory->createInstanceWithArguments( aDragSourceSN, aDragSourceAL ), UNO_QUERY );
- if( !aDropTargetSN.isEmpty() )
- mpWindowImpl->mpFrameData->mxDropTarget = uno::Reference< XDropTarget > ( xFactory->createInstanceWithArguments( aDropTargetSN, aDropTargetAL ), UNO_QUERY );
- }
+ if( !aDropTargetSN.isEmpty() )
+ mpWindowImpl->mpFrameData->mxDropTarget = uno::Reference< XDropTarget > ( xFactory->createInstanceWithArguments( aDropTargetSN, aDropTargetAL ), UNO_QUERY );
}
}
@@ -8441,32 +8437,29 @@ uno::Reference< XClipboard > Window::GetClipboard()
{
try
{
- uno::Reference< XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() );
+ uno::Reference< XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory() );
- if( xFactory.is() )
- {
- mpWindowImpl->mpFrameData->mxClipboard = uno::Reference< XClipboard >( xFactory->createInstance( OUString("com.sun.star.datatransfer.clipboard.SystemClipboardExt") ), UNO_QUERY );
+ mpWindowImpl->mpFrameData->mxClipboard = uno::Reference< XClipboard >( xFactory->createInstance( OUString("com.sun.star.datatransfer.clipboard.SystemClipboardExt") ), UNO_QUERY );
- if( !mpWindowImpl->mpFrameData->mxClipboard.is() )
- mpWindowImpl->mpFrameData->mxClipboard = uno::Reference< XClipboard >( xFactory->createInstance( OUString("com.sun.star.datatransfer.clipboard.SystemClipboard") ), UNO_QUERY );
+ if( !mpWindowImpl->mpFrameData->mxClipboard.is() )
+ mpWindowImpl->mpFrameData->mxClipboard = uno::Reference< XClipboard >( xFactory->createInstance( OUString("com.sun.star.datatransfer.clipboard.SystemClipboard") ), UNO_QUERY );
#if defined(UNX) && !defined(QUARTZ) // unix clipboard needs to be initialized
- if( mpWindowImpl->mpFrameData->mxClipboard.is() )
- {
- uno::Reference< XInitialization > xInit = uno::Reference< XInitialization >( mpWindowImpl->mpFrameData->mxClipboard, UNO_QUERY );
+ if( mpWindowImpl->mpFrameData->mxClipboard.is() )
+ {
+ uno::Reference< XInitialization > xInit = uno::Reference< XInitialization >( mpWindowImpl->mpFrameData->mxClipboard, UNO_QUERY );
- if( xInit.is() )
- {
- Sequence< Any > aArgumentList( 3 );
- aArgumentList[ 0 ] = makeAny( Application::GetDisplayConnection() );
- aArgumentList[ 1 ] = makeAny( OUString("CLIPBOARD") );
- aArgumentList[ 2 ] = makeAny( vcl::createBmpConverter() );
+ if( xInit.is() )
+ {
+ Sequence< Any > aArgumentList( 3 );
+ aArgumentList[ 0 ] = makeAny( Application::GetDisplayConnection() );
+ aArgumentList[ 1 ] = makeAny( OUString("CLIPBOARD") );
+ aArgumentList[ 2 ] = makeAny( vcl::createBmpConverter() );
- xInit->initialize( aArgumentList );
- }
+ xInit->initialize( aArgumentList );
}
-#endif
}
+#endif
}
// createInstance can throw any exception
@@ -8495,30 +8488,27 @@ uno::Reference< XClipboard > Window::GetPrimarySelection()
{
try
{
- uno::Reference< XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() );
+ uno::Reference< XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory() );
- if( xFactory.is() )
- {
#if defined(UNX) && !defined(QUARTZ)
- Sequence< Any > aArgumentList( 3 );
- aArgumentList[ 0 ] = makeAny( Application::GetDisplayConnection() );
- aArgumentList[ 1 ] = makeAny( OUString("PRIMARY") );
- aArgumentList[ 2 ] = makeAny( vcl::createBmpConverter() );
+ Sequence< Any > aArgumentList( 3 );
+ aArgumentList[ 0 ] = makeAny( Application::GetDisplayConnection() );
+ aArgumentList[ 1 ] = makeAny( OUString("PRIMARY") );
+ aArgumentList[ 2 ] = makeAny( vcl::createBmpConverter() );
- mpWindowImpl->mpFrameData->mxSelection = uno::Reference< XClipboard >( xFactory->createInstanceWithArguments(
- OUString("com.sun.star.datatransfer.clipboard.SystemClipboard"), aArgumentList ), UNO_QUERY );
+ mpWindowImpl->mpFrameData->mxSelection = uno::Reference< XClipboard >( xFactory->createInstanceWithArguments(
+ OUString("com.sun.star.datatransfer.clipboard.SystemClipboard"), aArgumentList ), UNO_QUERY );
# else
- static uno::Reference< XClipboard > s_xSelection;
+ static uno::Reference< XClipboard > s_xSelection;
- if ( !s_xSelection.is() )
- s_xSelection = uno::Reference< XClipboard >( xFactory->createInstance( OUString("com.sun.star.datatransfer.clipboard.GenericClipboardExt") ), UNO_QUERY );
+ if ( !s_xSelection.is() )
+ s_xSelection = uno::Reference< XClipboard >( xFactory->createInstance( OUString("com.sun.star.datatransfer.clipboard.GenericClipboardExt") ), UNO_QUERY );
- if ( !s_xSelection.is() )
- s_xSelection = uno::Reference< XClipboard >( xFactory->createInstance( OUString("com.sun.star.datatransfer.clipboard.GenericClipboard") ), UNO_QUERY );
+ if ( !s_xSelection.is() )
+ s_xSelection = uno::Reference< XClipboard >( xFactory->createInstance( OUString("com.sun.star.datatransfer.clipboard.GenericClipboard") ), UNO_QUERY );
- mpWindowImpl->mpFrameData->mxSelection = s_xSelection;
+ mpWindowImpl->mpFrameData->mxSelection = s_xSelection;
# endif
- }
}
// createInstance can throw any exception
@@ -9451,54 +9441,50 @@ uno::Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscr
const_cast<Window*>(this)->GetComponentInterface(),
uno::UNO_QUERY ));
- uno::Reference< XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory();
+ uno::Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
// Create canvas instance with window handle
// =========================================
- if ( xFactory.is() )
- {
- static ::vcl::DeleteUnoReferenceOnDeinit<lang::XMultiServiceFactory> xStaticCanvasFactory(
- uno::Reference<lang::XMultiServiceFactory>(
- xFactory->createInstance(
- OUString( "com.sun.star.rendering.CanvasFactory" ) ),
- UNO_QUERY ));
- uno::Reference<lang::XMultiServiceFactory> xCanvasFactory(xStaticCanvasFactory.get());
+ static ::vcl::DeleteUnoReferenceOnDeinit<lang::XMultiServiceFactory> xStaticCanvasFactory(
+ uno::Reference<lang::XMultiServiceFactory>(
+ xFactory->createInstance(
+ OUString( "com.sun.star.rendering.CanvasFactory" ) ),
+ UNO_QUERY ));
+ uno::Reference<lang::XMultiServiceFactory> xCanvasFactory(xStaticCanvasFactory.get());
- if(xCanvasFactory.is())
- {
+ if(xCanvasFactory.is())
+ {
#ifdef WNT
- // see #140456# - if we're running on a multiscreen setup,
- // request special, multi-screen safe sprite canvas
- // implementation (not DX5 canvas, as it cannot cope with
- // surfaces spanning multiple displays). Note: canvas
- // (without sprite) stays the same)
- const sal_uInt32 nDisplay = static_cast< WinSalFrame* >( mpWindowImpl->mpFrame )->mnDisplay;
- if( (nDisplay >= Application::GetScreenCount()) )
- {
- xCanvas.set( xCanvasFactory->createInstanceWithArguments(
- bSpriteCanvas ?
- OUString( "com.sun.star.rendering.SpriteCanvas.MultiScreen" ) :
- OUString( "com.sun.star.rendering.Canvas" ),
- aArg ),
- UNO_QUERY );
-
- }
- else
- {
+ // see #140456# - if we're running on a multiscreen setup,
+ // request special, multi-screen safe sprite canvas
+ // implementation (not DX5 canvas, as it cannot cope with
+ // surfaces spanning multiple displays). Note: canvas
+ // (without sprite) stays the same)
+ const sal_uInt32 nDisplay = static_cast< WinSalFrame* >( mpWindowImpl->mpFrame )->mnDisplay;
+ if( (nDisplay >= Application::GetScreenCount()) )
+ {
+ xCanvas.set( xCanvasFactory->createInstanceWithArguments(
+ bSpriteCanvas ?
+ OUString( "com.sun.star.rendering.SpriteCanvas.MultiScreen" ) :
+ OUString( "com.sun.star.rendering.Canvas" ),
+ aArg ),
+ UNO_QUERY );
+ }
+ else
+ {
#endif
- xCanvas.set( xCanvasFactory->createInstanceWithArguments(
- bSpriteCanvas ?
- OUString( "com.sun.star.rendering.SpriteCanvas" ) :
- OUString( "com.sun.star.rendering.Canvas" ),
- aArg ),
- UNO_QUERY );
+ xCanvas.set( xCanvasFactory->createInstanceWithArguments(
+ bSpriteCanvas ?
+ OUString( "com.sun.star.rendering.SpriteCanvas" ) :
+ OUString( "com.sun.star.rendering.Canvas" ),
+ aArg ),
+ UNO_QUERY );
#ifdef WNT
- }
+ }
#endif
- mpWindowImpl->mxCanvas = xCanvas;
- }
+ mpWindowImpl->mxCanvas = xCanvas;
}
// no factory??? Empty reference, then.