Bug 103829 - FILESAVE: Tab characters lost in cell
Summary: FILESAVE: Tab characters lost in cell
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.2 all versions
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:7.5.0
Keywords: bibisected, regression
: 98815 106350 117001 119056 (view as bug list)
Depends on:
Blocks: Calc-Cells
  Show dependency treegraph
 
Reported: 2016-11-10 13:33 UTC by michael.letzgus
Modified: 2022-09-22 14:24 UTC (History)
15 users (show)

See Also:
Crash report or crash signature:


Attachments
Demo file (9.98 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-11-12 11:02 UTC, michael.letzgus
Details
Demo text with tabs (397 bytes, text/plain)
2016-11-12 11:02 UTC, michael.letzgus
Details
Spreadsheet example w/ instructions in cell A1 (16.66 KB, application/octet-stream)
2019-09-03 21:40 UTC, James D Howard
Details
TabTestRT71.ods: used this to bibisect FILEOPEN - same commit range found (23.46 KB, application/vnd.oasis.opendocument.spreadsheet)
2022-09-10 12:17 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description michael.letzgus 2016-11-10 13:33:57 UTC
When saving a calc document leading tabstops inside cells are lost.

How to reproduce:

1. New document
2. Insert large portion of e.g. python code into one cell
3. Save the document
4. Reload the document

Now all leading tabstops are gone...


Michael
Comment 1 Joel Madero 2016-11-12 04:31:17 UTC
Please attach a sample document and then set it to UNCONFIRMED.
Comment 2 michael.letzgus 2016-11-12 11:02:26 UTC
Created attachment 128691 [details]
Demo file
Comment 3 michael.letzgus 2016-11-12 11:02:55 UTC
Created attachment 128692 [details]
Demo text with tabs
Comment 4 michael.letzgus 2016-11-12 11:04:04 UTC
Created testcase.

Not only the leading tabs are lost, ALL tabs are missing after saving/re-opening.
Comment 5 Xisco Faulí 2016-11-14 14:14:27 UTC
Confirmed in

- Version: 5.3.0.0.alpha1+
Build ID: 757a60d01dd152aadab2ba3c8224252481ce8a88
CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; VCL: gtk2; Layout
Engine: new; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group

- Version: 4.2.0.0.alpha1+
Build ID: fc8f44e82de4ebdd50ac5fbb9207cd1a59a927e3

- Version: 4.1.0.0.alpha1+
Build ID: a2c9d4f8bbde97f175bae4df771273a61251f40

But not in 

Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)
Comment 6 Xisco Faulí 2016-11-14 14:28:21 UTC
it looks this issue was introduced in range https://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=7b384313399ee8199cd7241527c3dbc1d50694a2..9e15d9e76d1fd542378a997e27175ca98dd3e558 where there're some commits made by Kohei Yoshida so probably one of those is the responsable.
Comment 7 Markus Mohrhard 2016-11-26 21:22:16 UTC
Comment on attachment 128691 [details]
Demo file

The test file is useless. There are no tabs in the file.
Comment 8 michael.letzgus 2016-11-26 22:37:36 UTC
You should have read the instruction inside the file, cell C6.
There is also an explanation why there are no tabs in the file: Due to the bug!
So please follow the instructions, insert some tabs (the second attachment) and save&reload the file.
And yes - it's quite useless as a working testcase... but someone asked for some testcase. So the "testcase" gives some instructions to make it work.
Comment 9 Thomas Lendo 2017-06-12 20:42:15 UTC
*** Bug 98815 has been marked as a duplicate of this bug. ***
Comment 10 Xisco Faulí 2017-06-12 21:48:21 UTC
Another way to reproduce it: https://bugs.documentfoundation.org/show_bug.cgi?id=98815#c0
Comment 11 Xisco Faulí 2017-10-28 18:24:23 UTC
*** Bug 106350 has been marked as a duplicate of this bug. ***
Comment 12 Buovjaga 2018-09-01 16:19:02 UTC
*** Bug 119056 has been marked as a duplicate of this bug. ***
Comment 13 QA Administrators 2019-09-02 09:20:06 UTC Comment hidden (obsolete)
Comment 14 Thomas Lendo 2019-09-02 11:09:21 UTC
Still reproducible.
Version: 6.4.0.0.alpha0+ (x64)
Build-ID: 41cd3e8e817c8c33a13608e62eeb06ce2c6977e4
CPU-Threads: 12; BS: Windows 10.0; UI-Render: GL; VCL: win; 
TinderBox: Win-x86_64@62-TDF, Branch:master, Time: 2019-09-01_22:04:10
Gebietsschema: de-AT (de_AT); UI-Sprache: de-DE
Comment 15 James D Howard 2019-09-03 21:40:25 UTC
Created attachment 153848 [details]
Spreadsheet example w/ instructions in cell A1

