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 /forms/source/richtext | |
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 'forms/source/richtext')
-rw-r--r-- | forms/source/richtext/richtextcontrol.cxx | 6 | ||||
-rw-r--r-- | forms/source/richtext/richtextvclcontrol.cxx | 6 | ||||
-rw-r--r-- | forms/source/richtext/richtextvclcontrol.hxx | 2 |
3 files changed, 4 insertions, 10 deletions
diff --git a/forms/source/richtext/richtextcontrol.cxx b/forms/source/richtext/richtextcontrol.cxx index 1c96b9870361..a22d36d52424 100644 --- a/forms/source/richtext/richtextcontrol.cxx +++ b/forms/source/richtext/richtextcontrol.cxx @@ -325,17 +325,13 @@ namespace frm if ( !pTargetDevice ) return; - ::Size aSize = pControl->GetSizePixel(); const MapUnit eTargetUnit = pTargetDevice->GetMapMode().GetMapUnit(); - if ( eTargetUnit != MapUnit::MapPixel ) - aSize = pTargetDevice->PixelToLogic( aSize ); - ::Point aPos( _nX, _nY ); // the XView::draw API talks about pixels, always ... if ( eTargetUnit != MapUnit::MapPixel ) aPos = pTargetDevice->PixelToLogic( aPos ); - pControl->Draw( pTargetDevice, aPos, aSize, DrawFlags::NoControls ); + pControl->Draw( pTargetDevice, aPos, DrawFlags::NoControls ); } diff --git a/forms/source/richtext/richtextvclcontrol.cxx b/forms/source/richtext/richtextvclcontrol.cxx index 492b08134d20..0df141693f54 100644 --- a/forms/source/richtext/richtextvclcontrol.cxx +++ b/forms/source/richtext/richtextvclcontrol.cxx @@ -288,13 +288,11 @@ namespace frm return bDone || Control::EventNotify(_rNEvt); } - - void RichTextControl::Draw( OutputDevice* _pDev, const Point& _rPos, const Size& _rSize, DrawFlags /*_nFlags*/ ) + void RichTextControl::Draw( OutputDevice* _pDev, const Point& _rPos, DrawFlags /*_nFlags*/ ) { - m_pImpl->Draw( _pDev, _rPos, _rSize ); + m_pImpl->Draw( _pDev, _rPos, _pDev->PixelToLogic(GetSizePixel()) ); } - EditView& RichTextControl::getView() { return *m_pImpl->getView( RichTextControlImpl::GrantAccess() ); diff --git a/forms/source/richtext/richtextvclcontrol.hxx b/forms/source/richtext/richtextvclcontrol.hxx index 9f34f74dc7e7..f241e9350c3a 100644 --- a/forms/source/richtext/richtextvclcontrol.hxx +++ b/forms/source/richtext/richtextvclcontrol.hxx @@ -97,7 +97,7 @@ namespace frm EditView& getView(); // Window overridables - virtual void Draw( OutputDevice* _pDev, const Point& _rPos, const Size& _rSize, DrawFlags _nFlags ) override; + virtual void Draw( OutputDevice* _pDev, const Point& _rPos, DrawFlags _nFlags ) override; protected: // Window overridables |