Bug 143005 - New line (LF) are lost when pasting text into Calc
Summary: New line (LF) are lost when pasting text into Calc
Status: RESOLVED DUPLICATE of bug 128513
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.1.4.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-23 13:19 UTC by Silvain Dupertuis
Modified: 2021-08-17 14:58 UTC (History)
1 user (show)

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 Silvain Dupertuis 2021-06-23 13:19:54 UTC
Description:
Pasting text into Calc does not preserve end of lines ([LF] = newline = \n)
=============================================================================
Calc is the ideal way to export/import data between Base and other databases
but newline characters in long text fields are all lost when exporting from a table or a query. I have imported Data from Access databases with no problem except for these [LF] characters in Memo fields lost in the target Base table.
===
It seams to be a problem of calc.
- [LF] can appear in a cell, and can be copied-pasted from Calc to Base or Writer (in this last case, it becomes an end of paragraph).
- But it is lost when pasting into calc (whatever the source, external or another calc cell) 

Steps to Reproduce:
1. Create text with a newline (for exemple in Writer)
2. Copy-paste into a Calc cell
3.

Actual Results:
Newline lost
Example:
Nickname=Bob A very tall guy

Expected Results:
Newline should be there
Example:
Nickname=Bob
A very tall guy


Reproducible: Always


User Profile Reset: No



Additional Info:
This is an old problem which I never see mentioned anywhere-
I am working with Linux (Ubuntu), but I also have a Windows installation, and I did not check if it is the same in Windows.
Comment 1 V Stuart Foote 2021-06-23 14:35:05 UTC
Not quite true. There are multiple paste modes for Calc

Here for pasting text you have two to consider:

1.) when the cell is simply focused by data cursor

2.) when the editshell text cursor is positioned into the cell

A 'paste special' of text will include the LF for 2).  For 1) it will launch the text import dialog.  So it is possible to paste multi-line passage with LF. Just depends on the focus type.

But not clear your work flow would do anthing but what it does as only the cell cursor focus happens, not the editshell text cursor focus.
Comment 2 Silvain Dupertuis 2021-06-24 14:15:44 UTC
You are right, [LF] is actually pasted when the EditShell is positioned into the cell (but not if the editshell is in the formula entering space in the upper bar,
and not if the cell is just selected)

Actually, the problem arouse for me when
using Calc as an interchange format for databases
In this case, [LF] in blob / long text fields are lost in the process.

I encountered the problem a long time ago when I switched to Linux,
and created or recreated several databases, importing data from my old Access bases with long multiline text notes in a specific field.

Presently I am exchanging data on a regular bases between Base and MySQL.
It is very fast and efficient using Calc and link with my Base databases.
I would expect these [LF] to be preserved in the process, bud did not find a way to get them.
Comment 3 Timur 2021-08-17 14:58:01 UTC
This one is status Unconfirmed. 
I didn't test but seems similar so I'll mark duplicate. 
Please follow up that bug in case it gets fix.

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