summaryrefslogtreecommitdiff
path: root/vcl/source/control
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 /vcl/source/control
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 'vcl/source/control')
-rw-r--r--vcl/source/control/combobox.cxx4
-rw-r--r--vcl/source/control/listbox.cxx8
2 files changed, 6 insertions, 6 deletions
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index fb610c116767..05b7a50006b9 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -1458,8 +1458,8 @@ tools::Long ComboBox::GetIndexForPoint( const Point& rPoint, sal_Int32& rPos ) c
// convert coordinates to ImplListBoxWindow pixel coordinate space
Point aConvPoint = LogicToPixel( rPoint );
- aConvPoint = OutputToAbsoluteScreenPixel( aConvPoint );
- aConvPoint = rMain->AbsoluteScreenToOutputPixel( aConvPoint );
+ AbsoluteScreenPixelPoint aConvPointAbs = OutputToAbsoluteScreenPixel( aConvPoint );
+ aConvPoint = rMain->AbsoluteScreenToOutputPixel( aConvPointAbs );
aConvPoint = rMain->PixelToLogic( aConvPoint );
// try to find entry
diff --git a/vcl/source/control/listbox.cxx b/vcl/source/control/listbox.cxx
index 79b971636125..7e87ae390185 100644
--- a/vcl/source/control/listbox.cxx
+++ b/vcl/source/control/listbox.cxx
@@ -661,8 +661,8 @@ tools::Long ListBox::GetIndexForPoint( const Point& rPoint, sal_Int32& rPos ) co
// Convert coordinates to ImplListBoxWindow pixel coordinate space
Point aConvPoint = LogicToPixel( rPoint );
- aConvPoint = OutputToAbsoluteScreenPixel( aConvPoint );
- aConvPoint = rMain->AbsoluteScreenToOutputPixel( aConvPoint );
+ AbsoluteScreenPixelPoint aConvPointAbs = OutputToAbsoluteScreenPixel( aConvPoint );
+ aConvPoint = rMain->AbsoluteScreenToOutputPixel( aConvPointAbs );
aConvPoint = rMain->PixelToLogic( aConvPoint );
// Try to find entry
@@ -674,8 +674,8 @@ tools::Long ListBox::GetIndexForPoint( const Point& rPoint, sal_Int32& rPos ) co
{
// Convert to impl window pixel coordinates
aConvPoint = LogicToPixel( rPoint );
- aConvPoint = OutputToAbsoluteScreenPixel( aConvPoint );
- aConvPoint = mpImplWin->AbsoluteScreenToOutputPixel( aConvPoint );
+ aConvPointAbs = OutputToAbsoluteScreenPixel( aConvPoint );
+ aConvPoint = mpImplWin->AbsoluteScreenToOutputPixel( aConvPointAbs );
// Check whether converted point is inside impl window
Size aImplWinSize = mpImplWin->GetOutputSizePixel();