From fb8756e03b6255a41253af6b14e83d3253bf42af Mon Sep 17 00:00:00 2001 From: wp_xyz Date: Mon, 6 Nov 2023 18:36:49 +0100 Subject: [PATCH] LCL/Grids: Add grid option goCopyWithoutTrailingLinebreak to avoid copying cells to the clipboard with trailing linebreak. --- lcl/grids.pas | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lcl/grids.pas b/lcl/grids.pas index bc4f5578cc..46b178e4a1 100644 --- a/lcl/grids.pas +++ b/lcl/grids.pas @@ -123,7 +123,8 @@ type goScrollToLastCol, // Allow scrolling to last column (so that last column can be LeftCol) goScrollToLastRow, // Allow scrolling to last row (so that last row can be TopRow) goEditorParentColor, // Set editor's ParentColor to True - goEditorParentFont // Set editor's ParentFont to True + goEditorParentFont, // Set editor's ParentFont to True + goCopyWithoutTrailingLinebreak // Copy to clipboard without trailing linebreak ); TGridOptions2 = set of TGridOption2; @@ -11565,7 +11566,8 @@ begin SelStr := SelStr + #9; end; - SelStr := SelStr + sLineBreak; + if (aRow < R.Bottom) or not (goCopyWithoutTrailingLinebreak in FOptions2) then + SelStr := SelStr + sLineBreak; SelHTMLStr := SelHTMLStr + '' + #13#10; end; SelHTMLStr := SelHTMLStr + #13#10 + '';