https://bugs.documentfoundation.org/show_bug.cgi?id=155269
Bug ID: 155269 Summary: Chapter numbering mech silently changes para style numeric outline-level Product: LibreOffice Version: 7.5.3.2 release Hardware: All OS: All Status: UNCONFIRMED Severity: normal Priority: medium Component: Writer Assignee: libreoffice-bugs@lists.freedesktop.org Reporter: rdbing...@verizon.net Version: 7.5.3.2 (X86_64) / LibreOffice Community Build ID: 9f56dff12ba03b9acd7730a5a481eea045e468f3 CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win Locale: en-US (en_US); UI: en-US Calc: CL Jumbo Discovered this issue while developing an OTT having several dozen custom styles across paragraph, frame, and page. My desired OTT functionality includes power-user usage of both: + various Writer effects dependent on the outline-level mechanism, particularly the [Insert->Field->More fields->Document tab->Chapter->Chapter name], and + use of the [Tools->Chapter number] mechanism for both auto chapter number prepend insertion by style name and by explicit field invocation [More fields->Document tab->Chapter->Chapter number]. Observed increasing erratic behaviors of the Chapter_name variables set of 10, 1 for each outline-level. Observed increasing erratic behaviors of the Chapter_numbering mechanism and variables set of 10, 1 for each element of the Chapter_number text-string and erratic behavior of the Automatic Numbering (auto-chapter_number text-string insertion) mechanism. In a purpose-created, compact diagnostic ODT, I tripped over the following reproducible sequences: Start with fresh File->New (Default OTT) diagnostic ODT. In Navigator->Styles->Paragraph, examine and record the numeric outline-levels of some paragraph styles you will play with in the [Tools->Chapter number] feature. For the Default OTT, that feature comes pre-loaded with the 'Heading <n>' styles. Just in case there is some hardcoded relationship to built-in para styles, create some custom styles inheriting from Default having a sample of numeric outline-level values + none (TextBody). Open the [Tools->Chapter number] feature UI. This UI, unfortunately for user confusion with Outline&List numeric level, uses the term "Levels." I will use the term Element here, each Element (of 10 total) having in turn a numeric index (1--10) and several property slots such as [Number:], [Paragraph style:], [Before:] and [After:]. Explaining my rational for Element that will take several paragraphs, so I defer that. Notice that with the Default OTT, the [Tools->Chapter number] feature is pre-loaded with the "Heading <n>" paragraph styles such that the ascending Element numeric index matches the numeric <n> value of the pre-load "Heading <n>" family para styles. Make one or more changes to any of the 10 Elements' [Paragraph style:] property. Examples : + (A) move an incumbent style name in, say Element[4] [Paragraph style:] to, say Element7] [Paragraph style:]. You do this by going to Element[7] and selecting the style name of what is in Element[4] from the [Paragraph style:] picklist. You should see the change in the Preview area. + (B) remove (evict) some incumbent style name entirely from the 10-Element set of [Paragraph style:] styles. You do this by [Paragraph style:] < - [None] for some chosen Element index. + (C) add a para style not already in the incumbent style name set, either a Writer built-in or one of your new custom styles, to an Element [Paragraph style:] style slot, say Element[2], possibly displacing an incumbent style name. OK-close the [Tools->Chapter number] UI. In Navigator again examine the outline-levels of the paragraph styles you just manipulated above in [Tools->Chapter number] Element [Paragraph style:] properties. My observation is this: The [Tools->Chapter number] feature SILENTLY CHANGES the numeric outline-level of the para styles just manipulated such that after OK-close those outline-levels == the numeric value of the index of the Element where that para style name has been set in [Paragraph style:]. + For example (A), the new numeric outline-level for the re-located style is now 7. + For example (B), the new numeric outline-level for the evicted style is now TextBody. + For example (C), the new numeric outline-level for the net-added style is now 2. This in turn, in a document having chapter_number and outline-level schemes under development experimentation, silently breaks the functionality of all other Writer features dependent on an independently stable numeric outline-level scheme, such as default index tables and, wait for it, [Chapter name]. Of particular note is that if you evict one of the pre-load 'Heading <n>' styles, that style gets silently demoted to outline-level TextBody. There is nothing in the user-facing documentation which states that the numeric index value of an Element is hardcoded as the same integer variable as the outline level of a paragraph style definition, including the "non-level" of TextBody. In fact, all of the configured Element[index] [Paragraph style:] styles could have the same numeric outline-level going in, an Element's numeric index value can be different from the [Paragraph style:] style numeric outline-level going in, or the Element [Paragraph style:] styles could have no outline level at all (TextBody). There is no documentation indication that the [Tools->Chapter number] feature forcibly changes the outline-level of an evicted style, potentially leaving that outline-level different from when the style was taken in to the [Tools->Chapter number] feature during an experiment. The lack of such documentation notice suggests there is no reason for the user to expect the [Chapter number] feature to use or touch a para style numeric outline-level property. Why? Because the [Chapter number] feature behaves as if it uses the style NAME, not style outline-level, in the [Paragraph style:] property to recognize when to increment the integer counter of a given Element for prep of the chapter-number text string, when to do Automatic Numbering prepending. Now why might a user NOT observe this issue? Because in simple [Tools->Chapter number] schemes, and indeed in the [Tools->Chapter number] "Heading <n>" pre-load, the Element index numeric value HAPPENS to match the para style outline-level numeric value. As long as the user NEVER changes an Element [Paragraph style:] property, they will never have the potential for a silent change in a para style outline-value. >From a user's POV, in a complex document all heck breaks loose for unknown reasons. It is difficult to believe this silent change of outline-levels is intended behavior. I notice other cases 129270, 129669, 140846. A recurring theme seems to be confusion on if, conflation of, as noted above, that the numeric index value of an Element is hardcoded as the same integer variable as the outline level of a paragraph style definition, including the "non-level" of TextBody. Regards. -- You are receiving this mail because: You are the assignee for the bug.