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/unx | |
parent | 9796e52ab3bbf64fa751c71e695c64d6215e1df6 (diff) |
loplugin:simplifybool
Change-Id: I8276e8b356ff26241613de64bcd90b5dbcd92f29
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/generic/dtrans/X11_selection.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/generic/printer/ppdparser.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/window/salframe.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/gtk/window/gtksalmenu.cxx | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx b/vcl/unx/generic/dtrans/X11_selection.cxx index 1dfac0972c6d..427bd54cc049 100644 --- a/vcl/unx/generic/dtrans/X11_selection.cxx +++ b/vcl/unx/generic/dtrans/X11_selection.cxx @@ -1347,7 +1347,7 @@ bool SelectionManager::getPasteDataTypes( Atom selection, Sequence< DataFlavor > } if( (pFlavors - rTypes.getArray()) < rTypes.getLength() ) rTypes.realloc(pFlavors - rTypes.getArray()); - bSuccess = rTypes.getLength() ? true : false; + bSuccess = rTypes.hasElements(); if( bHaveText && ! bHaveUTF16 ) { int i = 0; @@ -2562,7 +2562,7 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage ) dsde.DragSource = static_cast< XDragSource* >( this ); dsde.UserAction = getUserDragAction(); dsde.DropAction = DNDConstants::ACTION_NONE; - m_bDropSuccess = rMessage.xclient.data.l[1] & 1 ? true : false; + m_bDropSuccess = (rMessage.xclient.data.l[1] & 1) != 0; #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "status drop action: accept = %s, %s\n", m_bDropSuccess ? "true" : "false", diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx index 3c573ae00b43..c1de3696f5c4 100644 --- a/vcl/unx/generic/printer/ppdparser.cxx +++ b/vcl/unx/generic/printer/ppdparser.cxx @@ -356,7 +356,7 @@ bool PPDDecompressStream::IsOpen() const bool PPDDecompressStream::IsEof() const { - return ( mpMemStream ? mpMemStream->IsEof() : ( mpFileStream ? mpFileStream->IsEof() : true ) ); + return ( mpMemStream ? mpMemStream->IsEof() : ( mpFileStream == nullptr || mpFileStream->IsEof() ) ); } OString PPDDecompressStream::ReadLine() diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index b39dd8e1d7b3..f93883a82b51 100644 --- a/vcl/unx/generic/window/salframe.cxx +++ b/vcl/unx/generic/window/salframe.cxx @@ -1752,8 +1752,8 @@ void X11SalFrame::SetWindowState( const SalFrameState *pState ) Maximize(); else { - bool bHorz = (pState->mnState & WINDOWSTATE_STATE_MAXIMIZED_HORZ) ? true : false; - bool bVert = (pState->mnState & WINDOWSTATE_STATE_MAXIMIZED_VERT) ? true : false; + bool bHorz = (pState->mnState & WINDOWSTATE_STATE_MAXIMIZED_HORZ) != 0; + bool bVert = (pState->mnState & WINDOWSTATE_STATE_MAXIMIZED_VERT) != 0; GetDisplay()->getWMAdaptor()->maximizeFrame( this, bHorz, bVert ); } maRestorePosSize.Left() = pState->mnX; diff --git a/vcl/unx/gtk/window/gtksalmenu.cxx b/vcl/unx/gtk/window/gtksalmenu.cxx index f2ea9f2d9d06..97727a727d54 100644 --- a/vcl/unx/gtk/window/gtksalmenu.cxx +++ b/vcl/unx/gtk/window/gtksalmenu.cxx @@ -792,7 +792,7 @@ void GtkSalMenu::Display( bool bVisible ) bMenuVisibility = bVisible; - bool bVCLMenuVisible = ( bVisible ) ? false : true; + bool bVCLMenuVisible = !bVisible; MenuBar* pMenuBar = static_cast< MenuBar* >( mpVCLMenu ); pMenuBar->SetDisplayable( bVCLMenuVisible ); |