From d93b6943276f02cfee68a9c2ed0380a4bb1b2253 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 21 Jan 2019 08:54:13 +0100 Subject: [PATCH] Fix a compil warning --- common/grid_tricks.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/grid_tricks.cpp b/common/grid_tricks.cpp index 77bd685e8e..53abb3b84b 100644 --- a/common/grid_tricks.cpp +++ b/common/grid_tricks.cpp @@ -428,10 +428,12 @@ void GRID_TRICKS::paste_text( const wxString& cb_text ) { start_row = cur_row; end_row = cur_row + rows.CountTokens(); + if( end_row > tbl->GetNumberRows() ) end_row = tbl->GetNumberRows(); + start_col = cur_col; - // end_col calculates later + end_col = start_col; // end_col actual value calculates later } for( int row = start_row; row < end_row; ++row ) @@ -449,6 +451,7 @@ void GRID_TRICKS::paste_text( const wxString& cb_text ) if( !is_selection ) { end_col = cur_col + cols.CountTokens(); + if( end_col > tbl->GetNumberCols() ) end_col = tbl->GetNumberCols(); }