Bug 152594 - Tab does not increase outline level for PS registered in Chapter Numbering when the next outline level does not have numbering
Summary: Tab does not increase outline level for PS registered in Chapter Numbering wh...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.5.0.0 beta1+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsDevAdvice
Depends on:
Blocks: Bullet-Number-Outline-Lists Heading-Numbering
  Show dependency treegraph
 
Reported: 2022-12-19 16:14 UTC by sdc.blanco
Modified: 2023-02-15 08:28 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Test file for testing Tab and Shift+Tab on Outline Levels (30.15 KB, application/vnd.oasis.opendocument.text)
2023-02-12 17:07 UTC, sdc.blanco
Details
Test file created in 7.2.7.2, which works correctly (11.77 KB, application/vnd.oasis.opendocument.text)
2023-02-12 21:53 UTC, sdc.blanco
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sdc.blanco 2022-12-19 16:14:56 UTC
1. Open new text document.
2. On line 1, write "Heading 1", on line 2, write "Heading 2".
3. Apply paragraph style "Heading 2" to line 2 (where PS "Heading 2" is assigned to Level 2 in Tools > Chapter Numbering)
4. Place cursor at beginning of line 2 (Heading 2), press Tab.

Actual: Tab is inserted.
Expected: Outline level is increased.

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 98f0dd5e15733ac7f1d929d06ab230b5f04121d5
CPU threads: 8; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: da-DK (da_DK); UI: en-US
Calc: CL threaded


Additional information:

