Bug 118470 - Calc doesn't display correctly some newline and carriage return characters written by OOXML (e.g. _x000D_)
Summary: Calc doesn't display correctly some newline and carriage return characters wr...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: low minor
Assignee: Dennis Francis
URL:
Whiteboard: target:7.3.0
Keywords:
: 135311 138477 (view as bug list)
Depends on:
Blocks: XLSX
  Show dependency treegraph
 
Reported: 2018-06-30 09:54 UTC by Marcos F
Modified: 2023-05-08 22:11 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
screenshot (21.18 KB, image/png)
2018-06-30 10:00 UTC, Marcos F
Details
to reproduce the described error (4.98 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2018-06-30 10:01 UTC, Marcos F
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcos F 2018-06-30 09:54:47 UTC
Description:
The hex strings "_x000D_" get shown inside Calc cells.
They should be converted and treated as an special character "\r".

Steps to Reproduce:
It's necessary to generate an Excel (XLSX; OOXML) file containing carriage return and newline characters inside the cells.
It's not possible to generate directly with Excel, since it deletes the "\r" symbols.

It's necessary to generate it with a library or to edit the "sheet1.xml" inside the OOXML file.

I generated those XLSX file from a R-lang library:
https://github.com/ropensci/writexl/issues/22


Actual Results:
The hex string "_x000D_" gets shown inside the cells.

Expected Results:
It was expected to transform the hex string "_x000D_" to a real carriage return inside the cell.
Or, at least, to delete the string "_x000D_".


Reproducible: Always


User Profile Reset: No



Additional Info:
It should check if there is a newline character "\n" just after the "_x000D_" string. And then delete the "_x000D_" string from the cell.

If there is a "_x000D_" string without a "\n" after, it should transform it into a newline char.
Comment 1 Marcos F 2018-06-30 10:00:25 UTC
Created attachment 143225 [details]
screenshot
Comment 2 Marcos F 2018-06-30 10:01:21 UTC
Created attachment 143226 [details]
to reproduce the described error
Comment 3 Buovjaga 2018-07-13 19:58:34 UTC
Confirmed.

Arch Linux 64-bit
LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4

Arch Linux 64-bit
Version: 6.2.0.0.alpha0+
Build ID: bd394492c165d27c96a44495d9ca694a242acb8f
CPU threads: 8; OS: Linux 4.17; UI render: default; VCL: gtk3; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group threaded
Built on July 11th 2018
Comment 4 QA Administrators 2019-07-14 02:48:11 UTC Comment hidden (obsolete)
Comment 5 Eike Rathke 2020-08-05 21:32:36 UTC
*** Bug 135311 has been marked as a duplicate of this bug. ***
Comment 6 Andras Timar 2021-01-26 11:49:52 UTC
*** Bug 138477 has been marked as a duplicate of this bug. ***
Comment 7 Commit Notification 2021-08-18 18:29:15 UTC
Dennis Francis committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2d5ba784a341aea1b7b2403842d2521d1548ea8f

tdf#118470: sc oox: recover escaped unicode chars in strings import

It will be available in 7.3.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2021-08-18 18:29:29 UTC
Dennis Francis committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/d1d6c1535e51ef364a71d3d4c5bd331af88fce32

tdf#118470: unit test for escaped unicode chars in strings import

It will be available in 7.3.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 9 Daniel Rentz 2022-06-07 12:02:04 UTC
follow-up bug 149477
Comment 10 Eike Rathke 2023-05-08 22:11:24 UTC
Note: implementation has been replaced by oox::AttributeConversion::decodeXString() with commit 96965871f4cd2e4afbdf3bcae9dc0c43d1543e1d.