summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-08-13 16:44:15 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-08-16 15:53:02 +0200
commit581b2cf7960c48e6199bd35be839424113abe533 (patch)
tree5f5d0f4cf0be4d134804cea9738460e92a61e11c /framework
parent76f89b0097c02fa68c36cfc9a31de3b2e9166abc (diff)
Drop tools::Rectangle::getX/getY, which are just duplicates of Left/Top
The change allowed to simplify many places where previously this API was used, to avoid inefficient calculations (e.g., moving rectangle keeping its size, and then immediately changing the size). Change-Id: Ica2dc594d91cae83e2c2740c1f4fb23f44998916 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120461 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'framework')
-rw-r--r--framework/source/layoutmanager/helpers.cxx8
-rw-r--r--framework/source/layoutmanager/helpers.hxx1
-rw-r--r--framework/source/layoutmanager/layoutmanager.cxx6
-rw-r--r--framework/source/layoutmanager/toolbarlayoutmanager.cxx5
4 files changed, 3 insertions, 17 deletions
diff --git a/framework/source/layoutmanager/helpers.cxx b/framework/source/layoutmanager/helpers.cxx
index f5fe1fc48f44..f9b319f4e19e 100644
--- a/framework/source/layoutmanager/helpers.cxx
+++ b/framework/source/layoutmanager/helpers.cxx
@@ -127,14 +127,6 @@ SystemWindow* getTopSystemWindow( const uno::Reference< awt::XWindow >& xWindow
return nullptr;
}
-void setZeroRectangle( ::tools::Rectangle& rRect )
-{
- rRect.setX(0);
- rRect.setY(0);
- rRect.setWidth(0);
- rRect.setHeight(0);
-}
-
// ATTENTION!
// This value is directly copied from the sfx2 project.
// You have to change BOTH values, see sfx2/inc/sfx2/sfxsids.hrc (SID_DOCKWIN_START)
diff --git a/framework/source/layoutmanager/helpers.hxx b/framework/source/layoutmanager/helpers.hxx
index df8c75d85a52..ffa1443eaf4e 100644
--- a/framework/source/layoutmanager/helpers.hxx
+++ b/framework/source/layoutmanager/helpers.hxx
@@ -49,7 +49,6 @@ ToolBox* getToolboxPtr( vcl::Window* pWindow );
vcl::Window* getWindowFromXUIElement( const css::uno::Reference< css::ui::XUIElement >& xUIElement );
SystemWindow* getTopSystemWindow( const css::uno::Reference< css::awt::XWindow >& xWindow );
bool equalRectangles( const css::awt::Rectangle& rRect1, const css::awt::Rectangle& rRect2 );
-void setZeroRectangle( ::tools::Rectangle& rRect );
bool lcl_checkUIElement(const css::uno::Reference< css::ui::XUIElement >& xUIElement,css::awt::Rectangle& _rPosSize, css::uno::Reference< css::awt::XWindow >& _xWindow);
css::uno::Reference< css::awt::XWindowPeer > createToolkitWindow( const css::uno::Reference< css::uno::XComponentContext >& rxContext, const css::uno::Reference< css::awt::XWindowPeer >& rParent, const char* pService );
WindowAlign ImplConvertAlignment( css::ui::DockingArea aAlignment );
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index b46db52906ff..2d76f8eaf378 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -1140,12 +1140,8 @@ bool LayoutManager::implts_hideStatusBar( bool bStoreState )
void LayoutManager::implts_setOffset( const sal_Int32 nBottomOffset )
{
- ::tools::Rectangle aOffsetRect;
- setZeroRectangle( aOffsetRect );
- aOffsetRect.setHeight( nBottomOffset );
-
if ( m_xToolbarManager.is() )
- m_xToolbarManager->setDockingAreaOffsets( aOffsetRect );
+ m_xToolbarManager->setDockingAreaOffsets({ 0, 0, 0, nBottomOffset });
}
void LayoutManager::implts_setInplaceMenuBar( const Reference< XIndexAccess >& xMergedMenuBar )
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
index a994cf36f292..f0dc6025649f 100644
--- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
@@ -57,6 +57,8 @@ ToolbarLayoutManager::ToolbarLayoutManager(
m_xContext( rxContext),
m_xUIElementFactoryManager( xUIElementFactory ),
m_pParentLayouter( pParentLayouter ),
+ m_aDockingArea(0, 0, 0, 0),
+ m_aDockingAreaOffsets(0, 0, 0, 0),
m_eDockOperation( DOCKOP_ON_COLROW ),
m_ePreviewDetection( PREVIEWFRAME_UNKNOWN ),
m_bComponentAttached( false ),
@@ -66,9 +68,6 @@ ToolbarLayoutManager::ToolbarLayoutManager(
m_bLayoutInProgress( false ),
m_bToolbarCreation( false )
{
- // initialize rectangles to zero values
- setZeroRectangle( m_aDockingAreaOffsets );
- setZeroRectangle( m_aDockingArea );
}
ToolbarLayoutManager::~ToolbarLayoutManager()