diff options
author | Noel Grandin <noel@peralex.com> | 2014-05-06 07:44:11 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-05-06 07:45:25 +0200 |
commit | 794f09f195a449e387ebfbd53eb1b693803c95e7 (patch) | |
tree | 4c82e01015ccac094261060021b49757dab12f19 /vcl/source | |
parent | 3f569908ac72c20826a45ebed59af9b1e5449207 (diff) |
simplify ternary conditions "xxx ? true : yyy"
Look for code like:
xxx ? true : yyy;
Which can be simplified to:
xxx || yyy
Change-Id: Ib7ca86580bfd0cf04674328a3c0cf3747de4758d
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/control/ilstbox.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/scrbar.cxx | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx index 52dd5890d67d..2769e905423b 100644 --- a/vcl/source/control/ilstbox.cxx +++ b/vcl/source/control/ilstbox.cxx @@ -1059,7 +1059,7 @@ bool ImplListBoxWindow::SelectEntries( sal_Int32 nSelect, LB_EVENT_TYPE eLET, bo // Space for selection change if( !bShift && ( ( eLET == LET_KEYSPACE ) || ( eLET == LET_MBDOWN ) ) ) { - bool bSelect = ( mbStackMode && IsMouseMoveSelect() ) ? true : !mpEntryList->IsEntryPosSelected( nSelect ); + bool bSelect = ( mbStackMode && IsMouseMoveSelect() ) || !mpEntryList->IsEntryPosSelected( nSelect ); if ( mbStackMode ) { sal_Int32 n; diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx index 32d977702fde..dc7213001e28 100644 --- a/vcl/source/control/scrbar.cxx +++ b/vcl/source/control/scrbar.cxx @@ -486,7 +486,7 @@ bool ScrollBar::ImplDrawNative( sal_uInt16 nDrawFlags ) if( !bNativeOK ) return false; - bool bHorz = (GetStyle() & WB_HORZ ? true : false); + bool bHorz = (GetStyle() & WB_HORZ) ? true : false; // Draw the entire background if the control supports it if( IsNativeControlSupported(CTRL_SCROLLBAR, bHorz ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT) ) @@ -802,7 +802,7 @@ void ScrollBar::ImplDoMouseAction( const Point& rMousePos, bool bCallAction ) { sal_uInt16 nOldStateFlags = mnStateFlags; bool bAction = false; - bool bHorizontal = ( GetStyle() & WB_HORZ )? true: false; + bool bHorizontal = ( GetStyle() & WB_HORZ ) ? true: false; bool bIsInside = false; Point aPoint( 0, 0 ); @@ -912,7 +912,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt ) { const Point& rMousePos = rMEvt.GetPosPixel(); sal_uInt16 nTrackFlags = 0; - bool bHorizontal = ( GetStyle() & WB_HORZ )? true: false; + bool bHorizontal = ( GetStyle() & WB_HORZ ) ? true: false; bool bIsInside = false; bool bDragToMouse = false; @@ -1247,7 +1247,7 @@ void ScrollBar::DataChanged( const DataChangedEvent& rDCEvt ) Rectangle* ScrollBar::ImplFindPartRect( const Point& rPt ) { - bool bHorizontal = ( GetStyle() & WB_HORZ )? true: false; + bool bHorizontal = ( GetStyle() & WB_HORZ ) ? true: false; bool bIsInside = false; Point aPoint( 0, 0 ); |