From e210c66015beed1632188764d0680247237b7707 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 26 Oct 2021 17:05:25 +0100 Subject: dont draw highlighted value with focus, only focus the selected value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I63dc0ffd157d79e998156439f88a87c1ecfbea3e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124233 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- svtools/source/control/valueset.cxx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'svtools') 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) -- cgit