Bug 125075 - Applying styles and formatting to tables causes data loss and clear direct formatting inconsistent
Summary: Applying styles and formatting to tables causes data loss and clear direct fo...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.1.5.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: dataLoss
Depends on:
Blocks: Writer-Tables Writer-Tables-Style
  Show dependency treegraph
 
Reported: 2019-05-02 08:13 UTC by Cyp
Modified: 2019-05-03 10:13 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
testcase (13.06 KB, application/vnd.oasis.opendocument.text)
2019-05-03 06:58 UTC, Cyp
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cyp 2019-05-02 08:13:48 UTC
Description:
Not sure whether this is one or two bugs.

Steps to Reproduce:
1. Create a table where some cells contain numbers, using custom paragraph styles in some cells. In particular, choose a pink and bold paragraph style for the cell in the 2nd row and column.
2. Go to Styles and Formatting / Table Styles.
3. Double-click a random format to see what it looks like (such as "Currency 3D").
4. Undo by double-clicking Default Style.
5. Create a new style based on Default Style and update it.
6. Change which cells have which paragraph format.
7. Select some text in a cell and Clear Direct Formatting.
8. Select some cells and Clear Direct Formatting.
9. Goto 7.

Actual Results:
After 3. and 4., table is corrupted with data loss and dollar signs everywhere (if not choosing a currency format, it takes longer to notice the numbers are corrupted). For example, "1.005" changes to "$1.01", but "1.005.000" is uncorrupted (and if entering 1.005.000 and later changing it to 1.005, then it doesn't get corrupted anymore.

After 7., the both the selected text, and every second line (excluding the non-selected text in the same cell as the selected text) in the table turns pink and bold.
After 8., the pink disappears. If repeating 7., it turns pink again.

Expected Results:
Numbers (or something that looks like a number) shouldn't be permanently and silently changed when testing what a style looks like.

Repeatedly doing Clear Direct Formatting shouldn't toggle between pink and black text.


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Cyp 2019-05-02 10:22:52 UTC
Also, note that the table is permanently destroyed, unless right-clicking on individual cells one by one and selecting Number Format and changing to Text (and fixing the data in each cell).

If selecting the whole table and changing the Number Format to Text, it doesn't have any effect, and the Number Format for all cells remains Currency, and the dollar signs still can't be removed manually.
Comment 2 Dieter Praas 2019-05-02 15:08:00 UTC
(In reply to Cyp from comment #0)
> Steps to Reproduce:
> 1. Create a table where some cells contain numbers, using custom paragraph
> styles in some cells. In particular, choose a pink and bold paragraph style
> for the cell in the 2nd row and column.

Thank you for reporting the bug. Please attach such a document, as this makes it easier for us to verify the bug. 
(Please note that the attachment will be public, remove any sensitive information before attaching it)
Comment 3 Cyp 2019-05-03 06:58:57 UTC
Created attachment 151147 [details]
testcase

0. Load testcase.

Wrong number format:
1. Open Styles and Formatting / Table Styles
2. Double-click Currency 3D, then change back to Test Table.
3. See that most cells have changed, and the original data is lost.
4. Select all cells, right-click, choose Number Format, see it's already Text.
5. Try entering 1.000 in a cell, and see it change to $1.00.

0. Then reload testcase to get the data back.

Really weird formatting:
1. Select the 15 cells starting with the "SELECT THIS CELL" cell.
2. Press Ctrl+M to Clear Direct Formatting.
3. Notice 1 bold centred cell and 2 random pink cells.
4. Click on the word "SELECT" (without actually selecting anything).
5. Press Ctrl+M to Clear Direct Formatting again.
6. Notice every second row has a pink cell. The pink cells from before are no longer pink. The "SELECT THESE CELLS" is now bold, with the word "SELECT" pink.
7. Select random cells and Clear Direct Formatting a few times, trying to figure out the pattern.
8. Be really confused.
Comment 4 Dieter Praas 2019-05-03 09:21:06 UTC
(In reply to Cyp from comment #3)
> Created attachment 151147 [details]
> testcase
> 
> 0. Load testcase.
> 
> Wrong number format:
> 1. Open Styles and Formatting / Table Styles
> 2. Double-click Currency 3D, then change back to Test Table.

I can't reproduce it, because I don't have style "Currency 3D"
Comment 5 Cyp 2019-05-03 09:30:33 UTC
If not Currency 3D, then any other table style except Default Style.

It's just more noticeable if it's one of the ones that have Currency in the name, since then it also adds dollar-signs everywhere.
Comment 6 Dieter Praas 2019-05-03 10:13:37 UTC
(In reply to Cyp from comment #3)
> Created attachment 151147 [details]
> testcase
> 
> 0. Load testcase.
> 
> Wrong number format:
> 1. Open Styles and Formatting / Table Styles
> 2. Double-click Currency 3D, then change back to Test Table.
> 3. See that most cells have changed, and the original data is lost.
> 4. Select all cells, right-click, choose Number Format, see it's already
> Text.
> 5. Try entering 1.000 in a cell, and see it change to $1.00.
> 
> 0. Then reload testcase to get the data back.
> 
> Really weird formatting:
> 1. Select the 15 cells starting with the "SELECT THIS CELL" cell.
> 2. Press Ctrl+M to Clear Direct Formatting.
> 3. Notice 1 bold centred cell and 2 random pink cells.
> 4. Click on the word "SELECT" (without actually selecting anything).
> 5. Press Ctrl+M to Clear Direct Formatting again.
> 6. Notice every second row has a pink cell. The pink cells from before are
> no longer pink. The "SELECT THESE CELLS" is now bold, with the word "SELECT"
> pink.
> 7. Select random cells and Clear Direct Formatting a few times, trying to
> figure out the pattern.
> 8. Be really confused.

I tried to confirm it:
...
4. (I can confirm)
5. (I can't confirm => 1.000 doesn't change)

3. (I can confirm)
6.(Almoste every cell is pink)
7. (No further changes, if I Clear direct Formatting)

So in sum I would say that I can confirm, that something strange is going on => NEW