* respect to the left and right margins.
*/
int const leftm = row_.isRTL() ? tm_.rightMargin(row_.pit())
- : tm_.leftMargin(row_.pit());
- int const rightm = row_.isRTL() ? tm_.leftMargin(row_.pit())
+ : tm_.leftMargin(row_.pit(), 1);
+ int const rightm = row_.isRTL() ? tm_.leftMargin(row_.pit(), 1)
: tm_.rightMargin(row_.pit());
x += leftm - row_.left_margin + (tm_.width() - leftm -rightm) / 2
- fm.width(str) / 2;
LASSERT(pit < int(pars.size()), return 0);
Paragraph const & par = pars[pit];
LASSERT(pos >= 0, return 0);
- LASSERT(pos <= par.size(), return 0);
+ // We do not really care whether pos > par.size(), since we do not
+ // access the data. It can be actially useful, when querying the
+ // margin without indentation (see RowPainter::paintTopLevelLabel).
+
Buffer const & buffer = bv_->buffer();
//lyxerr << "TextMetrics::leftMargin: pit: " << pit << " pos: " << pos << endl;
DocumentClass const & tclass = buffer.params().documentClass();
&& !text_->inset().neverIndent()
// display style insets do not need indentation
&& !(!par.empty()
- && par.isInset(pos)
- && par.getInset(pos)->rowFlags() & Inset::Display)
+ && par.isInset(0)
+ && par.getInset(0)->rowFlags() & Inset::Display)
&& (!(tclass.isDefaultLayout(par.layout())
|| tclass.isPlainLayout(par.layout()))
|| buffer.params().paragraph_separation