diff options
Diffstat (limited to 'vcl/win/source/window/salframe.cxx')
-rw-r--r-- | vcl/win/source/window/salframe.cxx | 41 |
1 files changed, 14 insertions, 27 deletions
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index f2110d54677b..b673c463f59b 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -783,40 +783,27 @@ static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame, try { - uno::Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW ); - uno::Reference< XIndexAccess > xMultiMon( xFactory->createInstance( "com.sun.star.awt.DisplayAccess" ), UNO_QUERY_THROW ); - sal_Int32 nMonitors = xMultiMon->getCount(); + sal_Int32 nMonitors = Application::GetScreenCount(); if( (pFrame->mnDisplay >= 0) && (pFrame->mnDisplay < nMonitors) ) { - uno::Reference< XPropertySet > xMonitor( xMultiMon->getByIndex( pFrame->mnDisplay ), UNO_QUERY_THROW ); - com::sun::star::awt::Rectangle aRect; - if( xMonitor->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "ScreenArea" ) ) ) >>= aRect ) - { - nScreenX = aRect.X; - nScreenY = aRect.Y; - nScreenDX = aRect.Width+1; // difference between java/awt convention and vcl - nScreenDY = aRect.Height+1; // difference between java/awt convention and vcl - } + com::sun::star::awt::Rectangle aRect = Application::GetScreenPosSizePixel( pFrame->mnDisplay ); + nScreenX = aRect.X; + nScreenY = aRect.Y; + nScreenDX = aRect.Width+1; // difference between java/awt convention and vcl + nScreenDY = aRect.Height+1; // difference between java/awt convention and vcl } else { Rectangle aCombined; - uno::Reference< XPropertySet > xMonitor( xMultiMon->getByIndex( 0 ), UNO_QUERY_THROW ); - com::sun::star::awt::Rectangle aRect; - if( xMonitor->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "ScreenArea" ) ) ) >>= aRect ) + com::sun::star::awt::Rectangle aRect = Application::GetScreenPosSizePixel( 0 ); + aCombined.Left() = aRect.X; + aCombined.Top() = aRect.Y; + aCombined.Right() = aRect.X + aRect.Width; + aCombined.Bottom() = aRect.Y + aRect.Height; + for( sal_Int32 i = 1 ; i < nMonitors ; i++ ) { - aCombined.Left() = aRect.X; - aCombined.Top() = aRect.Y; - aCombined.Right() = aRect.X + aRect.Width; - aCombined.Bottom() = aRect.Y + aRect.Height; - for( sal_Int32 i = 1 ; i < nMonitors ; i++ ) - { - xMonitor = uno::Reference< XPropertySet >( xMultiMon->getByIndex(i), UNO_QUERY_THROW ); - if( xMonitor->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "ScreenArea" ) ) ) >>= aRect ) - { - aCombined.Union( Rectangle( aRect.X, aRect.Y, aRect.X+aRect.Width, aRect.Y+aRect.Height ) ); - } - } + aRect = Application::GetScreenPosSizePixel( i ); + aCombined.Union( Rectangle( aRect.X, aRect.Y, aRect.X+aRect.Width, aRect.Y+aRect.Height ) ); } nScreenX = aCombined.Left(); nScreenY = aCombined.Top(); |