Bug 146312 - Heading Numbering dialog doesn't show heading previews if using [none] as paragraph style
Summary: Heading Numbering dialog doesn't show heading previews if using [none] as par...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
7.0.6.2 release
Hardware: All All
: medium normal
Assignee: Andreas Heinisch
URL:
Whiteboard: target:7.6.0
Keywords:
Depends on:
Blocks: Heading-Numbering
  Show dependency treegraph
 
Reported: 2021-12-19 10:13 UTC by Telesto
Modified: 2023-04-05 16:50 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file (10.20 KB, application/vnd.oasis.opendocument.text)
2021-12-19 10:13 UTC, Telesto
Details
screenshot of issue in LO 7.2.4.1 (107.56 KB, image/png)
2021-12-22 02:24 UTC, Stéphane Guillou (stragu)
Details
example document with more option combinations (10.49 KB, application/vnd.oasis.opendocument.text)
2021-12-22 02:25 UTC, Stéphane Guillou (stragu)
Details
Current state of chapter numbering dialog showing "Caption" (17.21 KB, image/png)
2023-03-31 12:53 UTC, Andreas Heinisch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2021-12-19 10:13:11 UTC
Description:
Chapter numbering dialog doesn't show Heading 1-3 in preview those headings a present in document (but shows if not present)

Steps to Reproduce:
1. Open the attached file
2. Tools -> Chapter numbering
3. Open new document
4. Tools -> Chapter numbering

Actual Results:
Chapter 1/3 are empty it the document

Expected Results:
The old dialog had more or less the same habit, but you could Alina layout (which is gone in recent dialog). 

Headings should always show in the preview; but well that's my first impression


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: deea3b7471c3dab0220eca6146c225a2d47681a2
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL
Comment 1 Telesto 2021-12-19 10:13:28 UTC
Created attachment 177017 [details]
Example file
Comment 2 Stéphane Guillou (stragu) 2021-12-19 14:09:03 UTC Comment hidden (obsolete)
Comment 3 Stéphane Guillou (stragu) 2021-12-19 14:12:34 UTC
Following the steps, I could reproduce but only heading 1 and heading 2 are not showing. (The two heading styles used in the document.)
Can you confirm that it only affects 1 and 2, Telesto?

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 06ac18e6302d666c363740644a7976e8c22d1113
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Version: 7.3.0.0.beta1 / LibreOffice Community
Build ID: 436f14c25ec1847646b953cf13d0db4f7ca3be57
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Version: 7.2.4.1 / LibreOffice Community
Build ID: 27d75539669ac387bb498e35313b970b7fe9c4f9
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Version: 7.1.8.1 / LibreOffice Community
Build ID: e1f30c802c3269a1d052614453f260e49458c82c
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Version: 7.0.6.2
Build ID: 00(Build:2)
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Ubuntu package version: 1:7.0.6-0ubuntu0.18.04.1_lo1
Calc: threaded

