X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FText2.cpp;h=ed4b133ff53f4fc34fe994bf16264615979815e0;hb=7470305720d7733a27e9c6e5ef13a0774f5d0f77;hp=f1decc56f4f99b720e49043eaca7a2e25ab0b904;hpb=26ad2c6a67239b328266b355132664666a8af728;p=lyx.git diff --git a/src/Text2.cpp b/src/Text2.cpp index f1decc56f4..ed4b133ff5 100644 --- a/src/Text2.cpp +++ b/src/Text2.cpp @@ -182,7 +182,11 @@ void Text::setLayout(pit_type start, pit_type end, for (pit_type pit = start; pit != end; ++pit) { Paragraph & par = pars_[pit]; - par.applyLayout(lyxlayout); + // Is this a separating paragraph? If so, + // this needs to be standard layout + bool const is_separator = par.size() == 1 + && par.isEnvSeparator(0); + par.applyLayout(is_separator ? bp.documentClass().defaultLayout() : lyxlayout); if (lyxlayout.margintype == MARGIN_MANUAL) par.setLabelWidthString(par.expandLabel(lyxlayout, bp)); } @@ -483,7 +487,7 @@ void Text::setLabelWidthStringToSequence(Cursor const & cur, } -void Text::setParagraphs(Cursor & cur, docstring arg, bool merge) +void Text::setParagraphs(Cursor & cur, docstring const & arg, bool merge) { LBUFERR(cur.text()); @@ -603,7 +607,7 @@ bool Text::checkAndActivateInsetVisual(Cursor & cur, bool movingForward, bool mo if (cur.pos() == cur.lastpos()) return false; Paragraph & par = cur.paragraph(); - Inset * inset = par.isInset(cur.pos()) ? par.getInset(cur.pos()) : 0; + Inset * inset = par.isInset(cur.pos()) ? par.getInset(cur.pos()) : nullptr; if (!inset || !inset->editable()) return false; if (cur.selection() && cur.realAnchor().find(inset) == -1) @@ -917,7 +921,7 @@ bool Text::deleteEmptyParagraphMechanism(Cursor & cur, min(old.pit() + 1, old.lastpit())); ParagraphList & plist = old.text()->paragraphs(); bool const soa = oldpar.params().startOfAppendix(); - plist.erase(lyx::next(plist.begin(), old.pit())); + plist.erase(plist.iterator_at(old.pit())); // do not lose start of appendix marker (bug 4212) if (soa && old.pit() < pit_type(plist.size())) plist[old.pit()].params().startOfAppendix(true); @@ -989,7 +993,7 @@ void Text::deleteEmptyParagraphMechanism(pit_type first, pit_type last, bool tra continue; if (par.empty() || (par.size() == 1 && par.isLineSeparator(0))) { - pars_.erase(lyx::next(pars_.begin(), pit)); + pars_.erase(pars_.iterator_at(pit)); --pit; --last; continue;