mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-07 12:32:26 +00:00
Fix another old outliner bug (#9375)
Parts, chapters and sections have different LabelTypes, but this does not mean they cannot be transformed into each other while doing OUTLINE_IN/OUT Not sure why the labeltype check is here anyway, but let's keep it.
This commit is contained in:
parent
41d95a45d9
commit
8fd1aaa46e
@ -292,6 +292,11 @@ public:
|
|||||||
|| labeltype == LABEL_CENTERED
|
|| labeltype == LABEL_CENTERED
|
||||||
|| labeltype == LABEL_BIBLIO;
|
|| labeltype == LABEL_BIBLIO;
|
||||||
}
|
}
|
||||||
|
bool isNumHeadingLabelType() const {
|
||||||
|
return labeltype == LABEL_ABOVE
|
||||||
|
|| labeltype == LABEL_CENTERED
|
||||||
|
|| labeltype == LABEL_STATIC;
|
||||||
|
}
|
||||||
///
|
///
|
||||||
bool addToToc() const { return add_to_toc_; }
|
bool addToToc() const { return add_to_toc_; }
|
||||||
///
|
///
|
||||||
|
@ -570,11 +570,11 @@ static void outline(OutlineOp mode, Cursor & cur, Text * text)
|
|||||||
DocumentClass const & tc = buf.params().documentClass();
|
DocumentClass const & tc = buf.params().documentClass();
|
||||||
int const newtoclevel =
|
int const newtoclevel =
|
||||||
(mode == OutlineIn ? toclevel + 1 : toclevel - 1);
|
(mode == OutlineIn ? toclevel + 1 : toclevel - 1);
|
||||||
LabelType const oldlabeltype = start->layout().labeltype;
|
|
||||||
|
|
||||||
for (auto const & lay : tc) {
|
for (auto const & lay : tc) {
|
||||||
if (lay.toclevel == newtoclevel &&
|
if (lay.toclevel == newtoclevel
|
||||||
lay.labeltype == oldlabeltype) {
|
&& lay.isNumHeadingLabelType()
|
||||||
|
&& start->layout().isNumHeadingLabelType()) {
|
||||||
start->setLayout(lay);
|
start->setLayout(lay);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user