Bug 145920 - Applying a table style overwrites paragraph style within the table with paragraph direct formatting
Summary: Applying a table style overwrites paragraph style within the table with parag...
Status: RESOLVED DUPLICATE of bug 104389
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.2.2.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Clear-Formatting Writer-Tables-Style Table-AutoFormat
  Show dependency treegraph
 
Reported: 2021-11-27 18:38 UTC by jsv
Modified: 2022-04-21 14:24 UTC (History)
2 users (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 jsv 2021-11-27 18:38:11 UTC
Description:
# Part I: Preparation

1. Create a 3x3 table by using the button on the "Standard" toolbar.

2. Fill it with the text as follows:

   -------------------------
   | Cell1 | Cell2 | Cell3 |
   -------------------------
   | Cell4 | Cell5 | Cell6 |
   -------------------------
   | Cell7 | Cell8 | Cell9 |
   -------------------------

3. Remove horizontal borders except the first and the last:

   -------------------------
   | Cell1 | Cell2 | Cell3 |
   | Cell4 | Cell5 | Cell6 |
   | Cell7 | Cell8 | Cell9 |
   -------------------------

4. Open the Styles pane. Select the your table and click "New Style from Selection" on the Style pane. Call it "My Table Style".

# Part II: Issues

5. Repeat the first step to create another one table.

6. Apply the "Table Heading" paragraph style to its first row, so that the text in its first row is now bold and centered.

7. Apply the "My Table Style" to the table itself. Now you see the first issue: The paragraph style of the first row has changed from "Table Heading" back to "Table Contents"

8. Try to enforce the "Table Heading" style: apply it for the second time. Then add or remove some row or column: ooops, your "Table Heading" was changhed nack to "Table Contents" again.

# Part III: So what is wrong?

There are two issues (as you see above), but they are just one single problem. This problem is that Writer treats paragraph formatting as a part of table styles, and this is conceptually wrong.

Practically, since we often need to have tables that look the same (e.g., no horizontal lines, or maybe no vertical lines) but some of these tables should have a heading row and some of them should not have a heading row, we need to have **two** table styles that are completely identical except of whether the style formats the first row of tables as "Table Heading" or as "Table Contents".

FWIW, Microsoft Word have a very clear way to create table styles, and as far as I remember, there are no such issues there. It can be used as a reference.

Steps to Reproduce:
See above

Actual Results:
See above

Expected Results:
See above


Reproducible: Always


User Profile Reset: No



Additional Info:
See above
Comment 1 Dieter 2021-12-12 08:00:27 UTC
(In reply to jsv from comment #0)
> 7. Apply the "My Table Style" to the table itself. Now you see the first
> issue: The paragraph style of the first row has changed from "Table Heading"
> back to "Table Contents"

I can't confirm that with

Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 2934472ab888ebfe64a153984af2902fac63a7a0
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL

Change of table style doesn't change paragraph style


Could you please retest in SafeMode (Help -> Restart in SafeMode)?
=> NEEDINFO
Comment 2 jsv 2022-01-04 00:50:26 UTC
> Change of table style doesn't change paragraph style

Dieter, it seems you have probably misunderstood me. I haven't talked about changing the table style. I talked about applying it.

Just tested with a new verion of LO, in safe mode. The results are the same.

Version: 7.2.4.1 (x86) / LibreOffice Community
Build ID: 27d75539669ac387bb498e35313b970b7fe9c4f9
CPU threads: 4; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded
Comment 3 jsv 2022-01-04 00:56:38 UTC
Here is a simpler test.

part 1

1. Create a 3x3 table with no style. 
2. Type "Foo" in the first cell. Apply the "Title" style to it. The text is now large.
3. Apply the "Academic" style to the table. The text is now small. (Bad!)

part 2

4. Try to workaround this by applying the "Title" style again.
5. Insert a row or colum to your table. You will see that the text in the 1st cell is small again. (Bad! Your workaround doesn't work)
Comment 4 jsv 2022-01-04 01:00:14 UTC
So,

the first issue is that **applying** the table style resets paragraph styles.

the second issue is that if you have applied a table style, further adding/removing rows/columns resets paragraph styles will re-apply the table style again, which leads you back to the first issue
Comment 5 QA Administrators 2022-01-04 03:32:37 UTC Comment hidden (obsolete)
Comment 6 Dieter 2022-01-04 07:56:37 UTC
(In reply to jsv from comment #3)
> Here is a simpler test.
> 1. Create a 3x3 table with no style. 
> 2. Type "Foo" in the first cell. Apply the "Title" style to it. The text is
> now large.

Thank you for test. Now I can reproduce the problem with

Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 9c95415de877af1430ab5b7123e11dedd0ea622c
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL

If you open style inspector, you can see, that paragraph style is still "Title" (paragraph style is also highlighted in style list), but there is paragraph direct formatting and it's not possible to remove it with Strg+m.
=> I changed bug summary a bit.
Comment 7 Dieter 2022-01-04 08:14:32 UTC
Perhaps this bug could be treated as duplicate of bug 104389 (but I'm not sure for 100%). If it is difficult to fix the bug, it should at least be possible to clear direct formatting.
Comment 8 Dieter 2022-01-04 08:37:25 UTC
Workaround for Clear Direct Formatting:
1. Select table and at least one paragraph outside table
2. Strg+M
Comment 9 John 2022-01-08 13:54:24 UTC
(In reply to Dieter from comment #6)
> (In reply to jsv from comment #3)
> > Here is a simpler test.
> > 1. Create a 3x3 table with no style. 
> > 2. Type "Foo" in the first cell. Apply the "Title" style to it. The text is
> > now large.
> 
> Thank you for test. Now I can reproduce the problem with
> 
> Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
> Build ID: 9c95415de877af1430ab5b7123e11dedd0ea622c
> CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL:
> win
> Locale: de-DE (de_DE); UI: en-GB
> Calc: CL
> 
> If you open style inspector, you can see, that paragraph style is still
> "Title" (paragraph style is also highlighted in style list), but there is
> paragraph direct formatting and it's not possible to remove it with Strg+m.
> => I changed bug summary a bit.

It seems this bug is related to https://bugs.documentfoundation.org/show_bug.cgi?id=144638
Comment 10 Dieter 2022-04-11 06:45:18 UTC
*** Bug 148199 has been marked as a duplicate of this bug. ***
Comment 11 Timur 2022-04-21 13:49:12 UTC
(In reply to Dieter from comment #7)
> Perhaps this bug could be treated as duplicate of bug 104389 (but I'm not
> sure for 100%). 

Yes.

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