diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2024-07-01 11:25:00 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2024-07-02 09:57:09 +0200 |
commit | 1582d803e1de1fb8863a9d8eaea959fd2ea588ec (patch) | |
tree | cb5e4b22c04c18205f554fef8966a318e527c252 /vcl/source/control | |
parent | 23a5be4d6d04944dcbbb06912c434eedd3719b3b (diff) |
tdf#161853 vcl: Move logic into SvxIconChoiceCtrl_Impl::DrawFocusRect
Move calculating the focus rect from
`SvxIconChoiceCtrl_Impl::PaintItem` to
`SvxIconChoiceCtrl_Impl::DrawFocusRect`.
The former is currently the only caller
of the latter, so behavior should remain
unchanged.
Change-Id: I1c3dd73acb3a1a6b8bb61034c06a79d75c5ed3f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169793
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl/source/control')
-rw-r--r-- | vcl/source/control/imivctl.hxx | 2 | ||||
-rw-r--r-- | vcl/source/control/imivctl1.cxx | 11 |
2 files changed, 6 insertions, 7 deletions
diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index f79e0100b1d2..95435c7c4d9e 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -237,7 +237,7 @@ class SvxIconChoiceCtrl_Impl void SetOrigin( const Point& ); void ShowFocus ( tools::Rectangle const & rRect ); - void DrawFocusRect(vcl::RenderContext& rRenderContext); + void DrawFocusRect(vcl::RenderContext& rRenderContext, SvxIconChoiceCtrlEntry* pEntry); bool IsMnemonicChar( sal_Unicode cChar, sal_uLong& rPos ) const; diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index 3b26c6b7ff81..bb4d9a48c12e 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -1368,11 +1368,7 @@ void SvxIconChoiceCtrl_Impl::PaintItem(const tools::Rectangle& rRect, rRenderContext.DrawText(rRect, aText, nCurTextDrawFlags); if (pEntry->IsFocused()) - { - tools::Rectangle aRect (CalcFocusRect(pEntry)); - ShowFocus(aRect); - DrawFocusRect(rRenderContext); - } + DrawFocusRect(rRenderContext, pEntry); } else { @@ -2465,8 +2461,11 @@ void SvxIconChoiceCtrl_Impl::ShowFocus ( tools::Rectangle const & rRect ) aFocus.aRect = rRect; } -void SvxIconChoiceCtrl_Impl::DrawFocusRect(vcl::RenderContext& rRenderContext) +void SvxIconChoiceCtrl_Impl::DrawFocusRect(vcl::RenderContext& rRenderContext, SvxIconChoiceCtrlEntry* pEntry) { + tools::Rectangle aRect (CalcFocusRect(pEntry)); + ShowFocus(aRect); + rRenderContext.SetLineColor(aFocus.aPenColor); rRenderContext.SetFillColor(); tools::Polygon aPolygon (aFocus.aRect); |