Bug 89932 - UI: Bullets and Numbering Position tab Level 1 does not display default values
Summary: UI: Bullets and Numbering Position tab Level 1 does not display default values
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.4.0.0.alpha0+ Master
Hardware: All All
: medium normal
Assignee: Vidhey PV
URL:
Whiteboard: target:5.4.0
Keywords: bibisected, bisected, difficultyBeginner, easyHack, regression, skillCpp, topicUI
: 104357 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-03-10 14:19 UTC by Gordo
Modified: 2017-02-14 08:57 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
screenshot before and after the patch (117.27 KB, application/vnd.oasis.opendocument.text)
2016-05-10 02:58 UTC, raal
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gordo 2015-03-10 14:19:04 UTC
Default values do not display:
1. New Text Document.
2. Format -> Bullets and Numbering -> Position.
Result:
"Aligned at:", "at:", and "Indent at:" boxes are blank.
3. Click on Level 2.
4. Click back to Level 1.
Result:
Boxes display default values.

Entering values does not affect other levels:
1. New Text Document.
2. Format -> Bullets and Numbering -> Position.
3. Enter 0.60cm in "Aligned at:" box.
4. Enter 1.20cm in both "at:" and "Indent at:" boxes.
5. Click on Level 2.
Expected Result:
"at:" and "Indent at:" values increase by "Aligned at:" value in Level 1 and "Aligned at:" value uses "at:" or "Indent at:" value from preceding level.
Result:
All levels have the same value as Level 1.

After getting the default values to display, changing the values in Level 1 does not change the values in the other levels, so I'm not sure if the expected result on the last test should just be "do not change values in other levels".

The Help is unclear when it says that indents are Relative--Indents the current level relative to the previous level in the list hierarchy.  Is it automatic or is their supposed to be a checkbox?

Version: 4.4.1.2
Build ID: 45e2de17089c24a1fa810c8f975a7171ba4cd432
Comment 1 A (Andy) 2015-03-11 22:05:11 UTC
Reproducible with LO 4.4.1.2, Win 8.1

But I have no answer/opinion to the question raised at the end of the bug report.
Comment 2 Cor Nouws 2015-04-11 13:59:01 UTC
This is probably a side effect of the fix for tdf#78783
Comment 3 Cor Nouws 2015-04-11 13:59:53 UTC
@stefan: maybe you can have a look ?

thanks a lot,
Cor
Comment 4 Stefan Weiberg 2015-04-11 14:47:35 UTC
@Cor Nouws I had a quick look on the changes introduced by my patch. These shouldn't effect the standard behavior of the menu itself. The code only changes the focus on the different levels and not the content itself.

As I currently don't have a build available on my machines I have to bisect it later. But it might take a while.
Comment 5 Stefan Weiberg 2015-04-11 14:47:57 UTC
Here is the link to the patch: http://cgit.freedesktop.org/libreoffice/core/commit/?id=c613b5dba883897c927f7b60c84830c62a79d0ea
Comment 6 Stefan Weiberg 2015-04-11 14:49:05 UTC
Sorry, the patch is already linked in the tdf#78783
Comment 7 tommy27 2016-04-16 07:27:32 UTC Comment hidden (obsolete)
Comment 8 Cor Nouws 2016-04-18 07:35:38 UTC
still a problem in current versions
Comment 9 raal 2016-05-10 02:58:49 UTC
Created attachment 124941 [details]
screenshot before and after the patch

commit caused change of the levels, before was focus at the level 1-10 (blank textboxes  expected), after the commit the level is 1 (should read level 1 values)
 879f1c27c61fe2a86c10db0d4daca496ddea342e is the first bad commit
commit 879f1c27c61fe2a86c10db0d4daca496ddea342e
Author: Matthew Francis <mjay.francis@gmail.com>
Date:   Sun Mar 15 03:06:04 2015 +0800

    source-hash-c613b5dba883897c927f7b60c84830c62a79d0ea
    
    commit c613b5dba883897c927f7b60c84830c62a79d0ea
    Author:     Stefan Weiberg <stefan.weiberg@germandev.org>
    AuthorDate: Fri Sep 12 05:57:02 2014 +0000
    Commit:     Caolán McNamara <caolanm@redhat.com>
    CommitDate: Thu Sep 25 12:32:36 2014 +0000
    
        fdo#78783: fixed init position to 1 and using css
    
        Change-Id: Ib7c62ce23290056c42bfa89fbac91212e7ae0ab6
        Reviewed-on: https://gerrit.libreoffice.org/11409
        Reviewed-by: Caolán McNamara <caolanm@redhat.com>
        Tested-by: Caolán McNamara <caolanm@redhat.com>
