Bug 134881 - Writer: Table: Adjust columns proportionally - not working as it should
Summary: Writer: Table: Adjust columns proportionally - not working as it should
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:7.2.0
Keywords:
Depends on:
Blocks: Writer-Table-Properties-Dialog
  Show dependency treegraph
 
Reported: 2020-07-16 19:16 UTC by BogdanB
Modified: 2021-01-04 11:40 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
video showing the bug (2.30 MB, video/mp4)
2020-07-16 19:17 UTC, BogdanB
Details
Screencast (535.64 KB, video/mp4)
2020-07-17 20:08 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description BogdanB 2020-07-16 19:16:45 UTC
Description:
When applying "Adjust columns proportionally" to a column, this "will result in all columns changing their widths by the same percentage when one is changed" (LibreOffice Writer Guide page 283)

In my video example you can see I have a 4cm+8cm columns. And reducing by 50% would mean having a 2cm+4cm table, in fact I would have a 2cm+6cm.

Now it is reducing by the same amount, not by the same percentage.

Steps to Reproduce:
1. See description and video
2.
3.

Actual Results:
2cm + 6cm

Expected Results:
2cm + 4cm


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Version: 6.4.5.2
Build ID: a726b36747cf2001e06b58ad5db1aa3a9a1872d6
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3; 
Locale: ro-RO (ro_RO.UTF-8); UI-Language: en-US
Calc: threaded
Comment 1 BogdanB 2020-07-16 19:17:09 UTC
Created attachment 163133 [details]
video showing the bug
Comment 2 BogdanB 2020-07-16 19:27:02 UTC
Steps to reproduce:
1. create a new document an a new table and center it (in order NOT to be automatic alignment)
2. Go to Table tab: 12 cm width
3. Go to Columns tab: set first to 4, and the last one will be 8
4. Check "Adjust columns proportionally" and try to set first column to 2 cm
5. See what the value of the second column is.
Comment 3 Timur 2020-07-17 19:42:31 UTC
(In reply to BogdanB from comment #2)
> 4. Check "Adjust columns proportionally" and try to set first column to 2 cm
If I just check and OK and open Properties again, it's unchecked. Not sure if it should survive, bug 41817.
I add bug 100537 to See Also.

I'll conform although I'm not sure. But this is either a LO or documentation bug.
Comment 4 Telesto 2020-07-17 20:08:23 UTC
Created attachment 163207 [details]
Screencast

Is this what you would expect?
Comment 5 BogdanB 2020-07-18 05:27:12 UTC
Yes, this would be the correct behaviour. 

So, the formula for each cell should be:
X*0,5 Y*0,5

But now it is:
X-4  y-4


It get the difference by value, not the difference by percent. I supose it is a minor value to change in the code.


Now, this is not proportional, except the case with all cells the same width, when whatever number we change, all will change with the same amount, proproritinalyy and also by minus. Your video proves that when tested on corner cases this works well, but this are only exception. Majority of tables do not have equal cells.
Comment 6 BogdanB 2020-07-18 06:03:34 UTC
In fact now the formula is:

(reduce/increase) size by (*value diference* of the first value and the introduced one)

And should be
(reduce/increase) size by (*percentage diference* of the first value and the introduced one)
Comment 7 Justin L 2020-12-11 18:27:33 UTC
The built-in help is more ambiguous. "Adjust columns proportionally:
    If possible, change in column width will be equal for each column.")
    https://bugs.documentfoundation.org/show_bug.cgi?id=42023

It seems to make most sense to adjust by percentage. For example, if I have a 1 inch column one and a 3 inch column 2, and I reduce column 2 by one inch, would I really want column one to disappear?  Probably not.

Proposed fix to adjust by equal percentage for each column is at http://gerrit.libreoffice.org/c/core/+/107604
Comment 8 Commit Notification 2020-12-29 09:15:13 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

tdf#134881 sw table dlg: make column change %-proportional

It will be available in 7.2.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 Commit Notification 2021-01-04 08:31:04 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/decf4898bd9079f9677f501cb9f5f2d2038984d5

tdf#134881 sw table dlg: Adjust columns proportionally
Comment 10 BogdanB 2021-01-04 11:31:08 UTC
Justin, please mark this as resolved.

I want to mark it as verified and I can't.
Comment 11 BogdanB 2021-01-04 11:40:12 UTC
Verified in
Version: 7.2.0.0.alpha0+
Build ID: 2c9708cbb870483a8a1c93d722085be5f789d234
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded

It's ok now. It's proportional. Thanks for fixing this.

--------------------------
Just as a notice: there is a 0,01 cm that remains after changing the first column from 4 cm to 2 cm. The total of the table will be 6,01 cm instead of 6 cm. But anyway ths is a much big improvment comparing with this small details.