Bug 95882 - UI: Ruler tabstops don't account for spacing to contents in table/frame
Summary: UI: Ruler tabstops don't account for spacing to contents in table/frame
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.2.0.4 release
Hardware: All All
: medium minor
Assignee: Justin L
URL:
Whiteboard: target:7.4.0
Keywords: bibisected, bisected, regression
: 85028 96558 (view as bug list)
Depends on:
Blocks: Paragraph-Tab-Stops Rulers
  Show dependency treegraph
 
Reported: 2015-11-17 19:52 UTC by tmacalp
Modified: 2022-02-24 09:26 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
Example document demonstrating ruler with wrong tabstops (12.17 KB, application/vnd.oasis.opendocument.text)
2015-11-17 19:52 UTC, tmacalp
Details
spacing_tabstopB.odt: add a few more scenarios to take into account. (24.65 KB, application/vnd.oasis.opendocument.text)
2022-02-18 08:48 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tmacalp 2015-11-17 19:52:47 UTC
Created attachment 120606 [details]
Example document demonstrating ruler with wrong tabstops

Description:
In tables/frames where spacing to contents is applied, the ruler doesn't account for this change.  This will make the ruler representation for tabs always be off by the amount of the spacing to contents.

Steps to reproduce:
* New document
* Insert 1 cell table
* Table Properties -> Borders -> Set spacing to contents for all sides to 1 inch
* OK
* Insert a tab in the table (ctrl-tab)
* Use the ruler to set the tab to something like 2 inches
 
Expected:
Our cursor should be under the tab marker in our ruler.

Actual:
Since our spacing to contents never adjusted our ruler to begin with, the ruler tab representation is left of our actual tab by a full inch (the size of our spacing to content).

This problem seems to have been introduced in LibreOffice 4.2.x and is still present in the 5.1 nightlies.  I've bibisected:
 1cb483c5f696c8e7d262c7959e482f2bc2edc0cb is the first bad commit
commit 1cb483c5f696c8e7d262c7959e482f2bc2edc0cb
Author: Bjoern Michaelsen <bjoern.michaelsen@canonical.com>
Date:   Fri Oct 18 08:55:44 2013 +0000

    source-hash-59373b753902f69cd44d183568b084429322e7ab
    
    commit 59373b753902f69cd44d183568b084429322e7ab
    Author:     Jan Holesovsky <kendy@collabora.com>
    AuthorDate: Mon Sep 16 16:30:45 2013 +0200
    Commit:     Jan Holesovsky <kendy@collabora.com>
    CommitDate: Mon Sep 16 17:04:03 2013 +0200
    
        Related bnc#819614: The diagram is a group.
    
        It is not really desired to import diagrams broken into individual objects;
        makes trouble with the hieararchy, and also the user wants to see it as a
        group - can be ungrouped for modifications easily.
    
        Change-Id: I0533a69af9e377804bf0e06b2ce873fd0c9bde02

:100644 100644 fee0f30959daf77c81436a4f8ac3e02565f8eeeb c75c37d83ee583b525d1d7b5e20160f317b1ece9 M	ccache.log
:100644 100644 e9d2d40d848a15a42165222cc8523b2eb6e76dd6 af1032fa0056513199b478e1bc898479e5bddb7d M	commitmsg
:100644 100644 dcfc3034a0ec4a0dd291eb47e8f5e74dfe2a68db 389eee42cd988e4e17d77afea6674dd465e6c2a1 M	dev-install.log
:100644 100644 5e75a14ac7b006e5f559156a71a77ca88fd96bab 99667ecacb0583c14353535065c393ab43bd8cd3 M	make.log
:040000 040000 db81fdeb8c6fa6df65425276c2768c93b74c5464 4a96cccb9e759f62b07d63e63da4a57cc5b622df M	opt

$ git bisect log
git bisect start 'last43onmaster' 'last41onmaster'
# bad: [33ac6698e6d90d84f99d784b9553ee87eec27d6a] source-hash-732c0f929fc0229b6da37d4ec4b6de8994fcea46
git bisect bad 33ac6698e6d90d84f99d784b9553ee87eec27d6a
# bad: [e3a648fdaa2bb87293750400b70ba590733a804a] source-hash-33526481788137d959f27ae32910127d1436c1a8
git bisect bad e3a648fdaa2bb87293750400b70ba590733a804a
# good: [b886825d7eb2550ab40d7b4cd16de8096c57d6eb] source-hash-b46688a663b8709e0e0795f25ef8961db1f46cba
git bisect good b886825d7eb2550ab40d7b4cd16de8096c57d6eb
# good: [f789e50909694bc398aaca477bc79ea38828034e] source-hash-e926621fb00f31471b0037d7955b6a3d7f908dc0
git bisect good f789e50909694bc398aaca477bc79ea38828034e
# good: [73ffd89349ad4e6772d1c0e672f1fe49750077e6] source-hash-d261ddf3c8e76b44b07ea8be69234a123d2f4271
git bisect good 73ffd89349ad4e6772d1c0e672f1fe49750077e6
# good: [f404200bd6f153825680cab6261f756ef7b77770] source-hash-b73dec8a06ef762098e642b2c37e4baad780b11a
git bisect good f404200bd6f153825680cab6261f756ef7b77770
# bad: [1cb483c5f696c8e7d262c7959e482f2bc2edc0cb] source-hash-59373b753902f69cd44d183568b084429322e7ab
git bisect bad 1cb483c5f696c8e7d262c7959e482f2bc2edc0cb
# good: [f183d146de94c2dea7931279049827aedf4f01a4] source-hash-6fe1efc01d6f9dc333a74a4e76e554b182651f60
git bisect good f183d146de94c2dea7931279049827aedf4f01a4
# first bad commit: [1cb483c5f696c8e7d262c7959e482f2bc2edc0cb] source-hash-59373b753902f69cd44d183568b084429322e7ab
Comment 1 Buovjaga 2015-11-18 08:18:36 UTC
Repro.

