Correctly handle hidden columns when pasting into grids.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14844
(cherry picked from commit f9fd37c4ca
)
This commit is contained in:
parent
8942abfc64
commit
cb7aa5143b
|
@ -726,18 +726,16 @@ void GRID_TRICKS::paste_text( const wxString& cb_text )
|
||||||
wxStringTokenizer cols( rowTxt, COL_SEP, wxTOKEN_RET_EMPTY );
|
wxStringTokenizer cols( rowTxt, COL_SEP, wxTOKEN_RET_EMPTY );
|
||||||
|
|
||||||
if( !is_selection )
|
if( !is_selection )
|
||||||
{
|
|
||||||
end_col = cur_col + cols.CountTokens();
|
end_col = cur_col + cols.CountTokens();
|
||||||
|
|
||||||
if( end_col > tbl->GetNumberCols() )
|
for( int col = start_col; col < end_col && col < tbl->GetNumberCols(); ++col )
|
||||||
end_col = tbl->GetNumberCols();
|
|
||||||
}
|
|
||||||
|
|
||||||
for( int col = start_col; col < end_col; ++col )
|
|
||||||
{
|
{
|
||||||
// Skip hidden columns
|
// Skip hidden columns
|
||||||
if( !m_grid->IsColShown( col ) )
|
if( !m_grid->IsColShown( col ) )
|
||||||
|
{
|
||||||
|
end_col++;
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// If number of selected cols is larger than the count of cols on the clipboard,
|
// 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.
|
// paste again and again until the end of the selection is reached.
|
||||||
|
|
Loading…
Reference in New Issue