diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-10-26 17:05:25 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-10-27 14:00:00 +0200 |
commit | e210c66015beed1632188764d0680247237b7707 (patch) | |
tree | 2f1901d1a0c8ed5747b47bc33d092c58ace84787 /svtools | |
parent | eccd817127d852df98df173513a5c8d91c68e2c8 (diff) |
dont draw highlighted value with focus, only focus the selected value
Change-Id: I63dc0ffd157d79e998156439f88a87c1ecfbea3e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124233
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/control/valueset.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index f50f7dc01886..4993bb9a7a93 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -1189,14 +1189,14 @@ void ValueSet::ImplDrawSelect(vcl::RenderContext& rRenderContext) return; } - ImplDrawSelect(rRenderContext, mnSelItemId, bFocus, bDrawSel); - if (mbHighlight) + sal_uInt16 nItemDrawnSelected = ImplDrawSelect(rRenderContext, mnSelItemId, bFocus, bDrawSel); + if (mbHighlight && mnHighItemId != nItemDrawnSelected) { - ImplDrawSelect(rRenderContext, mnHighItemId, bFocus, bDrawSel); + ImplDrawSelect(rRenderContext, mnHighItemId, false, bDrawSel); } } -void ValueSet::ImplDrawSelect(vcl::RenderContext& rRenderContext, sal_uInt16 nItemId, const bool bFocus, const bool bDrawSel ) +sal_uInt16 ValueSet::ImplDrawSelect(vcl::RenderContext& rRenderContext, sal_uInt16 nItemId, const bool bFocus, const bool bDrawSel ) { ValueSetItem* pItem; tools::Rectangle aRect; @@ -1217,11 +1217,11 @@ void ValueSet::ImplDrawSelect(vcl::RenderContext& rRenderContext, sal_uInt16 nIt } else { - return; + return 0; } if (!pItem->mbVisible) - return; + return 0; // draw selection const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings(); @@ -1314,6 +1314,8 @@ void ValueSet::ImplDrawSelect(vcl::RenderContext& rRenderContext, sal_uInt16 nIt } ImplDrawItemText(rRenderContext, pItem->maText); + + return pItem->mnId; } void ValueSet::ImplFormatItem(vcl::RenderContext const & rRenderContext, ValueSetItem* pItem, tools::Rectangle aRect) |