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.
|| labeltype == LABEL_CENTERED
|| labeltype == LABEL_BIBLIO;
}
+ bool isNumHeadingLabelType() const {
+ return labeltype == LABEL_ABOVE
+ || labeltype == LABEL_CENTERED
+ || labeltype == LABEL_STATIC;
+ }
///
bool addToToc() const { return add_to_toc_; }
///
DocumentClass const & tc = buf.params().documentClass();
int const newtoclevel =
(mode == OutlineIn ? toclevel + 1 : toclevel - 1);
- LabelType const oldlabeltype = start->layout().labeltype;
for (auto const & lay : tc) {
- if (lay.toclevel == newtoclevel &&
- lay.labeltype == oldlabeltype) {
+ if (lay.toclevel == newtoclevel
+ && lay.isNumHeadingLabelType()
+ && start->layout().isNumHeadingLabelType()) {
start->setLayout(lay);
break;
}