1. Works as expected in 7.2.7.2
2. Ctrl+Tab and Shift+Tab work as expected in both 7.2.7.2 and 7.6.0.0.alpha0+
Comment 1 Dieter 2022-12-30 09:07:23 UTC
(In reply to sdc.blanco from comment #0)
> Actual: Tab is inserted.
I confirm this with

Version: 7.5.0.1 (X86_64) / LibreOffice Community
Build ID: 77cd3d7ad4445740a0c6cf977992dafd8ebad8df
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL threaded

> Additional information:
> 
> 1. Works as expected in 7.2.7.2
No, same result as in 7.5.0.1

> 2. Ctrl+Tab and Shift+Tab work as expected in both 7.2.7.2 and
Ctrl+Tab increases before indent
Shift+Tab decreases outline level
Comment 2 Heiko Tietze 2023-01-10 16:44:29 UTC
Any relation to bug 146762?
Comment 3 sdc.blanco 2023-01-11 00:55:10 UTC
(In reply to Heiko Tietze from comment #2)
> Any relation to bug 146762?
Assuming that my verification was valid (bug 146762, comment 28), and comment 1 here is accurate, then I would deduce that a more likely explanation is a regression sometime between 7.4 and 7.5.
Comment 4 sdc.blanco 2023-02-12 17:07:33 UTC
Created attachment 185335 [details]
Test file for testing Tab and Shift+Tab on Outline Levels

(In reply to Heiko Tietze from comment #2)
> Any relation to bug 146762?
Maybe or maybe not. That bug addressed changing list levels, but numbering is also relevant here, where outline levels are involved.

(In reply to sdc.blanco from comment #3)
> deduce ... more likely ... regression 
Bad deduction.

Have attached a test file (tested with 7.2.7.2 and 7.6.0.0.alpha0+) with the same results (expect for one slight difference. Tab for the first Heading 1 indents all headings for 7.2.7.2, but not for 7.6.0.0.alpha0+. This difference was/is expected, because of change in bug 146762).

There are three different "tests" to conduct.  Together, they show that Tab works as expected *as long as the heading at the next level has a numbering assigned to the level* -- while Ctrl+Tab works regardless of whether numbering is assigned (as long as the paragraph has no space or tab at the beginning).

Note that the description in shortcut keys [1] for the expected (?) behavior of Tab and Shift+Tab has not been changed since the initial checkin in 2004.

Critical information missing from that description is that Tab and Shift+Tab only works for those headings that are registered in Tools - Chapter Numbering.

[1] https://help.libreoffice.org/7.6/en-US/text/swriter/04/01020000.html
Comment 5 sdc.blanco 2023-02-12 21:53:40 UTC
Created attachment 185338 [details]
Test file created in 7.2.7.2, which works correctly

The attachment has a file which was created in 7.2.7.2 with three lines shown after this paragraph, where the PS style for each line corresponds respectively to the text in the line.

Heading 1  (apply PS)
Heading 2  (apply PS)
Heading 3  (apply PS)

(no numbering set in Tools - Chapter Numbering)

In both 7.2.7.2 and 7.6.0.0.alpha0+, if that file (in the attachment) is opened, then "Tab" increases outline level for Heading 2 and 3 with no problem (and can continue to increase to outline level 6, 7, etc). 

In other words, "actual" and "expected" behavior are aligned.

But if the same document described here is created manually in 7.6.0.0.alpha0+, then using "Tab" only adds a tab to the line where the tab key was pressed.

If that 7.6.0.0. document is saved, and then opened in 7.2.7.2, then the same (unexpected) behavior is observed (i.e., Tab simply inserts a tab (actual); it does not change outline level as expected).

The test file in attachment 185335 [details] was created with 7.6.0.0.alpha0+, which would explain why I observe the same behavior between 7.2.7.2 and 7.6.0.0.alpha0+, as reported in the previous comment.

The attachment here, created with 7.2.7.2, works as expected, both in 7.2.7.2 and 7.6  (without adding numbering).

Finally, if the document created by 7.6.0.0 is opened with 7.2.7.2 and numbering is added to all headings in Tools - Chapter Numbering, then Tab works as expected.

Summary of experiments:  

1. Tab does not work (in 7.2.7 and 7.6) if:
    a. document is created in 7.6 
AND
    b. no numbering is assigned in Tools - Chapter Numbering.

2.  Tab does work (in 7.2.7 and 7.6) if:
    a. document is created in 7.2.7.2 
OR
    b. numbering is applied to headings using Tools - Chapter Numbering.
Comment 6 Heiko Tietze 2023-02-13 09:38:05 UTC
I believe this is what was done for bug 146762 per https://gerrit.libreoffice.org/c/core/+/134856. You insert a literal tab even in lists as long no numbering is applied. Promote/Demote of the outline levels is supposed to be done via the Navigator, the Numbering & Bullets toolbar, the context menu and the main menu Format > List (both after enabling the numbering).
Comment 7 sdc.blanco 2023-02-13 17:18:32 UTC
(In reply to Heiko Tietze from comment #6)
> I believe this is what was done for bug 146762 per
> https://gerrit.libreoffice.org/c/core/+/134856. 
There are two different issues/situations here. Bug 146762 was done in relation to list levels. The issue of outline levels was not discussed there (search on "outline" in that ticket).

The issue here is about outline levels, and the function of using tab to increase outline level of headings. This has existed since OOo, and is still working in 7.2. As shown in comment 5: why would it work (as expected) in 7.6 if it uses a file with headings created and saved in 7.2, but does not work in 7.6 if 7.6 creates the headings manually?
Comment 8 Heiko Tietze 2023-02-14 08:23:02 UTC
(In reply to sdc.blanco from comment #7)
> The issue here is about outline levels, and the function of using tab to
> increase outline level of headings.

Before the patch the key NumDown was (also) accepted in case of !rSh.IsMultiSelection() && rSh.IsFirstOfNumRuleAtCursorPos() && numfunc::ChangeIndentOnTabAtFirstPosOfFirstListItem() (need to read the code very carefully to understand this in detail but the function names give at least an impression).

What I wanted to say is that you request a (partial) revert of the mentioned patch to bring back a certain functionality.
Comment 9 sdc.blanco 2023-02-14 15:47:28 UTC
(In reply to Heiko Tietze from comment #8)
> What I wanted to say is that you request a (partial) revert of the mentioned
> patch to bring back a certain functionality.
Note that bug 146762 originated only in an attempt to confirm what was expected behavior so that the documentation could be aligned properly. The lost functionality of increasing non-numbered headings in 7.6 is a bigger problem (imo) -- but are you sure that you have the full diagnosis. In particular:

1. Why would both 7.2 and 7.6 behave as expected when using a file saved under 7.2, but not behave as expected when using the exact same content but now saved under 7.6?  That does not seem related to the patch (or at least I cannot generate a plausible hypothesis), because in this case all that happens is that paragraph styles are applied to three lines and then the document is saved.

2. Meanwhile, I can see in bug 146762 comment 2, that the difference between heading with or without numbering was already noted. Unfortunately the comment does not indicate which version was used, but I would guess that it was 7.4.0.0 -- given that 7.2 works correctly. Iow, that issue appears already in 7.4.0.0 BEFORE the patch, but not in 7.2.7.2.