// We specialize the 95% common case:
if (!par.getDepth()) {
Font f = par.getFontSettings(params, pos);
- if (!text_->isMainText(buffer))
+ if (!text_->isMainText())
applyOuterFont(f);
bool lab = layout.labeltype == LABEL_MANUAL && pos < body_pos;
Font font = par.getFontSettings(params, pos);
font.fontInfo().realize(layoutfont);
- if (!text_->isMainText(buffer))
+ if (!text_->isMainText())
applyOuterFont(font);
// Realize against environment font information
row.label_hfill = 0;
row.separator = 0;
- Buffer & buffer = bv_->buffer();
Paragraph const & par = text_->getPar(pit);
double w = width - row.width();
//lyxerr << "row.width() " << row.width() << endl;
//lyxerr << "w " << w << endl;
- bool const is_rtl = text_->isRTL(buffer, par);
+ bool const is_rtl = text_->isRTL(par);
if (is_rtl)
row.x = rightMargin(pit);
else
if (body_pos > 0
&& (body_pos > end || !par.isLineSeparator(body_pos - 1)))
{
- row.x += theFontMetrics(text_->labelFont(buffer, par)).
+ row.x += theFontMetrics(text_->labelFont(par)).
width(layout.labelsep);
if (body_pos <= end)
row.x += row.label_hfill;
int TextMetrics::labelFill(pit_type const pit, Row const & row) const
{
- Buffer & buffer = bv_->buffer();
Paragraph const & par = text_->getPar(pit);
pos_type last = par.beginOfBody();
return 0;
FontMetrics const & fm
- = theFontMetrics(text_->labelFont(buffer, par));
+ = theFontMetrics(text_->labelFont(par));
return max(0, fm.width(label) - w);
}
pit_type TextMetrics::rowBreakPoint(int width, pit_type const pit,
pit_type pos) const
{
- Buffer & buffer = bv_->buffer();
ParagraphMetrics const & pm = par_metrics_[pit];
Paragraph const & par = text_->getPar(pit);
pos_type const end = par.size();
// add the auto-hfill from label end to the body
if (body_pos && i == body_pos) {
FontMetrics const & fm = theFontMetrics(
- text_->labelFont(buffer, par));
+ text_->labelFont(par));
int add = fm.width(layout.labelsep);
if (par.isLineSeparator(i - 1))
add -= singleWidth(pit, i - 1);
int TextMetrics::rowWidth(int right_margin, pit_type const pit,
pos_type const first, pos_type const end) const
{
- Buffer & buffer = bv_->buffer();
// get the pure distance
ParagraphMetrics const & pm = par_metrics_[pit];
Paragraph const & par = text_->getPar(pit);
for ( ; i < end; ++i, ++fi) {
if (body_pos > 0 && i == body_pos) {
FontMetrics const & fm = theFontMetrics(
- text_->labelFont(buffer, par));
+ text_->labelFont(par));
w += fm.width(par.layout().labelsep);
if (par.isLineSeparator(i - 1))
w -= singleWidth(pit, i - 1);
if (body_pos > 0 && body_pos >= end) {
FontMetrics const & fm = theFontMetrics(
- text_->labelFont(buffer, par));
+ text_->labelFont(par));
w += fm.width(par.layout().labelsep);
if (end > 0 && par.isLineSeparator(end - 1))
w -= singleWidth(pit, end - 1);
Buffer const & buffer = bv_->buffer();
Font font = displayFont(pit, first);
FontSize const tmpsize = font.fontInfo().size();
- font.fontInfo() = text_->layoutFont(buffer, pit);
+ font.fontInfo() = text_->layoutFont(pit);
FontSize const size = font.fontInfo().size();
font.fontInfo().setSize(tmpsize);
- FontInfo labelfont = text_->labelFont(buffer, par);
+ FontInfo labelfont = text_->labelFont(par);
FontMetrics const & labelfont_metrics = theFontMetrics(labelfont);
FontMetrics const & fontmetrics = theFontMetrics(font);
// these are minimum values
double const spacing_val = layout.spacing.getValue()
- * text_->spacing(buffer, par);
+ * text_->spacing(par);
//lyxerr << "spacing_val = " << spacing_val << endl;
int maxasc = int(fontmetrics.maxAscent() * spacing_val);
int maxdesc = int(fontmetrics.maxDescent() * spacing_val);
&& !par.params().labelString().empty()) {
labeladdon = int(labelfont_metrics.maxHeight()
* layout.spacing.getValue()
- * text_->spacing(buffer, par));
+ * text_->spacing(par));
}
// special code for the top label
labeladdon = int(
labelfont_metrics.maxHeight()
* layout.spacing.getValue()
- * text_->spacing(buffer, par)
+ * text_->spacing(par)
+ (layout.topsep + layout.labelbottomsep) * dh);
}
last_tmpx = tmpx;
if (body_pos > 0 && c == body_pos - 1) {
FontMetrics const & fm = theFontMetrics(
- text_->labelFont(buffer, par));
+ text_->labelFont(par));
tmpx += row.label_hfill + fm.width(layout.labelsep);
if (par.isLineSeparator(body_pos - 1))
tmpx -= singleWidth(pit, body_pos - 1);
// If lastrow is false, we don't need to compute
// the value of rtl.
- bool const rtl = lastrow ? text_->isRTL(buffer, par) : false;
+ bool const rtl = lastrow ? text_->isRTL(par) : false;
if (lastrow &&
((rtl && left_side && vc == row.pos() && x < tmpx - 5) ||
(!rtl && !left_side && vc == end && x > tmpx + 5))) {
if (end <= row_pos)
cursor_vpos = row_pos;
else if (ppos >= end)
- cursor_vpos = text_->isRTL(buffer, par) ? row_pos : end;
+ cursor_vpos = text_->isRTL(par) ? row_pos : end;
else if (ppos > row_pos && ppos >= end)
// Place cursor after char at (logical) position pos - 1
cursor_vpos = (bidi.level(ppos - 1) % 2 == 0)
pos_type pos = bidi.vis2log(vpos);
if (body_pos > 0 && pos == body_pos - 1) {
FontMetrics const & labelfm = theFontMetrics(
- text_->labelFont(buffer, par));
+ text_->labelFont(par));
x += row.label_hfill + labelfm.width(par.layout().labelsep);
if (par.isLineSeparator(body_pos - 1))
x -= singleWidth(pit, body_pos - 1);
int l_margin = 0;
- if (text_->isMainText(buffer))
+ if (text_->isMainText())
l_margin += bv_->leftMargin();
l_margin += theFontMetrics(buffer.params().getFont()).signedWidth(
&& pit > 0 && pars[pit - 1].layout().nextnoindent)
parindent.erase();
- FontInfo const labelfont = text_->labelFont(buffer, par);
+ FontInfo const labelfont = text_->labelFont(par);
FontMetrics const & labelfont_metrics = theFontMetrics(labelfont);
switch (layout.margintype) {
// 12 lines lower):
if (lyxerr.debugging(Debug::PAINTING) && inside
&& (row.selection() || pi.full_repaint || row_has_changed)) {
- string const foreword = text_->isMainText(bv_->buffer()) ?
+ string const foreword = text_->isMainText() ?
"main text redraw " : "inset text redraw: ";
LYXERR(Debug::PAINTING, foreword << "pit=" << pit << " row=" << i
<< " row_selection=" << row.selection()
bool const begin_boundary = beg.pos() >= row.endpos();
bool const end_boundary = row.sel_end == row.endpos();
- Buffer & buffer = bv_->buffer();
DocIterator cur = beg;
cur.boundary(begin_boundary);
int x1 = cursorX(beg.top(), begin_boundary);
int const y1 = bv_->getPos(cur, cur.boundary()).y_ - row.ascent();
int const y2 = y1 + row.height();
- int const rm = text_->isMainText(buffer) ? bv_->rightMargin() : 0;
- int const lm = text_->isMainText(buffer) ? bv_->leftMargin() : 0;
+ int const rm = text_->isMainText() ? bv_->rightMargin() : 0;
+ int const lm = text_->isMainText() ? bv_->leftMargin() : 0;
// draw the margins
if (row.begin_margin_sel) {
- if (text_->isRTL(buffer, beg.paragraph())) {
+ if (text_->isRTL(beg.paragraph())) {
pi.pain.fillRectangle(x + x1, y1, width() - rm - x1, y2 - y1,
Color_selection);
} else {
}
if (row.end_margin_sel) {
- if (text_->isRTL(buffer, beg.paragraph())) {
+ if (text_->isRTL(beg.paragraph())) {
pi.pain.fillRectangle(x + lm, y1, x2 - lm, y2 - y1,
Color_selection);
} else {