From c200aa27ee4a0f5a89af6e970c2c22580029eded Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 21 May 2020 15:54:15 +0100 Subject: remove Size arg from Window::Draw and depend on GetSizePixel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- vcl/source/control/edit.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'vcl/source/control/edit.cxx') diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 3f8cbaffb36d..fe79d666f68a 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -1733,12 +1733,12 @@ void Edit::Resize() } } -void Edit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, DrawFlags nFlags ) +void Edit::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) { ApplySettings(*pDev); Point aPos = pDev->LogicToPixel( rPos ); - Size aSize = pDev->LogicToPixel( rSize ); + Size aSize = GetSizePixel(); vcl::Font aFont = GetDrawPixelFont( pDev ); pDev->Push(); @@ -1817,7 +1817,10 @@ void Edit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, DrawF if ( GetSubEdit() ) { - GetSubEdit()->Draw( pDev, rPos, rSize, nFlags ); + Size aOrigSize(GetSubEdit()->GetSizePixel()); + GetSubEdit()->SetSizePixel(GetSizePixel()); + GetSubEdit()->Draw(pDev, rPos, nFlags); + GetSubEdit()->SetSizePixel(aOrigSize); } } -- cgit