Follow instructions in this .ODS spreadsheet in cell A1 to be able to reproduce the issue.  Use of an outside editor - like LeafPad or vim - is also needed.
Comment 16 James D Howard 2019-09-03 21:42:56 UTC
Example per comment 15 - "TabTest.ods" - was tested with Version: 6.2.6.2
Build ID: 6.2.6.2-2.fc30
Comment 17 QA Administrators 2021-09-03 04:02:39 UTC Comment hidden (obsolete)
Comment 18 Faisal 2022-08-16 23:45:13 UTC
Regression still reproducible.

Version: 7.3.5.2 / LibreOffice Community
Build ID: 30(Build:2)
CPU threads: 4; OS: Linux 5.15; UI render: default; VCL: kf5 (cairo+xcb)
Locale: en-GB (en_US.UTF-8); UI: en-US
7.3.5-1
Calc: threaded
Comment 19 Justin L 2022-09-10 12:17:12 UTC
Created attachment 182348 [details]
TabTestRT71.ods: used this to bibisect FILEOPEN - same commit range found

repro 7.5+

I got the same bibisect-41max results as Xisco:
https://cgit.freedesktop.org/libreoffice/core/log/?id=84fefd7c295fc05499ca222dff50c2fe4e0fb27e&qt=range&q=7b384313399ee8199cd7241527c3dbc1d50694a2..ca4cbae35630cc314d33cc7ad9bea36063097fa5

This affects both file-open and file-save AFAICS.
Comment 20 Justin L 2022-09-10 20:37:51 UTC
FILEOPEN is the problem in 4.1. The tab is an XML property
<text:p>
  <text:tab/>
  This line should have ONE leading tab
</text:p>
Proposed import fix at http://gerrit.libreoffice.org/c/core/+/139757

FILESAVE breaks in 4.2 with
commit 882bee5ede38b6ed4e1ec870d835546868c6586d
Author: Kohei Yoshida on Sat Aug 24 23:24:13 2013 -0400
    tdf#60740: Export edit cells to ods without using UNO API.
Comment 21 Justin L 2022-09-11 01:31:04 UTC
display tabs is really hit or miss.
1.) if just normal text (not editeng), then tabs not seen (except when editing)
2.) if multi-line (automatically editeng), then it looks ok
3.) except on a round-trip, when importing the tab-less office:string-value causes editeng display issues somehow.

simple round-trip (for editeng text) fix is at
http://gerrit.libreoffice.org/c/core/+/139761
Comment 22 Justin L 2022-09-12 16:28:00 UTC
(In reply to Justin L from comment #21)
> 3.) except on a round-trip, when importing the tab-less office:string-value
> causes editeng display issues somehow.
For this particular string (with \x001 instead of \x9), the fix for 70275 looks like a regression...
Comment 23 Justin L 2022-09-12 17:36:55 UTC
*** Bug 117001 has been marked as a duplicate of this bug. ***
Comment 24 Commit Notification 2022-09-12 23:43:21 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/690a35680adad07c4ab79d82cd1531bb82fe4bc1

tdf#103829 ods import: parse <text:tab/>

It will be available in 7.5.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 25 Commit Notification 2022-09-14 23:48:28 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

tdf#103829 ods export: output <text:tab/> when CELLTYPE_EDIT

It will be available in 7.5.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 26 Commit Notification 2022-09-15 22:55:09 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

tdf#103829 ods export: don't output invalid office:string-value

It will be available in 7.5.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 27 Justin L 2022-09-16 14:01:07 UTC
Confirmed duplicate bugs are also fixed.
-bug 106350 with TabTest.xls and TabTest.ods
-bug 117001 with Text_to_Columns.ods and Text_to_Columns._test_tabs_from_scratch.ods
Comment 28 Buovjaga 2022-09-22 14:24:23 UTC
*** Bug 114398 has been marked as a duplicate of this bug. ***