summaryrefslogtreecommitdiff
path: root/vcl/source/control
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/control')
-rw-r--r--vcl/source/control/button.cxx7
-rw-r--r--vcl/source/control/combobox.cxx4
-rw-r--r--vcl/source/control/ilstbox.cxx4
-rw-r--r--vcl/source/control/lstbox.cxx6
-rw-r--r--vcl/source/control/scrbar.cxx14
-rw-r--r--vcl/source/control/spinfld.cxx2
6 files changed, 18 insertions, 19 deletions
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 30e111a674d1..09abe44f5f80 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -239,7 +239,7 @@ void Button::ImplDrawAlignedImage( OutputDevice* pDev, Point& rPos,
OUString aText( GetText() );
bool bDrawImage = HasImage() && ! ( ImplGetButtonState() & BUTTON_DRAW_NOIMAGE );
bool bDrawText = !aText.isEmpty() && ! ( ImplGetButtonState() & BUTTON_DRAW_NOTEXT );
- bool bHasSymbol = pSymbolRect ? true : false;
+ bool bHasSymbol = pSymbolRect != nullptr;
// No text and no image => nothing to do => return
if ( !bDrawImage && !bDrawText && !bHasSymbol )
@@ -684,9 +684,8 @@ void PushButton::ImplInitSettings( bool bFont,
EnableChildTransparentMode( true );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
SetPaintTransparent( true );
- mpWindowImpl->mbUseNativeFocus = (GetStyle() & WB_FLATBUTTON)
- ? false
- : ImplGetSVData()->maNWFData.mbNoFocusRects;
+ mpWindowImpl->mbUseNativeFocus = (GetStyle() & WB_FLATBUTTON) == 0
+ && ImplGetSVData()->maNWFData.mbNoFocusRects;
}
else
{
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 16d1cccb7f5e..3d5a41f6809f 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -122,7 +122,7 @@ void ComboBox::ImplInit( vcl::Window* pParent, WinBits nStyle )
{
ImplInitStyle( nStyle );
- bool bNoBorder = ( nStyle & WB_NOBORDER ) ? true : false;
+ bool bNoBorder = ( nStyle & WB_NOBORDER ) != 0;
if ( !(nStyle & WB_DROPDOWN) )
{
nStyle &= ~WB_BORDER;
@@ -647,7 +647,7 @@ void ComboBox::StateChanged( StateChangedType nType )
else if ( nType == StateChangedType::STYLE )
{
SetStyle( ImplInitStyle( GetStyle() ) );
- mpImplLB->GetMainWindow().EnableSort( ( GetStyle() & WB_SORT ) ? true : false );
+ mpImplLB->GetMainWindow().EnableSort( ( GetStyle() & WB_SORT ) != 0 );
}
else if( nType == StateChangedType::MIRRORING )
{
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index e5d29ea4a98e..0500a46dc8ba 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -459,7 +459,7 @@ bool ImplEntryList::IsEntryPosSelected( sal_Int32 nIndex ) const
bool ImplEntryList::IsEntrySelectable( sal_Int32 nPos ) const
{
ImplEntryType* pImplEntry = GetEntry( nPos );
- return pImplEntry ? ((pImplEntry->mnFlags & LISTBOX_ENTRY_FLAG_DISABLE_SELECTION) == 0) : true;
+ return pImplEntry == nullptr || ((pImplEntry->mnFlags & LISTBOX_ENTRY_FLAG_DISABLE_SELECTION) == 0);
}
sal_Int32 ImplEntryList::FindFirstSelectable( sal_Int32 nPos, bool bForward /* = true */ )
@@ -2538,7 +2538,7 @@ bool ImplListBox::HandleWheelAsCursorTravel( const CommandEvent& rCEvt )
void ImplListBox::SetMRUEntries( const OUString& rEntries, sal_Unicode cSep )
{
- bool bChanges = GetEntryList()->GetMRUCount() ? true : false;
+ bool bChanges = GetEntryList()->GetMRUCount() != 0;
// Remove old MRU entries
for ( sal_Int32 n = GetEntryList()->GetMRUCount();n; )
diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx
index 3669e1813f5f..131d0fe8b31e 100644
--- a/vcl/source/control/lstbox.cxx
+++ b/vcl/source/control/lstbox.cxx
@@ -853,8 +853,8 @@ void ListBox::StateChanged( StateChangedType nType )
else if ( nType == StateChangedType::STYLE )
{
SetStyle( ImplInitStyle( GetStyle() ) );
- mpImplLB->GetMainWindow().EnableSort( ( GetStyle() & WB_SORT ) ? true : false );
- bool bSimpleMode = ( GetStyle() & WB_SIMPLEMODE ) ? true : false;
+ mpImplLB->GetMainWindow().EnableSort( ( GetStyle() & WB_SORT ) != 0 );
+ bool bSimpleMode = ( GetStyle() & WB_SIMPLEMODE ) != 0;
mpImplLB->SetMultiSelectionSimpleMode( bSimpleMode );
}
else if( nType == StateChangedType::MIRRORING )
@@ -1175,7 +1175,7 @@ void ListBox::EnableMultiSelection( bool bMulti, bool bStackSelection )
// WB_SIMPLEMODE:
// The MultiListBox behaves just like a normal ListBox
// MultiSelection is possible via corresponding additional keys
- bool bSimpleMode = ( GetStyle() & WB_SIMPLEMODE ) ? true : false;
+ bool bSimpleMode = ( GetStyle() & WB_SIMPLEMODE ) != 0;
mpImplLB->SetMultiSelectionSimpleMode( bSimpleMode );
// In a MultiSelection, we can't see us travelling without focus
diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx
index 98d753363f18..e31391d27ab3 100644
--- a/vcl/source/control/scrbar.cxx
+++ b/vcl/source/control/scrbar.cxx
@@ -456,7 +456,7 @@ bool ScrollBar::ImplDrawNative( sal_uInt16 nDrawFlags )
if( !bNativeOK )
return false;
- bool bHorz = (GetStyle() & WB_HORZ) ? true : false;
+ bool bHorz = (GetStyle() & WB_HORZ) != 0;
// Draw the entire background if the control supports it
if( IsNativeControlSupported(CTRL_SCROLLBAR, bHorz ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT) )
@@ -786,7 +786,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 ) != 0;
bool bIsInside = false;
Point aPoint( 0, 0 );
@@ -896,7 +896,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 ) != 0;
bool bIsInside = false;
bool bDragToMouse = false;
@@ -972,9 +972,9 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
ImplDraw( mnDragDraw, this );
}
}
- else if(bPage && (HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? PART_TRACK_HORZ_AREA : PART_TRACK_VERT_AREA,
- aControlRegion, rMousePos, bIsInside ) ?
- bIsInside : true) )
+ else if(bPage && (!HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? PART_TRACK_HORZ_AREA : PART_TRACK_VERT_AREA,
+ aControlRegion, rMousePos, bIsInside ) ||
+ bIsInside) )
{
nTrackFlags = STARTTRACK_BUTTONREPEAT;
@@ -1231,7 +1231,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 ) != 0;
bool bIsInside = false;
Point aPoint( 0, 0 );
diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx
index 85aa37b07769..15ae57f4042a 100644
--- a/vcl/source/control/spinfld.cxx
+++ b/vcl/source/control/spinfld.cxx
@@ -407,7 +407,7 @@ void SpinField::MouseButtonDown( const MouseEvent& rMEvt )
else if ( maDropDownRect.IsInside( rMEvt.GetPosPixel() ) )
{
// put DropDownButton to the right
- mbInDropDown = ShowDropDown( mbInDropDown ? false : true );
+ mbInDropDown = ShowDropDown( !mbInDropDown );
Paint( Rectangle( Point(), GetOutputSizePixel() ) );
}