diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-05-21 15:54:15 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-05-22 13:17:30 +0200 |
commit | c200aa27ee4a0f5a89af6e970c2c22580029eded (patch) | |
tree | 3988c0c756df2d1eb182c50ad1dc0e226d2ecf14 /svtools | |
parent | af6561532832615f39b5ea82aa5d9b3e240784e8 (diff) |
remove Size arg from Window::Draw and depend on GetSizePixel
90% of cases pass GetSizePixel as the Size arg already
and this aligns Window::Draw with how Window::PaintToDevice
works
Change-Id: If5b024179a4b7a3b099177c2f6d4b1fb006b95ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94644
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/brwbox/brwbox2.cxx | 14 | ||||
-rw-r--r-- | svtools/source/brwbox/ebbcontrols.cxx | 6 |
2 files changed, 9 insertions, 11 deletions
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx index 92cd50a2cc92..e9e725149020 100644 --- a/svtools/source/brwbox/brwbox2.cxx +++ b/svtools/source/brwbox/brwbox2.cxx @@ -631,14 +631,13 @@ void BrowseBox::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle } } - -void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, DrawFlags nFlags ) +void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) { // we need pixel coordinates - Size aRealSize = pDev->LogicToPixel(rSize); + Size aRealSize = GetSizePixel(); Point aRealPos = pDev->LogicToPixel(rPos); - if ((rSize.Width() < 3) || (rSize.Height() < 3)) + if ((aRealSize.Width() < 3) || (aRealSize.Height() < 3)) // we want to have two pixels frame ... return; @@ -712,9 +711,11 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, // the header's draw expects logic coordinates, again aHeaderPos = pDev->PixelToLogic(aHeaderPos); - aHeaderSize = pDev->PixelToLogic(aHeaderSize); - pBar->Draw(pDev, aHeaderPos, aHeaderSize, nFlags); + Size aOrigSize(pBar->GetSizePixel()); + pBar->SetSizePixel(aHeaderSize); + pBar->Draw(pDev, aHeaderPos, nFlags); + pBar->SetSizePixel(aOrigSize); // draw the "upper left cell" (the intersection between the header bar and the handle column) if (pFirstCol && (pFirstCol->GetId() == 0) && (pFirstCol->Width() > 4)) @@ -771,7 +772,6 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, pDev->Pop(); } - void BrowseBox::ImplPaintData(OutputDevice& _rOut, const tools::Rectangle& _rRect, bool _bForeignDevice) { Point aOverallAreaPos = _bForeignDevice ? _rRect.TopLeft() : Point(0,0); diff --git a/svtools/source/brwbox/ebbcontrols.cxx b/svtools/source/brwbox/ebbcontrols.cxx index 9c398823f8a1..2c6291fd3f7e 100644 --- a/svtools/source/brwbox/ebbcontrols.cxx +++ b/svtools/source/brwbox/ebbcontrols.cxx @@ -228,13 +228,11 @@ namespace svt pBox->SetZoom(GetZoom()); } - - void CheckBoxControl::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, DrawFlags nFlags ) + void CheckBoxControl::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) { - pBox->Draw(pDev,rPos,rSize,nFlags); + pBox->Draw(pDev, rPos, nFlags); } - void CheckBoxControl::GetFocus() { if (pBox) |