summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-07-20 08:19:52 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-08-02 08:13:15 +0200
commitb6b26421a1029b18b48b69dbdac4bb70fb622604 (patch)
tree97b9ab25fef28063a3de4e3a67544d2ea13a70e0 /toolkit
parentd66ffef8558785f19908c8e526211b8225fa9125 (diff)
split Point/Size/Rectangle into AbsoluteScreenPixel* types
to attempt to make it obvious in code what kind of coordinate system we are dealing with. The idea is that by doing this, the compile-time type checking will flush out inconsistencies between different code. I started with vcl::Window::OutputToAbsoluteScreenPixel and worked outwards from there. Change-Id: Ia967d7a0bb38886695f3a761b85c8b9340ddb1c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154676 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/inc/controls/table/tablecontrol.hxx2
-rw-r--r--toolkit/source/awt/vclxaccessiblecomponent.cxx6
-rw-r--r--toolkit/source/awt/vclxtoolkit.cxx2
-rw-r--r--toolkit/source/controls/table/tablecontrol.cxx2
4 files changed, 6 insertions, 6 deletions
diff --git a/toolkit/inc/controls/table/tablecontrol.hxx b/toolkit/inc/controls/table/tablecontrol.hxx
index aae87ed4cba0..9d9f98ff11e3 100644
--- a/toolkit/inc/controls/table/tablecontrol.hxx
+++ b/toolkit/inc/controls/table/tablecontrol.hxx
@@ -127,7 +127,7 @@ namespace svt::table
// IAccessibleTable
- virtual tools::Rectangle GetWindowExtentsAbsolute() const override;
+ virtual AbsoluteScreenPixelRectangle GetWindowExtentsAbsolute() const override;
virtual tools::Rectangle GetWindowExtentsRelative(const vcl::Window& rRelativeWindow) const override;
virtual void GrabFocus() override;
virtual css::uno::Reference< css::accessibility::XAccessible > GetAccessible() override;
diff --git a/toolkit/source/awt/vclxaccessiblecomponent.cxx b/toolkit/source/awt/vclxaccessiblecomponent.cxx
index 36d0451b2575..2d290e1ad5e1 100644
--- a/toolkit/source/awt/vclxaccessiblecomponent.cxx
+++ b/toolkit/source/awt/vclxaccessiblecomponent.cxx
@@ -712,12 +712,12 @@ awt::Rectangle VCLXAccessibleComponent::implGetBounds()
VclPtr<vcl::Window> pWindow = GetWindow();
if ( pWindow )
{
- tools::Rectangle aRect = pWindow->GetWindowExtentsAbsolute();
+ AbsoluteScreenPixelRectangle aRect = pWindow->GetWindowExtentsAbsolute();
aBounds = AWTRectangle( aRect );
vcl::Window* pParent = pWindow->GetAccessibleParentWindow();
if ( pParent )
{
- tools::Rectangle aParentRect = pParent->GetWindowExtentsAbsolute();
+ AbsoluteScreenPixelRectangle aParentRect = pParent->GetWindowExtentsAbsolute();
awt::Point aParentScreenLoc = AWTPoint( aParentRect.TopLeft() );
aBounds.X -= aParentScreenLoc.X;
aBounds.Y -= aParentScreenLoc.Y;
@@ -734,7 +734,7 @@ awt::Point VCLXAccessibleComponent::getLocationOnScreen( )
awt::Point aPos;
if ( GetWindow() )
{
- tools::Rectangle aRect = GetWindow()->GetWindowExtentsAbsolute();
+ AbsoluteScreenPixelRectangle aRect = GetWindow()->GetWindowExtentsAbsolute();
aPos.X = aRect.Left();
aPos.Y = aRect.Top();
}
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index c8e918c2cea3..a5e3f71386b1 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -989,7 +989,7 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::getDesktopWindow( )
css::awt::Rectangle VCLXToolkit::getWorkArea( )
{
sal_Int32 nDisplay = Application::GetDisplayBuiltInScreen();
- tools::Rectangle aWorkRect = Application::GetScreenPosSizePixel( nDisplay );
+ AbsoluteScreenPixelRectangle aWorkRect = Application::GetScreenPosSizePixel( nDisplay );
css::awt::Rectangle aNotherRect;
aNotherRect.X = aWorkRect.Left();
aNotherRect.Y = aWorkRect.Top();
diff --git a/toolkit/source/controls/table/tablecontrol.cxx b/toolkit/source/controls/table/tablecontrol.cxx
index 0ce943f1698f..42b314569e82 100644
--- a/toolkit/source/controls/table/tablecontrol.cxx
+++ b/toolkit/source/controls/table/tablecontrol.cxx
@@ -479,7 +479,7 @@ namespace svt::table
m_pImpl->commitTableEvent( i_eventID, i_newValue, i_oldValue );
}
- tools::Rectangle TableControl::GetWindowExtentsAbsolute() const
+ AbsoluteScreenPixelRectangle TableControl::GetWindowExtentsAbsolute() const
{
return Control::GetWindowExtentsAbsolute();
}