From fe36838f9db5fef3c281b677c64b4db0519c9d4d Mon Sep 17 00:00:00 2001 From: Matteo Casalin Date: Mon, 26 Dec 2011 10:38:25 +0100 Subject: Do not repeat the same test twice --- svtools/source/control/valueset.cxx | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'svtools') diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index 576a091c1a0c..97ecc035c302 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -700,16 +700,10 @@ void ValueSet::ImplDrawSelect() if ( !IsReallyVisible() ) return; - sal_Bool bFocus = HasFocus(); - sal_Bool bDrawSel; + const bool bFocus = HasFocus(); + const bool bDrawSel = !( (mbNoSelection && !mbHighlight) || (!mbDrawSelection && mbHighlight) ); - if ( (mbNoSelection && !mbHighlight) || (!mbDrawSelection && mbHighlight) ) - bDrawSel = sal_False; - else - bDrawSel = sal_True; - - if ( !bFocus && - ((mbNoSelection && !mbHighlight) || (!mbDrawSelection && mbHighlight)) ) + if ( !bFocus && !bDrawSel ) { XubString aEmptyStr; ImplDrawItemText( aEmptyStr ); -- cgit