On 01/02/2015 05:42 PM, aparsloe wrote:

On 3/01/2015 10:34 a.m., Pavel Sanda wrote:
Pavel Sanda wrote:
aparsloe wrote:
The buttons at the bottom of the Outline pane which increase or decrease the depth of the heading containing the cursor don't work as they should on my system for chapters and parts. If the cursor is in a chapter heading, clicking the decrease-depth button to make the chapter a part has no effect on the chapter heading, nor on sections within the chapter, but subsections within the chapter become sections. Similarly, clicking the increase-depth button with the cursor in a chapter heading leaves the level of the chapter heading unaltered, but sections and subsections etc within the chapter have
their depth increased by one.
Indeed, this is regression wrt 2.0.x, file the bug in trac. Pavel
Bisect points to

commit b9f48eb945028d835ee93936a48b5fe611c6e4f9
Author: Richard Heck <rgh...@lyx.org>
Date:   Fri May 10 13:17:47 2013 -0400

Fix bug #8666. Parts should have toclevel -1.
A lot of this involves removing toclevel tags. They got introduced
by the automatic update of some layout files to format 19.


Ticket #9375.

I don't think the bug really has to do with that patch. These operations work fine with the Koma-Script book class. Are you using standard book? I saw the bug with that.

Here's the relevant code from Text3.cpp:

                DocumentClass const & tc = buf.params().documentClass();
                DocumentClass::const_iterator lit = tc.begin();
                DocumentClass::const_iterator len = tc.end();
                int const newtoclevel =
                    (mode == OutlineIn ? toclevel + 1 : toclevel - 1);
                LabelType const oldlabeltype = start->layout().labeltype;

                for (; lit != len; ++lit) {
                    if (lit->toclevel ==  newtoclevel &&
                         lit->labeltype == oldlabeltype) {
                        start->setLayout(*lit);
                        break;
                    }
                }

It's the comparison between *label types* that fails for standard book. There, Parts have label type Static, whereas Chapters have label type Above. In Koma book, they are both Static.

I take it that the point of this test was to make sure we do not move a Chapter out to a Part*. And also to make this work with starred sections, so a Subsection* would get moved out to a Section*. It probably worked fine when we had fewer label types available for these things.

Basically, what we need is some way to test if we have a starred layout. The question is how to do that. I can see a few options:

(1) Starred layouts always have LabelType No_Label
(2) Starred layouts are in Category Unnumbered
(3) Starred layouts have no LabelCounter

Any suggestions?

Richard

Reply via email to