summaryrefslogtreecommitdiff
path: root/embeddedobj
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-12-11 14:59:39 +0200
committerNoel Grandin <noel@peralex.com>2012-12-13 05:20:59 +0200
commitdde234b6955a421d51d2b37e4fc3972c660146f0 (patch)
treed9f5824ccb30141c3d3742e2229b3bf83ffd116b /embeddedobj
parent37b6871fa1fb12c4b2b45db5f3e6ac583577f538 (diff)
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
Diffstat (limited to 'embeddedobj')
-rw-r--r--embeddedobj/source/general/docholder.cxx21
1 files changed, 8 insertions, 13 deletions
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 <com/sun/star/embed/EmbedStates.hpp>
#include <osl/diagnose.h>
#include <rtl/process.h>
+#include <vcl/svapp.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/namedvaluecollection.hxx>
@@ -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 );