summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-11-01 20:37:06 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-11-02 14:54:34 +0100
commit5fbc81640770dfe11907b2f92f3ae455e582a302 (patch)
treeb39283300790f8bdcdd06c37300008b2650cb204 /svtools
parent6896eb8dc44069808f5fef452c9802eaf0c51501 (diff)
mbDrawSelection is always true when evaluated
Change-Id: I043e68d5a5a6af8814f1db0f61f1cd95078ad11c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124570 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/control/valueset.cxx14
1 files changed, 4 insertions, 10 deletions
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index 0a73e0418c72..2afd1dfdeb57 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -100,7 +100,6 @@ ValueSet::ValueSet(std::unique_ptr<weld::ScrolledWindow> pScrolledWindow)
mnSpacing = 0;
mnFrameStyle = DrawFrameStyle::NONE;
mbNoSelection = true;
- mbDrawSelection = true;
mbDoubleSel = false;
mbScroll = false;
mbFullMode = true;
@@ -468,14 +467,14 @@ void ValueSet::ImplTracking(bool bLeaveWindow, const Point& rPos)
if( GetStyle() & WB_MENUSTYLEVALUESET || GetStyle() & WB_FLATVALUESET )
mbHighlight = true;
- ImplHighlightItem( pItem->mnId );
+ ImplHighlightItem(pItem->mnId);
}
else
{
if( GetStyle() & WB_MENUSTYLEVALUESET || GetStyle() & WB_FLATVALUESET )
mbHighlight = true;
- ImplHighlightItem( 0, false );
+ ImplHighlightItem(0);
}
}
@@ -668,7 +667,7 @@ tools::Rectangle ValueSet::ImplGetItemRect( size_t nPos ) const
return tools::Rectangle( Point(x, y), Size(mnItemWidth, mnItemHeight) );
}
-void ValueSet::ImplHighlightItem( sal_uInt16 nItemId, bool bIsSelection )
+void ValueSet::ImplHighlightItem(sal_uInt16 nItemId)
{
if ( mnHighItemId == nItemId )
return;
@@ -676,13 +675,8 @@ void ValueSet::ImplHighlightItem( sal_uInt16 nItemId, bool bIsSelection )
// remember the old item to delete the previous selection
mnHighItemId = nItemId;
- // don't draw the selection if nothing is selected
- if ( !bIsSelection && mbNoSelection )
- mbDrawSelection = false;
-
// remove the old selection and draw the new one
Invalidate();
- mbDrawSelection = true;
}
void ValueSet::ImplDraw(vcl::RenderContext& rRenderContext)
@@ -1184,7 +1178,7 @@ void ValueSet::ImplDrawSelect(vcl::RenderContext& rRenderContext)
return;
const bool bFocus = HasFocus();
- const bool bDrawSel = !((mbNoSelection && !mbHighlight) || (!mbDrawSelection && mbHighlight));
+ const bool bDrawSel = !mbNoSelection || mbHighlight;
if (!bFocus && !bDrawSel)
{