From dde234b6955a421d51d2b37e4fc3972c660146f0 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 11 Dec 2012 14:59:39 +0200 Subject: fdo#46808, remove awt::DisplayAccess service. This service was never documented in an IDL file. All it did was provide a wrapper around some VCL module API. Now that we can link the VCL stuff into SD and SDEXT, just access the API directly. Change-Id: Ic0ba34c2bca797baa7319878d98cfe3a4ec59d4d --- embeddedobj/source/general/docholder.cxx | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'embeddedobj') diff --git a/embeddedobj/source/general/docholder.cxx b/embeddedobj/source/general/docholder.cxx index c7e63d86ee03..f30eb5e1a6b0 100644 --- a/embeddedobj/source/general/docholder.cxx +++ b/embeddedobj/source/general/docholder.cxx @@ -64,6 +64,7 @@ #include #include #include +#include #include #include @@ -910,26 +911,20 @@ uno::Reference< frame::XFrame > DocumentHolder::GetDocFrame() if( xHWindow.is() ) { - uno::Reference< beans::XPropertySet > xMonProps( m_xFactory->createInstance(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.DisplayAccess" ) ) ), uno::UNO_QUERY_THROW ); - const rtl::OUString sPropName( RTL_CONSTASCII_USTRINGPARAM( "DefaultDisplay" ) ); - sal_Int32 nDisplay = 0; - xMonProps->getPropertyValue( sPropName ) >>= nDisplay; - - uno::Reference< container::XIndexAccess > xMultiMon( xMonProps, uno::UNO_QUERY_THROW ); - uno::Reference< beans::XPropertySet > xMonitor( xMultiMon->getByIndex( nDisplay ), uno::UNO_QUERY_THROW ); - awt::Rectangle aWorkRect; - xMonitor->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WorkArea" ) ) ) >>= aWorkRect; + sal_Int32 nDisplay = Application::GetDisplayBuiltInScreen(); + + Rectangle aWorkRect = Application::GetWorkAreaPosSizePixel( nDisplay ); awt::Rectangle aWindowRect = xHWindow->getPosSize(); - if (( aWindowRect.Width < aWorkRect.Width) && ( aWindowRect.Height < aWorkRect.Height )) + if (( aWindowRect.Width < aWorkRect.GetWidth()) && ( aWindowRect.Height < aWorkRect.GetHeight() )) { - int OffsetX = ( aWorkRect.Width - aWindowRect.Width ) / 2 + aWorkRect.X; - int OffsetY = ( aWorkRect.Height - aWindowRect.Height ) /2 + aWorkRect.Y; + int OffsetX = ( aWorkRect.GetWidth() - aWindowRect.Width ) / 2 + aWorkRect.Left(); + int OffsetY = ( aWorkRect.GetHeight() - aWindowRect.Height ) /2 + aWorkRect.Top(); xHWindow->setPosSize( OffsetX, OffsetY, aWindowRect.Width, aWindowRect.Height, awt::PosSize::POS ); } else { - xHWindow->setPosSize( aWorkRect.X, aWorkRect.Y, aWorkRect.Width, aWorkRect.Height, awt::PosSize::POSSIZE ); + xHWindow->setPosSize( aWorkRect.Left(), aWorkRect.Top(), aWorkRect.GetWidth(), aWorkRect.GetHeight(), awt::PosSize::POSSIZE ); } xHWindow->setVisible( sal_True ); -- cgit