Bug 136529 - TABLE PROPERTIES: Adding borders to a table cell changes that cell's row height, if "Fit to Size" is enabled for row height
Summary: TABLE PROPERTIES: Adding borders to a table cell changes that cell's row heig...
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.0.0.3 release
Hardware: All All
: low minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Table-Borders
  Show dependency treegraph
 
Reported: 2020-09-07 01:06 UTC by Joao Carvalho
Modified: 2020-09-17 10:29 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
document demonstrating the table issue (11.42 KB, application/vnd.oasis.opendocument.text)
2020-09-10 14:01 UTC, Joao Carvalho
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joao Carvalho 2020-09-07 01:06:40 UTC
Description:
When I add a border to a table's cell, the row height of that cell is increased.

Steps to Reproduce:
1. Click menu "Table", then "Insert Table"; insert a 2x2 table and select "None" for Style.
2. Click on any cell of the new table.
3. Click on the "Borders" button on the table-editing toolbar; add a border to the cell.

Actual Results:
The border is added to the cell, but the row height is considerably increased. Also, if the column width is set to minimal, you will need to increase the column width, otherwise the text won't fit in the cell.

Expected Results:
Row height should not change when a border is added. The column width should fit the same amount of text after a border is added.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.0.0.3
Build ID: 8061b3e9204bef6b321a21033174034a5e2ea88e
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Calc: threaded
Comment 1 Joao Carvalho 2020-09-07 01:10:27 UTC
The row height changes even when only vertical borders are added.

The column's max text capacity is reduced even when only horizontal borders are added.
Comment 2 Dieter 2020-09-09 06:11:09 UTC
I confirm the behaviour, but it only happens, if row height is set to "Fit to Size".

I'm not sure, if this is the expected result or not.
Comment 3 Timur 2020-09-09 08:53:21 UTC
(In reply to Joao Carvalho from comment #0)
> the row height is considerably increased. 
No, it's a slight increase seen only with an empty or small height cell. 
I checked MSO, similar behavior. 
Not worth a bug. 

> Also, if the column width is set to minimal, you will need to
> increase the column width, otherwise the text won't fit in the cell.
> 
> Expected Results:
> The column width should fit the same amount of text after a border is added.
Please attach a sample for this.
Comment 4 Dieter 2020-09-09 09:45:38 UTC
Row height changes, because padding of table cell changes from 0,00cm to 0,05cm, if you add a border. If you add a border and changes padding to 0,00cm row height remains.

So question is: Should padding change automatically?
Comment 5 Joao Carvalho 2020-09-10 14:01:09 UTC
Created attachment 165366 [details]
document demonstrating the table issue

Here is a document with some tables that illustrate the described problems.
Comment 6 Joao Carvalho 2020-09-10 14:01:49 UTC Comment hidden (obsolete)
Comment 7 Joao Carvalho 2020-09-10 14:07:09 UTC
(In reply to Dieter from comment #2)
> I confirm the behaviour, but it only happens, if row height is set to "Fit
> to Size".

If you uncheck "Fit to Size", then set row height so that the text fits narrowly, and then add a border, the bottom of the text gets cropped.
Comment 8 Joao Carvalho 2020-09-10 15:09:56 UTC
(In reply to Dieter from comment #4)
> Row height changes, because padding of table cell changes from 0,00cm to
> 0,05cm, if you add a border. If you add a border and changes padding to
> 0,00cm row height remains.

Bingo. This solved it for me.

> So question is: Should padding change automatically?

Maybe padding should be added only where there is a border.

For example, if you add one horizontal line to the top edge of a table, the horizontal and vertical padding is increased across the entire table. If it is a table with many rows and columns, this makes the table much taller and wider.

This doesn't happen in MS Word 2010: if you add one very thick horizontal border to a row, you notice a shift, but the table does not get significantly taller nor wider.

In LibreOffice Writer, I first noticed this behavior when trying to add a vertical line to a academic-style table. This table style has horizontal lines on the top and on the bottom edges of the table, but no vertical lines. When I added one single vertical line to that table, horizontal and vertical padding was increased across the entire table, and the table got much taller than I wanted it to be!
Comment 9 Joao Carvalho 2020-09-10 15:29:53 UTC
(In reply to Dieter from comment #4)
> If you add a border and changes padding to
> 0,00cm row height remains.

When I add a border and then look at the table properties, it incorrectly says padding is still set 0,00cm, so I can't reduce it directly to fix the table height. But, if I increase it to something like 0,10cm, hit ok, then decrease back to 0,00cm, the row height returns to what it was before adding the border.
Comment 10 Heiko Tietze 2020-09-17 10:29:01 UTC
(In reply to Joao Carvalho from comment #8)
> Bingo. This solved it for me.

I would rather not touch the auto padding. Haven't seen any complaint in the past, and it might feel as a regression for many users. So better resolve as NAB.
 
(In reply to Joao Carvalho from comment #9)
> When I add a border and then look at the table properties, it incorrectly
> says padding is still set 0,00cm...

Padding changes to 0.5cm if you either click one of the presets or any user-defined borders. Pretty clear to me.