From 55ffa472c66c00a7ee3222b48147b2fea839dfc6 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 23 Apr 2025 18:41:58 +0100 Subject: [PATCH] Only add row separator between rows. Fixes https://gitlab.com/kicad/code/kicad/-/issues/20494 (cherry picked from commit 4f83674b62a4e3ba3271ded301a6dbc665a5e186) --- common/grid_tricks.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/grid_tricks.cpp b/common/grid_tricks.cpp index 08b156272d..3a978a4c23 100644 --- a/common/grid_tricks.cpp +++ b/common/grid_tricks.cpp @@ -854,6 +854,9 @@ void GRID_TRICKS::cutcopy( bool doCopy, bool doDelete ) // fill txt with a format that is compatible with most spreadsheets for( int row = m_sel_row_start; row < m_sel_row_start + m_sel_row_count; ++row ) { + if( !txt.IsEmpty() ) + txt += ROW_SEP; + for( int col = m_sel_col_start; col < m_sel_col_start + m_sel_col_count; ++col ) { if( !m_grid->IsColShown( col ) ) @@ -872,8 +875,6 @@ void GRID_TRICKS::cutcopy( bool doCopy, bool doDelete ) tbl->SetValue( row, col, wxEmptyString ); } } - - txt += ROW_SEP; } if( doCopy )