Comment 10 Cor Nouws 2016-12-02 15:22:40 UTC
*** Bug 104357 has been marked as a duplicate of this bug. ***
Comment 11 Tamás Zolnai 2016-12-03 13:37:35 UTC
This is caused by an easy hack so I turn this one to an other easy hack to fix it.
Code pointers:
Commit caused this issue is:
https://cgit.freedesktop.org/libreoffice/core/commit/?id=c613b5dba883897c927f7b60c84830c62a79d0ea

The tabs behavior is specified by these two classes (both Position and Customize tab are affected on some way):
SvxNumOptionsTabPage (Customize tab) and SvxNumPositionTabPage (Position tab).
Focus on ActivatePage() and Reset() methods.
Comment 12 Vidhey PV 2016-12-14 09:53:12 UTC
what needs to be done here??
default values should be displayed in the level-1 and when some values are entered in level-1, it should affect other levels too, is that all ???  
What happens when someone changes values in other levels(other than 1)???
Comment 13 Tamás Zolnai 2016-12-14 10:14:50 UTC
This easy hack is about the first part of the bug report:

"Default values do not display:
1. New Text Document.
2. Format -> Bullets and Numbering -> Position.
Result:
"Aligned at:", "at:", and "Indent at:" boxes are blank.
3. Click on Level 2.
4. Click back to Level 1.
Result:
Boxes display default values."

As the title of the bug is also about this bug.
So the problem is that opening Position tab (and also Customize tab is affected) of Bullets and Numbering dialog the level-1 is selected in the list on the left side of the tab page, but the input boxes are not set to the values level-1 has.

I'm not sure the second part of the bug report is actually a bug. I don't see anything on the GUI which makes to expect that higher levels are calculated relatively to lower levels. I see absolute values here. The help must be outdated.
Comment 14 Vidhey PV 2016-12-14 16:51:22 UTC
There is position tab in Bullets and Numbering, but I am not able to find customize tab. Where is it and what is it used for????
Comment 15 Tamás Zolnai 2016-12-14 17:11:10 UTC
(In reply to Vidhey PV from comment #14)
> There is position tab in Bullets and Numbering, but I am not able to find
> customize tab. Where is it and what is it used for????

If you open Bullets and Numberings in Impress you can see the Customize tab, but its the same as Options tab in Writer. I think it just have different names in the different components.

On this tab the problem is, when you open it sometimes the level-1 is selected, sometimes not (level 1 should be selected). And also when level-1 is selected the preview on the right side is not show the correct result. You can check it by reselecting the level-1 from the list of levels.
Comment 16 Vidhey PV 2016-12-15 10:14:41 UTC
In Reset() method, we are inserting levels and pointing the default level to level 1.What does ActivatePage()  method do?? and which method is related to activating preview of various levels???
Comment 17 Tamás Zolnai 2016-12-15 18:54:31 UTC
(In reply to Vidhey PV from comment #16)
> In Reset() method, we are inserting levels and pointing the default level to
> level 1.What does ActivatePage()  method do?? and which method is related to
> activating preview of various levels???

This easy hack is about to understand the code called by these tab pages. So you should spend some time with reading the code and test how it works. Reset() method and ActivatePage() methods were changed by the commit which this issue is related to. So these are a good starting point.
I guess ActivatePage is called when the specific tab page is selected on the dialog, the reset method might be called when Reset button is pushed on the dialog. You can debug the code and find out which is called when and so what functionality they have.
It's not just about activating the preview I think. It's the same problem that Position tab has: the level-1 is selected from the level list, but other part of the dialog is not updated accordingly.
Comment 18 Commit Notification 2017-01-04 19:59:49 UTC
pv2k committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=610bc5aa161e726135feee0c7f64331df090475a

tdf#89932 bullets and numbering position tab level-1

It will be available in 5.4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 19 Tamás Zolnai 2017-01-04 20:09:34 UTC
> Entering values does not affect other levels:
> 1. New Text Document.
> 2. Format -> Bullets and Numbering -> Position.
> 3. Enter 0.60cm in "Aligned at:" box.
> 4. Enter 1.20cm in both "at:" and "Indent at:" boxes.
> 5. Click on Level 2.
> Expected Result:
> "at:" and "Indent at:" values increase by "Aligned at:" value in Level 1 and
> "Aligned at:" value uses "at:" or "Indent at:" value from preceding level.
> Result:
> All levels have the same value as Level 1.
> 
> After getting the default values to display, changing the values in Level 1
> does not change the values in the other levels, so I'm not sure if the
> expected result on the last test should just be "do not change values in
> other levels".
> 
> The Help is unclear when it says that indents are Relative--Indents the
> current level relative to the previous level in the list hierarchy.  Is it
> automatic or is their supposed to be a checkbox?

This part not seems a bug. Position tab has a Relative check box in Impress, but not in Writer. So in Writer levels are independent from each other.