Win 7 Pro 64-bit Version: 5.1.0.0.alpha1+
Build ID: b216cc1b8096eb60c27f67e8c27b7cd756c75e38
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2015-11-12_00:06:20
Locale: fi-FI (fi_FI)
Comment 2 Robinson Tryon (qubit) 2015-12-13 11:14:27 UTC Comment hidden (obsolete)
Comment 3 Buovjaga 2016-03-14 12:11:17 UTC
Seems to be the same as bug 96558
Trent: you can decide how to dupe.
Comment 4 tmacalp 2016-03-14 15:56:42 UTC
*** Bug 96558 has been marked as a duplicate of this bug. ***
Comment 5 Xisco Faulí 2016-10-05 23:22:16 UTC
It looks like this regression was introduced by

commit 681f43274541fc4ab5e8c05739b0d74aa5f17be8
Author: Tomaž Vajngerl <quikee@gmail.com>
Date:   Thu Sep 12 21:05:14 2013 +0200

ruler: RTL fixes for indents in tables and columns
    
Change-Id: I6c0a819e4a294fcf50c96a51bb9eea3ddef84c57

Adding Cc: to Tomaž Vajngerl
Comment 6 Phil Krylov 2018-08-25 22:15:40 UTC
Still reproducible in:

Version: 6.1.0.3
Build ID: efb621ed25068d70781dc026f7e9c5187a4decd1
CPU threads: 4; OS: Mac OS X 10.9.5; UI render: GL; 
Locale: en-US (en.UTF-8); Calc: group threaded
Comment 7 QA Administrators 2019-09-02 09:19:47 UTC Comment hidden (obsolete)
Comment 8 QA Administrators 2021-09-02 03:53:24 UTC Comment hidden (obsolete, spam)
Comment 9 Justin L 2021-09-27 11:40:52 UTC
Used bibisect-42max to confirm this (although it seemed true only for table. Frame was already broken). Unfortunately, a broken build means a range of five days of commits to review. That's really a shame because I'm not certain comment 5's conclusion is correct. Half of that commit includes just name changes. The bulk of the change is in ApplyIndents(), and that function is not even called at all when I open the test document.

https://cgit.freedesktop.org/libreoffice/core/log/?id=681f43274541fc4ab5e8c05739b0d74aa5f17be8&qt=range&q=5c2ba4aad61ce2c7c661202ae7ed26e1859c5216..6fbf0762abf2947d2774d685414bd409361bc1fa
Comment 10 Justin L 2021-09-27 13:15:41 UTC
The frame part of the bug document already is at 2in instead of 3in in LO 3.5.
Comment 11 Justin L 2022-02-10 12:10:13 UTC
*** Bug 85028 has been marked as a duplicate of this bug. ***
Comment 12 Justin L 2022-02-18 08:48:12 UTC
Created attachment 178367 [details]
spacing_tabstopB.odt: add a few more scenarios to take into account.

proposed fix at http://gerrit.libreoffice.org/c/core/+/130125
Comment 13 Justin L 2022-02-18 08:51:22 UTC
For the record, the regressive commit was actually
by author Tomaž Vajngerl on 2013-09-15 15:34:15 +0200
commit 47a77d7dbc427e51421e2df8d59695834cb74980
    Ruler: disable snapping, tooltips

https://cgit.freedesktop.org/libreoffice/core/commit/?id=47a77d7dbc427e51421e2df8d59695834cb74980
Comment 14 Commit Notification 2022-02-24 06:37:25 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

tdf#95882 svxruler: restore adjustment for borders

It will be available in 7.4.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 15 Buovjaga 2022-02-24 09:26:49 UTC
Compared with older version and now it seems to be working as expected

Arch Linux 64-bit
Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 8f2b1b1cb84e1ae3139eb90b8efdf61e608adbad
CPU threads: 8; OS: Linux 5.16; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded Jumbo
Built on 24 February 2022