summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/svtools/valueset.hxx3
-rw-r--r--svtools/source/control/valueset.cxx14
2 files changed, 5 insertions, 12 deletions
diff --git a/include/svtools/valueset.hxx b/include/svtools/valueset.hxx
index ada2641c2eb4..baee0108af9e 100644
--- a/include/svtools/valueset.hxx
+++ b/include/svtools/valueset.hxx
@@ -217,7 +217,6 @@ private:
bool mbFormat : 1;
bool mbHighlight : 1;
bool mbNoSelection : 1;
- bool mbDrawSelection : 1;
bool mbDoubleSel : 1;
bool mbScroll : 1;
bool mbFullMode : 1;
@@ -238,7 +237,7 @@ private:
const bool bFocus, const bool bDrawSel,
const bool bSelected, const bool bHover);
SVT_DLLPRIVATE void ImplDrawSelect(vcl::RenderContext& rRenderContext);
- SVT_DLLPRIVATE void ImplHighlightItem(sal_uInt16 nItemId, bool bIsSelection = true);
+ SVT_DLLPRIVATE void ImplHighlightItem(sal_uInt16 nItemId);
SVT_DLLPRIVATE void ImplDraw(vcl::RenderContext& rRenderContext);
SVT_DLLPRIVATE size_t ImplGetItem( const Point& rPoint ) const;
SVT_DLLPRIVATE ValueSetItem* ImplGetItem( size_t nPos );
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)
{