diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-07-20 08:19:52 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-08-02 08:13:15 +0200 |
commit | b6b26421a1029b18b48b69dbdac4bb70fb622604 (patch) | |
tree | 97b9ab25fef28063a3de4e3a67544d2ea13a70e0 /svtools | |
parent | d66ffef8558785f19908c8e526211b8225fa9125 (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 'svtools')
-rw-r--r-- | svtools/source/brwbox/brwbox2.cxx | 6 | ||||
-rw-r--r-- | svtools/source/brwbox/brwbox3.cxx | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx index 5174de54d1ef..33f0990de6e9 100644 --- a/svtools/source/brwbox/brwbox2.cxx +++ b/svtools/source/brwbox/brwbox2.cxx @@ -1966,7 +1966,7 @@ tools::Rectangle BrowseBox::calcHeaderRect(bool _bIsColumnBar, bool _bOnScreen) if (pParent) aTopLeft += GetWindowExtentsRelative( *pParent ).TopLeft(); else - aTopLeft += GetWindowExtentsAbsolute().TopLeft(); + aTopLeft += Point(GetWindowExtentsAbsolute().TopLeft()); return tools::Rectangle(aTopLeft,Size(nWidth,nHeight)); } @@ -1980,7 +1980,7 @@ tools::Rectangle BrowseBox::calcTableRect(bool _bOnScreen) if (pParent) aRect = GetWindowExtentsRelative( *pParent ); else - aRect = GetWindowExtentsAbsolute(); + aRect = tools::Rectangle(GetWindowExtentsAbsolute()); tools::Rectangle aRowBar = calcHeaderRect(false, pParent == nullptr); tools::Long nX = aRowBar.Right() - aRect.Left(); @@ -2002,7 +2002,7 @@ tools::Rectangle BrowseBox::GetFieldRectPixel( sal_Int32 _nRowId, sal_uInt16 _nC if (pParent) aTopLeft += GetWindowExtentsRelative( *pParent ).TopLeft(); else - aTopLeft += GetWindowExtentsAbsolute().TopLeft(); + aTopLeft += Point(GetWindowExtentsAbsolute().TopLeft()); return tools::Rectangle(aTopLeft,aRect.GetSize()); } diff --git a/svtools/source/brwbox/brwbox3.cxx b/svtools/source/brwbox/brwbox3.cxx index 4a1263d66e2b..4a5a8531e6ac 100644 --- a/svtools/source/brwbox/brwbox3.cxx +++ b/svtools/source/brwbox/brwbox3.cxx @@ -531,7 +531,7 @@ bool BrowseBox::GetGlyphBoundRects( const Point& rOrigin, const OUString& rStr, return GetOutDev()->GetGlyphBoundRects( rOrigin, rStr, nIndex, nLen, rVector ); } -tools::Rectangle BrowseBox::GetWindowExtentsAbsolute() const +AbsoluteScreenPixelRectangle BrowseBox::GetWindowExtentsAbsolute() const { return Control::GetWindowExtentsAbsolute(); } |