Bug 142561 - Editing: Enable unformated text copy of Calc cells containing line breaks
Summary: Editing: Enable unformated text copy of Calc cells containing line breaks
Status: RESOLVED DUPLICATE of bug 119928
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-30 02:22 UTC by Patch
Modified: 2021-08-18 03:45 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patch 2021-05-30 02:22:37 UTC
Description:
Unformatted text copy of a Calc spreadsheet in which some cells contain line breaks results in the intra-cell line break being replaced by a space. It would be preferable if Calc used a clipboard format which retained the line break.

In more detail
Calc supports unformated text clipboard paste with cells containing linefeed or carriage return characters. Quoting is used to prevent intra-cell line breaks being interpreted as end of row markers.

Calc can save a sheet in Text CSV format with cells containing intra-cell line breaks. The Field delimiter can be set to {Tab} and String delimiter to “. Quoting is used to prevent intra-cell line breaks being interpreted as end of row markers.

In contrast when a clipboard copy is done, instead of using the above Text CSV format, Calc replaces the intra-cell line breaks with space and does not use any quoting. Resulting in data corruption when pasting Plane text into LibreOffice or other applications.

By comparison both Microsoft Excel and Google Sheets preserve intra-cell line breaks during plan text copy and paste.

Steps to Reproduce:
1. Open a new calc document
2. In a cell type: Hello<shift><enter>World
3. Copy the cell and surrounding

Actual Results:
4. In calc use paste special text only or paste in an application which accepts only text

Expected Results:
5. Paste result has line feed replaced by <space>


Reproducible: Always


User Profile Reset: No



Additional Info:
6. Ideally libreOffice calc should behave the same as cvs file export format. When a cell contains a special character such as linefeed, the character should be retained and quoting added to identify the linefeed is part of the cell contents rather than starting a new row. This would enable unformated paste of multi-line cells within LibreOffice and also into third party applications

See also https://ask.libreoffice.org/en/question/311810/enable-unformated-text-copy-of-calc-cells-containing-line-breaks/
Comment 1 Patch 2021-05-30 09:39:33 UTC
Edit for readability:
Items 4. 5. 6. should all be moved one heading up the page i.e.
Steps to Reproduce: ... 4.
Actual Results: 5. 
Expected Results: 6.
Additional Info: See also ..
Comment 2 Patch 2021-06-06 04:59:47 UTC
Calc to Calc works as expected
1) Select Cells containing a LF character
2) Copy
3) Mouse right click -> Paste Special -> Unformatted Text
4) Line feed shown preserved in the "Text Import" Dialogue box

However it fails if paste text only to another application such as  LibreOffice Writer, or Windows WordPad
1) In Calc select cells containing a LF character
2) Copy
3) In LO Writer or Windows WordPad Menu bar Paste -> Paste Special -> unformatted text or in LO Writer Right click Paste Special -> Unformatted text or Menu Paste special unformatted text 
4) Line feed is replaced by a space character


Similarly fails if paste into a text only application such as Windows NotePad
1) In Calc select cells containing a LF character
2) Copy
3) In NotePad Paste 
4) Line feed is replaced by a space character
Comment 3 Timur 2021-08-17 15:20:04 UTC
Seems duplicate, please explain if not. And search before reporting.

*** This bug has been marked as a duplicate of bug 119928 ***