From 91894db3d7265bcb9ae20971e4873c64c4d5befd Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 7 Mar 2006 22:53:10 +0000 Subject: [PATCH] simplified the code in ProcessGridCellMouseEvent() to get rid of unreachable code (coverity checked CID 3) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37873 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/grid.cpp | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index a3f5811893..f6f5494bb0 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -5821,7 +5821,7 @@ void wxGrid::ProcessGridCellMouseEvent( wxMouseEvent& event ) // Dragging on the corner of a cell to resize in both // directions is not implemented yet... // - if ( dragRow >= 0 && dragCol >= 0 ) + if ( dragRow >= 0 && dragCol >= 0 ) { ChangeCursorMode(WXGRID_CURSOR_SELECT_CELL); return; @@ -5836,16 +5836,8 @@ void wxGrid::ProcessGridCellMouseEvent( wxMouseEvent& event ) if ( CanDragRowSize() && CanDragGridSize() ) ChangeCursorMode(WXGRID_CURSOR_RESIZE_ROW); } - - if ( dragCol >= 0 ) - { - m_dragRowOrCol = dragCol; - } - - return; } - - if ( dragCol >= 0 ) + else if ( dragCol >= 0 ) { m_dragRowOrCol = dragCol; @@ -5854,15 +5846,13 @@ void wxGrid::ProcessGridCellMouseEvent( wxMouseEvent& event ) if ( CanDragColSize() && CanDragGridSize() ) ChangeCursorMode(WXGRID_CURSOR_RESIZE_COL); } - - return; } - - // Neither on a row or col edge - // - if ( m_cursorMode != WXGRID_CURSOR_SELECT_CELL ) + else // Neither on a row or col edge { - ChangeCursorMode(WXGRID_CURSOR_SELECT_CELL); + if ( m_cursorMode != WXGRID_CURSOR_SELECT_CELL ) + { + ChangeCursorMode(WXGRID_CURSOR_SELECT_CELL); + } } } } -- 2.45.2