Is it because those heading styles don't have a Numbering Style, in Styles > Edit Style... > Outline & Numbering > Numbering?
Or because they have no Paragraph style in Tools > Chapter Numbering > Numbering  > Paragraph style?
Is that expected?
Comment 4 Telesto 2021-12-20 08:40:40 UTC
(In reply to stragu from comment #3)
> Following the steps, I could reproduce but only heading 1 and heading 2 are
> not showing. (The two heading styles used in the document.)
> Can you confirm that it only affects 1 and 2, Telesto?

Yes
Comment 5 Heiko Tietze 2021-12-20 09:20:30 UTC
It's obviously the PS "[None]" which hides the text from preview. Since the preview shows the PS name, [None] means none. I agree with the bug assessment.
Comment 6 Stéphane Guillou (stragu) 2021-12-22 02:24:00 UTC
It doesn't seem to matter if the heading style is in use or not in the document, contrary to the original bug summary. Changing to something that I think describes the issue more precisely.

Can you also confirm, Telesto or Heiko? I used attachment 177017 [details], removed the lines using the problematic heading styles, saved, reloaded: at no stage the previews reappeared.

Using:

Version: 7.2.4.1 / LibreOffice Community
Build ID: 27d75539669ac387bb498e35313b970b7fe9c4f9
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Also changing earliest version affected as per comment 3.

Note that the numbering does show in the preview if the field "Number" has a value.

I see why there is no name in the preview if there is no associated paragraph style, but what would be a better solution here? Show something like "[level not associated to a style]" instead of a blank space?
Or, for a shorter alternative: [no style]?

Or: should we even allow the option [none] in the dropdown? Why do we have it?
Comment 7 Stéphane Guillou (stragu) 2021-12-22 02:24:47 UTC
Created attachment 177073 [details]
screenshot of issue in LO 7.2.4.1
Comment 8 Stéphane Guillou (stragu) 2021-12-22 02:25:45 UTC
Created attachment 177074 [details]
example document with more option combinations
Comment 9 Heiko Tietze 2022-01-03 11:03:41 UTC
No document needed, just open the chapter numbering dialog and use "[None]" as paragraph style. Don't see what "[None]" should be, perhaps keep the previous. 

Simple solution is to just remove "[None]", more advance to have a checkbox "[x] Apply Paragraph Style" - on by default, allowing to pick one entry from the PS dropdown. And when off behaving the same as "[None]". Drawback is that the dialog becomes more cluttered.
Comment 10 Andreas Heinisch 2023-03-31 12:53:36 UTC
Created attachment 186362 [details]
Current state of chapter numbering dialog showing "Caption"

In order to be consistency I would just show "None" like it shows for instance "Caption" or all the other paragraph styles.
Comment 11 Heiko Tietze 2023-04-03 08:30:52 UTC
(In reply to Heiko Tietze from comment #9)
> Simple solution is to just remove "[None]", more advance to have a checkbox
> "[x] Apply Paragraph Style" - on by default, allowing to pick one entry from
> the PS dropdown. And when off behaving the same as "[None]". Drawback is
> that the dialog becomes more cluttered.

Reading my previous comments makes me always wonder what I wanted to say. Sorry for that.

The report is first of all about the preview no showing headings with PS = None. Could be solved easily by applying some default. Thinking of "None" as PS, I had the idea to add a "Apply PS" checkbox, which is not a good solution. Maybe better just rename "None" to "Do not change PS" - but this is too long. So ultimately my take is to keep "None" and describe what happens in a tooltip, something like "Use [None] to keep the paragraph style as defined in the document" or "Use [None] to not apply any special paragraph style". 

IIRC, we use brackets for [None] to indicate that it is not a label. Seth puts a lot of effort in keeping this consistent.
Comment 12 sdc.blanco 2023-04-03 10:59:18 UTC
(In reply to Heiko Tietze from comment #11)
> IIRC, we use brackets for [None] to indicate that it is not a label. 
afaict the use of "None" is a grey area -- with no explicit guideline.
Current opinion is to use [None], based on discussion in
https://gerrit.libreoffice.org/c/core/+/148702

Meanwhile -- please forgive this naïve question -- but:

Is there a good reason for wanting to offer "[None]" as an option for "Paragraph style" in this dialog?

The OP does not address that issue -- beyond wanting to always have something shown in the Preview.

The only reason that I could imagine for wanting to use "[None]" is to make it possible to use a "Heading N" style, without it becoming part of the heading numbering.  But there are so many other (relatively easy) ways to achieve that work flow, so I wonder if the problem here could be resolved by simply eliminating [None] as an option for "Paragraph style"?  (which would also avoid the "None" question).
Comment 13 Heiko Tietze 2023-04-03 13:16:14 UTC
(In reply to sdc.blanco from comment #12)
> Is there a good reason for wanting to offer "[None]" as an option for
> "Paragraph style" in this dialog?

https://help.libreoffice.org/7.5/en-US/text/swriter/01/06060100.html

Paragraph Style
Select the paragraph style that you want to assign to the selected outline level. If you click "None", the selected outline level is not defined.


To answer your question: there is no such thing as "No PS". The caption is likely (haven't tested it) inserted without a (direct?) formatting on the PS taking either the Default PS or the PS defined in "Followed By" on the previous paragraph.
Comment 14 Commit Notification 2023-04-03 13:20:55 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

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

tdf#146312 - Chapter numbering dialog: show paragraph style [None] in preview

It will be available in 7.6.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 sdc.blanco 2023-04-03 20:04:18 UTC
(In reply to Heiko Tietze from comment #13)
> To answer your question....
From experiments, I understand now that one answer to my question could be:

"Use [None] if you want to remove (skip) some levels from the outline."

For example, if Level 2 has "Paragraph Style" set as [None], then "Promote Level" on a Level 3 PS will result in it being changed to Level 1  (or a Level 1 is "demoted" to Level 3).

Some observations:

1. If "Numbering" is not "None", then the numbering selection is shown in Preview, even if PS is selected to be [None].
2. It is an unfortunate mixture of two different functions to use [None] with PS, as a way to disable a level.
3. Alternative solution would be to add a checkbox:

   [ ] Do not include level

   (for example, under "Separator" section, or possibly under "Level" box), 

When the checkbox is enabled, then the preview would show:  [No Level n]

Also, with this solution the numbering should not be shown if the level is not defined.  (have not checked what happens with numbering in Andreas's recent patch).

Advantages:

1. The checkbox makes the function visible and more understandable (possibly supplemented with tooltip).
2. Paragraph Style is in the "Numbering" section.  There is no indication that Numbering should be used to "skip" a level (given that outline levels can be used without numbering), and that Paragraph Style should be used for that purpose (see point 2 above about "unfortunate mixture").
3. With the checkbox, you can leave paragraph styles unchanged for "disabled" levels, so if you decide to reintroduce the level, you just uncheck the box, without having to change the PS.


> The caption is inserted without ...
???  do you mean heading? Could not follow the description/prediction.
Comment 16 Andreas Heinisch 2023-04-04 06:36:05 UTC
The patch just shows [None] in the preview as any other heading numbering style. Imho, removing [None] may break some existing documents where [None] was used.
Comment 17 Heiko Tietze 2023-04-04 06:54:22 UTC
(In reply to sdc.blanco from comment #15)
> > The caption is inserted without ...
> ???  do you mean heading? Could not follow the description/prediction.

Sorry, old habits. My guess is that the heading/outline PS is not applied via this procedure.

I think we can resolve the ticket, unless you want to add/change the tooltip/documentation, Seth.
Comment 18 sdc.blanco 2023-04-04 11:06:01 UTC
(In reply to Heiko Tietze from comment #17)
> My guess is that the heading/outline PS is not applied...
Yes. Because no PS is assigned to the outline level, so there is nothing to apply.

If a PS is removed from the dialog (e.g., by setting to [None]), then the outline level for that PS is changed to [None] (and any numbering is removed).  (This happens also for custom PS.  I am tempted to suggest that changing the outline level of an unassigned PS is a bug).

(In reply to Andreas Heinisch from comment #16)
> removing [None] may break some existing documents....
Presumably it is possible to retain [None] internally in the code, without showing it in the UI -- if there was a wish to separate this "skip level" function from the Numbering section.

> I think we can resolve the ticket, unless you want to add/change the
> tooltip/documentation, Seth.
It seems appropriate to add the same tooltip as the extended tip for "Paragraph Style", and to add mention of [None], so it would be:

   Select the paragraph style to assign to the selected outline level. Select [None] to skip the outline level.

(but does "skip" express the idea adequately?)

The help page says:
   
    "the selected outline level is not defined"

but that seems a little misleading, in that the level is defined, but because no PS is assigned to that level. (for now, I do not have a better formulation that justifies retranslation).
Comment 19 Commit Notification 2023-04-05 16:49:27 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

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

tdf#146312 - Chapter numbering dialog: adapt extended tooltip for [None]

It will be available in 7.6.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.