X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Frowpainter.cpp;h=d9e41253e62d56983d1f73525f8b93d3a5699c6d;hb=12dbcf2ee1792391a81d265ee8875ccf621033ca;hp=9844e2d14642ca17f29cdbdc9bdcd16141724a27;hpb=72535633e3d4f9a42c22561029e34a6b8d0b0bba;p=lyx.git diff --git a/src/rowpainter.cpp b/src/rowpainter.cpp index 9844e2d146..d9e41253e6 100644 --- a/src/rowpainter.cpp +++ b/src/rowpainter.cpp @@ -471,7 +471,8 @@ void RowPainter::paintChangeBar() void RowPainter::paintAppendix() { - if (!par_.params().appendix()) + // only draw the appendix frame once (for the main text) + if (!par_.params().appendix() || !text_.isMainText(*bv_.buffer())) return; int y = yo_ - row_.ascent(); @@ -917,13 +918,21 @@ bool inNarrowInset(PainterInfo & pi) { // check whether the current inset is nested in a non-wide inset Cursor & cur = pi.base.bv->cursor(); - for (int i = cur.depth() - 1; --i >= 0; ) { + Inset const * cur_in = &cur.inset(); + // check all higher nested insets + for (size_type i = 1; i < cur.depth(); ++i) { Inset * const in = &cur[i].inset(); - if (in) { + if (in == cur_in) + // we reached the level of the current inset, so stop + return false; + else if (in) { + if (in->hasFixedWidth()) + return true; InsetText * t = const_cast(in->asTextInset()); - if (t) - return !t->wide(); + if (t && !t->wide()) + // OK, we are in a non-wide() inset + return true; } } return false; @@ -999,7 +1008,7 @@ void paintPar // Clear background of this row // (if paragraph background was not cleared) if (!repaintAll && - (!(in_inset_alone_on_row && leftEdgeFixed) + (!(in_inset_alone_on_row && leftEdgeFixed && !inNarrowIns) || row_has_changed)) { pi.pain.fillRectangle(x, y - rit->ascent(), rp.maxWidth(), rit->height(),