- // is it a last row?
-#ifndef NEW_INSETS
- LyXParagraph * par = row_ptr->par()->LastPhysicalPar();
-#else
- LyXParagraph * par = row_ptr->par();
-#endif
- if (
-#ifndef NEW_INSETS
- row_ptr->par()->ParFromPos(last + 1) == par
-#else
- row_ptr->par() == par
-#endif
- && (!row_ptr->next() || row_ptr->next()->par() != row_ptr->par()))
- {
- // think about the margins
- if (!row_ptr->next() && bv_owner)
- y_bottom -= LYX_PAPER_MARGIN;
-
- // draw a bottom pagebreak
- if (firstpar->params.pagebreakBottom()) {
- LyXFont pb_font;
- pb_font.setColor(LColor::pagebreak).decSize();
- int const y_place = y_offset + y_bottom
- - 2 * DefaultHeight();
-
- int w = 0;
- int a = 0;
- int d = 0;
- pain
- .line(0, y_place, ww, y_place,
- LColor::pagebreak,
- Painter::line_onoffdash)
- .rectText(0, 0,
- _("Page Break (bottom)"),
- pb_font,
- LColor::background,
- LColor::background, false, w, a, d);
- pain.rectText((ww - w) / 2, y_place + d,
- _("Page Break (bottom)"),
- pb_font,
- LColor::background,
- LColor::background);
- y_bottom -= 3 * DefaultHeight();
- }
-
- if (firstpar->params.spaceBottom().kind() == VSpace::VFILL) {
- // draw a vfill bottom
- int const y_place = y_offset + y_bottom
- - 3 * DefaultHeight();
-
- pain.line(0, y_place,
- LYX_PAPER_MARGIN, y_place,
- LColor::vfillline);
- pain.line(0, y_offset + y_bottom - 2,
- LYX_PAPER_MARGIN,
- y_offset + y_bottom - 2,
- LColor::vfillline);
- pain.line(LYX_PAPER_MARGIN / 2,
- y_place,
- LYX_PAPER_MARGIN / 2,
- y_offset + y_bottom - 2,
- LColor::vfillline);
- y_bottom -= 3 * DefaultHeight();
- }
-
- // think about user added space
- y_bottom -= int(firstpar->params.spaceBottom().inPixels(bview));
-
- if (firstpar->params.lineBottom()) {
- // draw a bottom line
-#ifndef NEW_INSETS
- y_bottom -= lyxfont::ascent('x',
- GetFont(bview->buffer(),
- par,
- par->Last() - 1));
-#else
- y_bottom -= lyxfont::ascent('x',
- GetFont(bview->buffer(),
- par,
- par->size() - 1));
-#endif
- int const w = (inset_owner ?
- inset_owner->width(bview, font) : ww);
- int const xp = static_cast<int>(inset_owner ? x : 0);
- pain.line(xp, y_offset + y_bottom,
- w, y_offset + y_bottom,
- LColor::topline, Painter::line_solid,
- Painter::line_thick);
-#ifndef NEW_INSETS
- y_bottom -= lyxfont::ascent('x',
- GetFont(bview->buffer(),
- par,
- par->Last() - 1));
-#else
- y_bottom -= lyxfont::ascent('x',
- GetFont(bview->buffer(),
- par,
- par->size() - 1));
-#endif
- }
-
- // draw an endlabel
- int const endlabel =
- row_ptr->par()->GetEndLabel(bview->buffer()->params);
- switch (endlabel) {
- case END_LABEL_BOX:
- case END_LABEL_FILLED_BOX:
- {
- LyXFont const font = GetFont(bview->buffer(),
- row_ptr->par(), last);
- int const size = int(0.75 * lyxfont::maxAscent(font));
- int const y = (y_offset + row_ptr->baseline()) - size;
- int x = is_rtl ? LYX_PAPER_MARGIN
- : ww - LYX_PAPER_MARGIN - size;
-#ifndef NEW_INSETS
- if (row_ptr->par()->footnoteflag == LyXParagraph::OPEN_FOOTNOTE)
- if (is_rtl) {
- LyXFont font(LyXFont::ALL_SANE);
- font.setSize(LyXFont::SIZE_SMALL);
- x += lyxfont::width("Mwide-figM", font);
- } else
- x -= LYX_PAPER_MARGIN/2;
-#endif
- if (row_ptr->fill() <= size)
- x += (size - row_ptr->fill() + 1) * (is_rtl ? -1 : 1);
- if (endlabel == END_LABEL_BOX) {
- pain.line(x, y, x, y + size,
- LColor::eolmarker);
- pain.line(x + size, y, x + size , y + size,
- LColor::eolmarker);
- pain.line(x, y, x + size, y,
- LColor::eolmarker);
- pain.line(x, y + size, x + size, y + size,
- LColor::eolmarker);
- } else
- pain.fillRectangle(x, y, size, size,
- LColor::eolmarker);
- break;
- }
- case END_LABEL_STATIC:
- {
- LyXTextClass::LayoutList::size_type layout = row_ptr->par()->GetLayout();
- string const tmpstring = textclasslist.
- Style(bview->buffer()->params.textclass,
- layout).endlabelstring();
- font = GetFont(bview->buffer(), row_ptr->par(), -2);
- int const tmpx = is_rtl ?
- int(x) - lyxfont::width(tmpstring, font)
- : ww - RightMargin(bview->buffer(), row_ptr) - row_ptr->fill();
- pain.text( tmpx, y_offset + row_ptr->baseline(), tmpstring, font);
- break;
- }
- case END_LABEL_NO_LABEL:
- break;
- }
+
+void LyXText::paintLastRow(DrawRowParams & p)
+{
+ Paragraph * par = p.row->par();
+ ParagraphParameters const & parparams = par->params();
+ int y_bottom = p.row->height();
+
+ // think about the margins
+ if (!p.row->next() && bv_owner)
+ y_bottom -= LYX_PAPER_MARGIN;
+
+ int const ww = p.bv->workWidth();
+
+ // draw a bottom pagebreak
+ if (parparams.pagebreakBottom()) {
+ LyXFont pb_font;
+ pb_font.setColor(LColor::pagebreak).decSize();
+ int const y = p.yo + y_bottom - 2 * defaultHeight();
+
+ p.pain->line(p.xo, y, p.xo + p.width, y, LColor::pagebreak, Painter::line_onoffdash);
+
+ int w = 0;
+ int a = 0;
+ int d = 0;
+ lyxfont::rectText(_("Page Break (bottom)"), pb_font, w, a, d);
+ p.pain->rectText((ww - w) / 2, y + d,
+ _("Page Break (bottom)"),
+ pb_font, backgroundColor(), backgroundColor());
+
+ y_bottom -= 3 * defaultHeight();