Don't paste into hidden columns.

Fixes https://gitlab.com/kicad/code/kicad/issues/10168
This commit is contained in:
Jeff Young 2022-02-18 17:11:57 +00:00
parent 8a22dab83d
commit c27ec5cae1
1 changed files with 8 additions and 6 deletions

View File

@ -643,9 +643,8 @@ void GRID_TRICKS::paste_text( const wxString& cb_text )
for( int row = start_row; row < end_row; ++row )
{
// If number of selected rows bigger than count of rows in
// the clipboard, paste from the clipboard again and again
// while end of the selection is reached.
// If number of selected rows is larger than the count of rows on the clipboard, paste
// again and again until the end of the selection is reached.
if( !rows.HasMoreTokens() )
rows.SetString( cb_text, ROW_SEP, wxTOKEN_RET_EMPTY );
@ -663,9 +662,12 @@ void GRID_TRICKS::paste_text( const wxString& cb_text )
for( int col = start_col; col < end_col; ++col )
{
// If number of selected columns bigger than count of columns in
// the clipboard, paste from the clipboard again and again while
// end of the selection is reached.
// Skip hidden columns
if( !m_grid->IsColShown( col ) )
continue;
// If number of selected cols is larger than the count of cols on the clipboard,
// paste again and again until the end of the selection is reached.
if( !cols.HasMoreTokens() )
cols.SetString( rowTxt, COL_SEP, wxTOKEN_RET_EMPTY );