diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-04-24 12:34:53 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-04-24 12:36:31 +0200 |
commit | a9a4d46ce74fc3c4ff1b7399ea6be6ffeeeb8863 (patch) | |
tree | f44261f69c3c6c5cb13095d092ea538a8d47a5e0 /vcl/source | |
parent | 9796e52ab3bbf64fa751c71e695c64d6215e1df6 (diff) |
loplugin:simplifybool
Change-Id: I8276e8b356ff26241613de64bcd90b5dbcd92f29
Diffstat (limited to 'vcl/source')
27 files changed, 52 insertions, 53 deletions
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 64b0336ddb87..3d22d7cf5621 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -1102,7 +1102,7 @@ unsigned int Application::GetScreenCount() bool Application::IsUnifiedDisplay() { SalSystem* pSys = ImplGetSalSystem(); - return pSys ? pSys->IsUnifiedDisplay() : true; + return pSys == nullptr || pSys->IsUnifiedDisplay(); } unsigned int Application::GetDisplayBuiltInScreen() 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() ) ); } diff --git a/vcl/source/edit/textdat2.hxx b/vcl/source/edit/textdat2.hxx index 81785cf35fce..c1cdded84148 100644 --- a/vcl/source/edit/textdat2.hxx +++ b/vcl/source/edit/textdat2.hxx @@ -154,7 +154,7 @@ public: void SetInvalid() { mbInvalid = true; } void SetValid() { mbInvalid = false; } - bool IsEmpty() const { return (mnEnd > mnStart) ? false : true; } + bool IsEmpty() const { return mnEnd <= mnStart; } short GetStartX() const { return mnStartX; } void SetStartX( short n ) { mnStartX = n; } diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index bac8fdbd48d0..f4a11a2d0ec3 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -2520,7 +2520,7 @@ bool TextEngine::Read( SvStream& rInput, const TextSelection* pSel ) SetUpdateMode( bUpdate ); FormatAndUpdate( GetActiveView() ); - return rInput.GetError() ? false : true; + return rInput.GetError() == 0; } bool TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, bool bHTML ) @@ -2608,7 +2608,7 @@ bool TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, bool bHTML rOutput.WriteLine( "</HTML>" ); } - return rOutput.GetError() ? false : true; + return rOutput.GetError() == 0; } void TextEngine::RemoveAttribs( sal_uLong nPara, bool bIdleFormatAndUpdate ) diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx index cafbbf52f9c4..768125bf2a35 100644 --- a/vcl/source/edit/textview.cxx +++ b/vcl/source/edit/textview.cxx @@ -1841,7 +1841,7 @@ bool TextView::SetCursorAtPoint( const Point& rPosPixel ) ShowSelection( aTmpNewSel ); } - bool bForceCursor = mpImpl->mpDDInfo ? false : true; // && !mbInSelection + bool bForceCursor = mpImpl->mpDDInfo == nullptr; // && !mbInSelection ImpShowCursor( mpImpl->mbAutoScroll, bForceCursor, false ); return true; } diff --git a/vcl/source/filter/ixpm/xpmread.cxx b/vcl/source/filter/ixpm/xpmread.cxx index 338069b0b2b1..6d7646c827f3 100644 --- a/vcl/source/filter/ixpm/xpmread.cxx +++ b/vcl/source/filter/ixpm/xpmread.cxx @@ -398,7 +398,7 @@ bool XPMReader::ImplGetColKey( sal_uInt8 nKey ) } } } - return ( mnParaSize ) ? true : false; + return mnParaSize != 0; } // ImplGetRGBHex translates the ASCII-Hexadecimalvalue belonging to mpPara diff --git a/vcl/source/gdi/bitmap4.cxx b/vcl/source/gdi/bitmap4.cxx index d5dc4705111a..8790b2baf58b 100644 --- a/vcl/source/gdi/bitmap4.cxx +++ b/vcl/source/gdi/bitmap4.cxx @@ -943,7 +943,7 @@ extern "C" int SAL_CALL ImplPopArtCmpFnc( const void* p1, const void* p2 ) bool Bitmap::ImplPopArt( const BmpFilterParam* /*pFilterParam*/, const Link* /*pProgress*/ ) { - bool bRet = ( GetBitCount() > 8 ) ? Convert( BMP_CONVERSION_8BIT_COLORS ) : true; + bool bRet = ( GetBitCount() <= 8 ) || Convert( BMP_CONVERSION_8BIT_COLORS ); if( bRet ) { diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx index d75d6749143e..79ae295b3f74 100644 --- a/vcl/source/gdi/bitmapex.cxx +++ b/vcl/source/gdi/bitmapex.cxx @@ -157,7 +157,7 @@ BitmapEx::BitmapEx( const Bitmap& rBmp, const AlphaMask& rAlphaMask ) : aMask ( rAlphaMask.ImplGetBitmap() ), aBitmapSize ( aBitmap.GetSizePixel() ), eTransparent ( !rAlphaMask ? TRANSPARENT_NONE : TRANSPARENT_BITMAP ), - bAlpha ( !rAlphaMask ? false : true ) + bAlpha ( !rAlphaMask.IsEmpty() ) { if(!!aBitmap && !!aMask && aBitmap.GetSizePixel() != aMask.GetSizePixel()) { diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index 1bcd5cf5fe8c..0c6714e9ffba 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -1968,8 +1968,8 @@ void PDFWriterImpl::writeG4Stream( BitmapReadAccess* i_pBitmap ) { const Scanline pCurLine = i_pBitmap->GetScanline( nY ); long nLineIndex = 0; - bool bRunSet = (*pCurLine & 0x80) ? true : false; - bool bRefSet = (*pRefLine & 0x80) ? true : false; + bool bRunSet = (*pCurLine & 0x80) != 0; + bool bRefSet = (*pRefLine & 0x80) != 0; long nRunIndex1 = bRunSet ? 0 : findBitRun( pCurLine, 0, nW, bRunSet ); long nRefIndex1 = bRefSet ? 0 : findBitRun( pRefLine, 0, nW, bRefSet ); for( ; nLineIndex < nW; ) diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 658363dff292..e96e14bc9c68 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -643,7 +643,7 @@ bool Printer::AcquireGraphics() const mpGraphics->setAntiAliasB2DDraw(mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW); } - return mpGraphics ? true : false; + return mpGraphics != nullptr; } void Printer::ImplReleaseFonts() diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx index 76a471b45d99..4b5a2f1505b9 100644 --- a/vcl/source/gdi/print2.cxx +++ b/vcl/source/gdi/print2.cxx @@ -282,8 +282,8 @@ void ImplConvertTransparentAction( GDIMetaFile& o_rMtf, // Returns true, if given action creates visible (i.e. non-transparent) output bool ImplIsNotTransparent( const MetaAction& rAct, const OutputDevice& rOut ) { - const bool bLineTransparency( rOut.IsLineColor() ? rOut.GetLineColor().GetTransparency() == 255 : true ); - const bool bFillTransparency( rOut.IsFillColor() ? rOut.GetFillColor().GetTransparency() == 255 : true ); + const bool bLineTransparency( !rOut.IsLineColor() || rOut.GetLineColor().GetTransparency() == 255 ); + const bool bFillTransparency( !rOut.IsFillColor() || rOut.GetFillColor().GetTransparency() == 255 ); bool bRet( false ); switch( rAct.GetType() ) diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx index eec2fa98768b..b94b6c20e1d6 100644 --- a/vcl/source/gdi/virdev.cxx +++ b/vcl/source/gdi/virdev.cxx @@ -89,7 +89,7 @@ bool VirtualDevice::AcquireGraphics() const mpGraphics->setAntiAliasB2DDraw(mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW); } - return mpGraphics ? true : false; + return mpGraphics != nullptr; } void VirtualDevice::ReleaseGraphics( bool bRelease ) diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx index e692584c3768..3acb0c667a94 100644 --- a/vcl/source/opengl/OpenGLHelper.cxx +++ b/vcl/source/opengl/OpenGLHelper.cxx @@ -539,7 +539,7 @@ GLXFBConfig OpenGLHelper::GetPixmapFBConfig( Display* pDisplay, bool& bInverted } glXGetFBConfigAttrib( pDisplay, aFbConfigs[i], GLX_Y_INVERTED_EXT, &nValue ); - bInverted = (nValue == True) ? true : false; + bInverted = nValue == True; break; } diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx index 35ef02d1498a..9f13a24f1442 100644 --- a/vcl/source/outdev/bitmap.cxx +++ b/vcl/source/outdev/bitmap.cxx @@ -1263,7 +1263,7 @@ void OutputDevice::DrawImage( const Point& rPos, const Image& rImage, sal_uInt16 void OutputDevice::DrawImage( const Point& rPos, const Size& rSize, const Image& rImage, sal_uInt16 nStyle ) { - bool bIsSizeValid = (rSize.getWidth() == 0 || rSize.getHeight() == 0) ? false : true; + bool bIsSizeValid = rSize.getWidth() != 0 && rSize.getHeight() != 0; if( rImage.mpImplData && !ImplIsRecordLayout() ) { diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index 882818fc0297..5818d11b57ae 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -127,7 +127,7 @@ static void ImplDrawBrdWinSymbolButton( OutputDevice* pDev, pWin->SetFillColor( pDev->GetSettings().GetStyleSettings().GetWindowColor() ); pWin->SetLineColor(); pWin->DrawRect( rRect ); - pWin->DrawSelectionBackground( rRect, 2, (nState & BUTTON_DRAW_PRESSED) ? true : false, + pWin->DrawSelectionBackground( rRect, 2, (nState & BUTTON_DRAW_PRESSED) != 0, true, false ); } aTempRect = rRect; @@ -1777,7 +1777,7 @@ void ImplBorderWindow::ImplInit( vcl::Window* pParent, { mpWindowImpl->mbOverlapWin = true; mpWindowImpl->mbFrame = true; - mbFrameBorder = (nOrgStyle & WB_NOBORDER) ? false : true; + mbFrameBorder = (nOrgStyle & WB_NOBORDER) == 0; } else { diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index d32c86f3f07c..597e6627d1fb 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -2551,7 +2551,7 @@ bool MenuBar::ImplHandleKeyEvent( const KeyEvent& rKEvent, bool bFromMenu ) if (pWin && pWin->IsEnabled() && pWin->IsInputEnabled() && !pWin->IsInModalMode()) { IMenuBarWindow* pMenuWin = getMenuBarWindow(); - bDone = pMenuWin ? pMenuWin->HandleKeyEvent(rKEvent, bFromMenu) : false; + bDone = pMenuWin && pMenuWin->HandleKeyEvent(rKEvent, bFromMenu); } return bDone; } @@ -2682,7 +2682,7 @@ void MenuBar::RemoveMenuBarButton( sal_uInt16 nId ) bool MenuBar::HandleMenuButtonEvent( Menu *, sal_uInt16 i_nButtonId ) { IMenuBarWindow* pMenuWin = getMenuBarWindow(); - return pMenuWin ? pMenuWin->HandleMenuButtonEvent(i_nButtonId) : false; + return pMenuWin && pMenuWin->HandleMenuButtonEvent(i_nButtonId); } // bool PopupMenu::bAnyPopupInExecute = false; @@ -2754,7 +2754,7 @@ void PopupMenu::ClosePopup(Menu* pMenu) bool PopupMenu::IsInExecute() { - return GetActivePopupMenu() ? true : false; + return GetActivePopupMenu() != nullptr; } PopupMenu* PopupMenu::GetActivePopupMenu() diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx index e4b1124af4da..19e709d43423 100644 --- a/vcl/source/window/menufloatingwindow.cxx +++ b/vcl/source/window/menufloatingwindow.cxx @@ -317,7 +317,7 @@ IMPL_LINK( MenuFloatingWindow, HighlightChanged, Timer*, pTimer ) Menu* pTest = pActivePopup; sal_uLong nOldFlags = GetPopupModeFlags(); SetPopupModeFlags( GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE ); - sal_uInt16 nRet = pActivePopup->ImplExecute( this, Rectangle( aItemTopLeft, aItemBottomRight ), FLOATWIN_POPUPMODE_RIGHT, pMenu, pTimer ? false : true ); + sal_uInt16 nRet = pActivePopup->ImplExecute( this, Rectangle( aItemTopLeft, aItemBottomRight ), FLOATWIN_POPUPMODE_RIGHT, pMenu, pTimer == nullptr ); SetPopupModeFlags( nOldFlags ); // nRet != 0, wenn es waerend Activate() abgeschossen wurde... diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx index 86db81283a4f..c18e1d06adca 100644 --- a/vcl/source/window/splitwin.cxx +++ b/vcl/source/window/splitwin.cxx @@ -2433,8 +2433,8 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt ) if ( bSplit ) { - bool bPropSmaller = (mnMouseModifier & KEY_SHIFT) ? true : false; - bool bPropGreater = (mnMouseModifier & KEY_MOD1) ? true : false; + bool bPropSmaller = (mnMouseModifier & KEY_SHIFT) != 0; + bool bPropGreater = (mnMouseModifier & KEY_MOD1) != 0; long nDelta = mnMSplitPos-mnMStartPos; if ( (mnSplitTest & SPLIT_WINDOW) && !mpMainSet->mpItems ) diff --git a/vcl/source/window/stacking.cxx b/vcl/source/window/stacking.cxx index ee29a8deabda..f20c0ece86dd 100644 --- a/vcl/source/window/stacking.cxx +++ b/vcl/source/window/stacking.cxx @@ -647,7 +647,7 @@ bool Window::IsTopWindow() const uno::Reference< XTopWindow > xTopWindow( pThisWin->GetComponentInterface(), UNO_QUERY ); pThisWin->mpWindowImpl->mpWinData->mnIsTopWindow = xTopWindow.is() ? 1 : 0; } - return mpWindowImpl->mpWinData->mnIsTopWindow == 1 ? true : false; + return mpWindowImpl->mpWinData->mnIsTopWindow == 1; } vcl::Window* Window::FindWindow( const Point& rPos ) const diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 7cf7a23b0c76..34ad659b9ece 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -894,7 +894,7 @@ void ToolBox::ImplSetMinMaxFloatSize( ToolBox *pThis ) { pWrapper->SetMinOutputSizePixel( aMinSize ); pWrapper->SetMaxOutputSizePixel( aMaxSize ); - pWrapper->ShowTitleButton( TITLE_BUTTON_MENU, ( pThis->GetMenuType() & TOOLBOX_MENUTYPE_CUSTOMIZE) ? true : false ); + pWrapper->ShowTitleButton( TITLE_BUTTON_MENU, ( pThis->GetMenuType() & TOOLBOX_MENUTYPE_CUSTOMIZE) != 0 ); } else { @@ -4476,7 +4476,7 @@ void ToolBox::SetStyle(WinBits nNewStyle) if (!ImplIsFloatingMode()) { bool bOldScroll = mbScroll; - mbScroll = (mnWinStyle & WB_SCROLL) ? true : false; + mbScroll = (mnWinStyle & WB_SCROLL) != 0; if (mbScroll != bOldScroll) { mbFormat = true; @@ -4505,7 +4505,7 @@ void ToolBox::ToggleFloatingMode() } else { - mbScroll = (mnWinStyle & WB_SCROLL) ? true : false; + mbScroll = (mnWinStyle & WB_SCROLL) != 0; if ( (meAlign == WINDOWALIGN_TOP) || (meAlign == WINDOWALIGN_BOTTOM) ) mbHorz = true; else diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx index 2c9a9d0eda9e..80b2bf920075 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -1731,7 +1731,7 @@ void ToolBox::SetMenuType( sal_uInt16 aType ) // the menu button may have to be moved into the decoration which changes the layout ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this ); if( pWrapper ) - pWrapper->ShowTitleButton( TITLE_BUTTON_MENU, ( aType & TOOLBOX_MENUTYPE_CUSTOMIZE) ? true : false ); + pWrapper->ShowTitleButton( TITLE_BUTTON_MENU, ( aType & TOOLBOX_MENUTYPE_CUSTOMIZE) != 0 ); mbFormat = true; ImplFormat(); diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 6fdb764bf2b5..4a898eeac6b9 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -796,7 +796,7 @@ bool Window::AcquireGraphics() const mpGraphics->setAntiAliasB2DDraw(mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW); } - return mpGraphics ? true : false; + return mpGraphics != nullptr; } void Window::ReleaseGraphics( bool bRelease ) @@ -1259,7 +1259,7 @@ ImplWinData* Window::ImplGetWinData() const mpWindowImpl->mpWinData->mnTrackFlags = 0; mpWindowImpl->mpWinData->mnIsTopWindow = (sal_uInt16) ~0; // not initialized yet, 0/1 will indicate TopWindow (see IsTopWindow()) mpWindowImpl->mpWinData->mbMouseOver = false; - mpWindowImpl->mpWinData->mbEnableNativeWidget = (pNoNWF && *pNoNWF) ? false : true; // true: try to draw this control with native theme API + mpWindowImpl->mpWinData->mbEnableNativeWidget = !(pNoNWF && *pNoNWF); // true: try to draw this control with native theme API } return mpWindowImpl->mpWinData; @@ -2423,7 +2423,7 @@ void Window::Show( bool bVisible, sal_uInt16 nFlags ) mpWindowImpl->mbPaintFrame = true; if (!Application::GetSettings().GetMiscSettings().GetPseudoHeadless()) { - bool bNoActivate = (nFlags & (SHOW_NOACTIVATE|SHOW_NOFOCUSCHANGE)) ? true : false; + bool bNoActivate = (nFlags & (SHOW_NOACTIVATE|SHOW_NOFOCUSCHANGE)) != 0; mpWindowImpl->mpFrame->Show( true, bNoActivate ); } if( aDogTag.IsDead() ) @@ -2564,7 +2564,7 @@ void Window::Enable( bool bEnable, bool bChild ) void Window::SetCallHandlersOnInputDisabled( bool bCall ) { - mpWindowImpl->mbCallHandlersDuringInputDisabled = bCall ? true : false; + mpWindowImpl->mbCallHandlersDuringInputDisabled = bCall; vcl::Window* pChild = mpWindowImpl->mpFirstChild; while ( pChild ) @@ -3752,7 +3752,7 @@ Reference< css::rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscr else aArg[ 2 ] = makeAny( css::awt::Rectangle( mnOutOffX, mnOutOffY, mnOutWidth, mnOutHeight ) ); - aArg[ 3 ] = makeAny( mpWindowImpl->mbAlwaysOnTop ? true : false ); + aArg[ 3 ] = makeAny( mpWindowImpl->mbAlwaysOnTop ); aArg[ 4 ] = makeAny( Reference< css::awt::XWindow >( const_cast<vcl::Window*>(this)->GetComponentInterface(), UNO_QUERY )); |