Bug 89254 - XLSX:New lines (CTRL+ENTER) in cells disappear
Summary: XLSX:New lines (CTRL+ENTER) in cells disappear
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.3.5.2 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Markus Mohrhard
URL:
Whiteboard: target:5.1.0
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-09 13:19 UTC by Lyuben Blagoev
Modified: 2016-10-25 19:17 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
XLSX file with new lines disappeared (4.71 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2015-02-09 15:21 UTC, Lyuben Blagoev
Details
Bug appeared again in 5.1.1.3 (5.50 KB, application/vnd.ms-excel)
2016-03-28 05:29 UTC, Lyuben Blagoev
Details
XLSX file in which the new line is missing in Excel (reappear in 5.1.2.2) (4.75 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2016-04-12 05:25 UTC, Lyuben Blagoev
Details
XLS file in which is displayed correctly in Excel (reappear in 5.1.2.2) (5.50 KB, application/vnd.ms-excel)
2016-04-12 05:26 UTC, Lyuben Blagoev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lyuben Blagoev 2015-02-09 13:19:42 UTC
I'm currently using LibreOffice Fresh (version 4.4.0) but the problem appears in LibreOffice Still. 

I have a spreadsheet document, where in each cell I have a header row in bold, and several lines starting with dashes (-) below the header line. The new line between the header row and the second row in each cell disappears when I save and open the spreadsheet again. 

In LibreOffice Fresh, the bug seemed fixed, and new lines are intact when I open the spreadsheet again, but when I open the spreadsheet in LibreOffice Still or in Excel the new lines are gone.
Comment 1 A (Andy) 2015-02-09 14:21:25 UTC
For me not reproducible with a new file (LO 4.4.0.3, Win 8.1).  But maybe it is also a Linux only issue. 

Do you have this bug only with a specific file or can you also reproduce it with a new file?
Could you please give more information how this bug can be reproduced and how such a sample file can be created or otherwise (if there is no confidential content) maybe attach your file as an attachment.
Comment 2 Lyuben Blagoev 2015-02-09 15:09:44 UTC
I have encountered this bug only with one file. Unfortunatelly I can not share the file with you. 

I tried with a new file and also with a modified version of the original file but without success. I couldn't reproduce the problem. 

This bug was the reason I switched to LibreOffice Still few months ago after first installing LibreOffice Fresh (the version of libreoffice-still was 4.2.*). Everithing worked fine until I updated libre office few days ago. Today when I edited the file, the bug appeared again.
Comment 3 Lyuben Blagoev 2015-02-09 15:21:55 UTC
Created attachment 113258 [details]
XLSX file with new lines disappeared

I have just reproduced the problem. I noticed that the original file was in Excel 2007 format (xlsx). I opened one of my test files that I created while trying to reproduce the problem and saved the file in xlsx. Now when I open the xlsx file the new lines are gone.
Comment 4 A (Andy) 2015-02-09 15:37:25 UTC
Thank you very much for your very fast reply and effort!  

I suppose you insert the new line with the keys STRG + ENTER?
Comment 5 Lyuben Blagoev 2015-02-09 15:40:39 UTC
Yes, I insert new lines using Ctrl+Enter.
Comment 6 raal 2015-02-10 07:25:31 UTC
(In reply to Lyuben Blagoev from comment #0)
> I'm currently using LibreOffice Fresh (version 4.4.0) but the problem
> appears in LibreOffice Still. 
> 
> In LibreOffice Fresh, the bug seemed fixed, and new lines are intact when I
> open the spreadsheet again, but when I open the spreadsheet in LibreOffice
> Still or in Excel the new lines are gone.

I can not confirm with LO 4.4, win7
Steps to reproduce:
-open file
- insert empty line ctrl+enter below the header line in cell C1
- save, reopen
 - empty line is correct in LO4.4 and excel2010


I can confirm incompatibility between LO4.4, win7 and excel2010 
Steps to reproduce:
-open file
- insert empty line ctrl+enter below the header line in cell A1
- save, reopen
 - empty line is correct in LO4.4 and disappear in  excel2010

Setting to NEW
Comment 7 Lyuben Blagoev 2015-02-10 07:28:51 UTC
Yep, it looks like working in 4.4 but only looks like. That's why I wrote that it seemed fixed when I updated LO but under the hood it's still doing the things wrong.
Comment 8 Commit Notification 2015-07-06 16:00:14 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=3004221e47918eb08cfa98ba43a23a0b25412cd5

preserve whitespaces here, tdf#88137, tdf#89254

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2015-07-19 20:32:54 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=3b0aae379e77dade4bde1f832225728ce6214816

add unit test for tdf#88137, tdf#89254

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2015-11-05 17:30:29 UTC
Katarina Behrens committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=825f8422bb2cce52bd3095a63de14b34b32ae37c

tdf#88137, tdf#89254: Preserve whitespace also in formatted strings

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 Lyuben Blagoev 2016-02-22 16:00:02 UTC
First of all thank you for your work on this bug.

Yesterday I updated my LibreOffice to the latest version 5.1.0. Today when I tried to edit a file I noticed that the issue with the new lines has been fixed, but the auto wrap setting is lost when I save the file and open it again (both on XLS and XLSX files).

Auto wrap worked fine before the 5.1.0 release (I used the XLS format).
Comment 12 Markus Mohrhard 2016-02-22 16:27:14 UTC
(In reply to Lyuben Blagoev from comment #11)
> First of all thank you for your work on this bug.
> 
> Yesterday I updated my LibreOffice to the latest version 5.1.0. Today when I
> tried to edit a file I noticed that the issue with the new lines has been
> fixed, but the auto wrap setting is lost when I save the file and open it
> again (both on XLS and XLSX files).
> 
> Auto wrap worked fine before the 5.1.0 release (I used the XLS format).

Open a new bug report for it.
Comment 13 Lyuben Blagoev 2016-03-28 05:29:56 UTC
Created attachment 123894 [details]
Bug appeared again in 5.1.1.3
Comment 14 Lyuben Blagoev 2016-04-12 05:23:44 UTC
The issue is still here in 5.1.2.2.

I saved two files (one in .xls and one in .xlsx format). Both looks good when opened in LibreOffice Calc, but when I open them in Excel (Excel 2010) the .xls file looks good, but the new line is not saved correctly in the .xlsx file.

The text is put in the cell is the following: 
Header
- Another line that must wrap

The word 'Header' is bolded. The missing new line is after the word 'Header' before the dash.

I will reopen the task, as there was no any action after my last comment last month.
Comment 15 Markus Mohrhard 2016-04-12 05:24:49 UTC
Open a new bug report. After a developer closes an issue you should not reopen it again.
Comment 16 Lyuben Blagoev 2016-04-12 05:25:07 UTC
Created attachment 124264 [details]
XLSX file in which the new line is missing in Excel (reappear in 5.1.2.2)

The new line after the word "Header" is missing when the file is saved in .xlsx format.
Comment 17 Lyuben Blagoev 2016-04-12 05:26:05 UTC
Created attachment 124265 [details]
XLS file in which is displayed correctly in Excel (reappear in 5.1.2.2)

When saving the file in .xls the new line seems to be saved correctly.
Comment 18 Lyuben Blagoev 2016-04-12 05:32:31 UTC
(In reply to Markus Mohrhard from comment #15)
> Open a new bug report. After a developer closes an issue you should not
> reopen it again.

Aghhh