- /* 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->pagebreak_bottom) {
- LyXFont pb_font;
- pb_font.setColor(LColor::pagebreak).decSize();
- int w = 0, a = 0, d = 0;
- pain.line(0,
- y_offset + y_bottom - 2 * DefaultHeight(),
- ww,
- y_offset + y_bottom - 2 * DefaultHeight(),
- 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_offset + y_top + 2 * DefaultHeight() + d,
- _("Page Break (bottom)"),
- pb_font,
- LColor::background,
- LColor::background);
- y_bottom -= 3 * DefaultHeight();
- }
-
- if (firstpar->added_space_bottom.kind() == VSpace::VFILL) {
- /* draw a vfill bottom */
- pain.line(0, y_offset + y_bottom - 3 * DefaultHeight(),
- LYX_PAPER_MARGIN,
- y_offset + y_bottom - 3 * DefaultHeight(),
- 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_offset + y_bottom - 3 * DefaultHeight(),
- LYX_PAPER_MARGIN / 2,
- y_offset + y_bottom - 2,
- LColor::vfillline);
- y_bottom -= 3 * DefaultHeight();
- }
-
- /* think about user added space */
- y_bottom -= int(firstpar->added_space_bottom.inPixels(bview));
-
- if (firstpar->line_bottom) {
- /* draw a bottom line */
- y_bottom -= lyxfont::ascent('x', GetFont(bview->buffer(),
- par, par->Last() - 1));
- int w = (inset_owner ? inset_owner->width(bview, font) : ww);
- int 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);
- y_bottom -= lyxfont::ascent('x', GetFont(bview->buffer(),
- par, par->Last() - 1));
- }
-
- // draw an endlabel
- int endlabel = row_ptr->par()->GetEndLabel(bview->buffer()->params);
- switch (endlabel) {
- case END_LABEL_BOX:
- case END_LABEL_FILLED_BOX:
- {
- LyXFont font = GetFont(bview->buffer(),
- row_ptr->par(), last);
- int size = int(0.75 * lyxfont::maxAscent(font));
- int 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 tmpstring = textclasslist.Style(bview->buffer()->params.textclass,
- layout).endlabelstring();
- font = GetFont(bview->buffer(), row_ptr->par(), -2);
- int 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();