summaryrefslogtreecommitdiff
path: root/framework
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 /framework
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 'framework')
-rw-r--r--framework/inc/services.h1
-rw-r--r--framework/inc/services/layoutmanager.hxx1
-rw-r--r--framework/source/layoutmanager/layoutmanager.cxx19
3 files changed, 4 insertions, 17 deletions
diff --git a/framework/inc/services.h b/framework/inc/services.h
index 7ab2c837895a..e815122c3138 100644
--- a/framework/inc/services.h
+++ b/framework/inc/services.h
@@ -80,7 +80,6 @@ namespace framework{
#define SERVICENAME_STRINGABBREVIATION DECLARE_ASCII("com.sun.star.util.UriAbbreviation" )
#define SERVICENAME_IMAGEMANAGER DECLARE_ASCII("com.sun.star.ui.ImageManager" )
#define SERVICENAME_TABWINDOWSERVICE DECLARE_ASCII("com.sun.star.ui.dialogs.TabContainerWindow" )
-#define SERVICENAME_DISPLAYACCESS DECLARE_ASCII("com.sun.star.awt.DisplayAccess" )
#define SERVICENAME_PANELFACTORY DECLARE_ASCII("com.sun.star.ui.PanelFactory" )
#define SERVICENAME_MODELWINSERVICE DECLARE_ASCII("com.sun.star.ui.ModelWinService" )
diff --git a/framework/inc/services/layoutmanager.hxx b/framework/inc/services/layoutmanager.hxx
index 9e813a73cfc8..e45794caae11 100644
--- a/framework/inc/services/layoutmanager.hxx
+++ b/framework/inc/services/layoutmanager.hxx
@@ -286,7 +286,6 @@ namespace framework
css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR; /** reference to factory, which has created this instance. */
css::uno::Reference< css::util::XURLTransformer > m_xURLTransformer;
- css::uno::Reference< css::container::XIndexAccess > m_xDisplayAccess;
css::uno::Reference< css::frame::XFrame > m_xFrame;
css::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > m_xModuleCfgMgr;
css::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > m_xDocCfgMgr;
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index a91642888977..ece410cc8432 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -113,7 +113,6 @@ LayoutManager::LayoutManager( const Reference< XMultiServiceFactory >& xServiceM
, LayoutManager_PBase( *(static_cast< ::cppu::OBroadcastHelper* >(this)) )
, m_xSMGR( xServiceManager )
, m_xURLTransformer( URLTransformer::create(::comphelper::getComponentContext(xServiceManager)) )
- , m_xDisplayAccess( xServiceManager->createInstance( SERVICENAME_DISPLAYACCESS ), UNO_QUERY )
, m_nLockCount( 0 )
, m_bActive( false )
, m_bInplaceMenuSet( false )
@@ -2472,25 +2471,15 @@ sal_Bool LayoutManager::implts_resizeContainerWindow( const awt::Size& rContaine
Reference< awt::XWindow > xContainerWindow = m_xContainerWindow;
Reference< awt::XTopWindow2 > xContainerTopWindow = m_xContainerTopWindow;
Reference< awt::XWindow > xComponentWindow = m_xFrame->getComponentWindow();
- Reference< container::XIndexAccess > xDisplayAccess = m_xDisplayAccess;
aReadLock.unlock();
// calculate the maximum size we have for the container window
- awt::Rectangle aWorkArea;
- try
- {
- sal_Int32 nDisplay = xContainerTopWindow->getDisplay();
- Reference< beans::XPropertySet > xDisplayInfo( xDisplayAccess->getByIndex( nDisplay ), UNO_QUERY_THROW );
- OSL_VERIFY( xDisplayInfo->getPropertyValue( ::rtl::OUString( "WorkArea" ) ) >>= aWorkArea );
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
+ sal_Int32 nDisplay = xContainerTopWindow->getDisplay();
+ Rectangle aWorkArea = Application::GetWorkAreaPosSizePixel( nDisplay );
- if (( aWorkArea.Width > 0 ) && ( aWorkArea.Height > 0 ))
+ if (( aWorkArea.GetWidth() > 0 ) && ( aWorkArea.GetHeight() > 0 ))
{
- if (( rContainerSize.Width > aWorkArea.Width ) || ( rContainerSize.Height > aWorkArea.Height ))
+ if (( rContainerSize.Width > aWorkArea.GetWidth() ) || ( rContainerSize.Height > aWorkArea.GetHeight() ))
return sal_False;
// Strictly, this is not correct. If we have a multi-screen display (css.awt.DisplayAccess.MultiDisplay == true),
// the the "effective work area" would be much larger than the work area of a single display, since we could in theory