pair<pit_type, ParagraphMetrics const *> TextMetrics::last() const
{
+ LASSERT(!par_metrics_.empty(), /**/);
ParMetricsCache::const_reverse_iterator it = par_metrics_.rbegin();
return make_pair(it->first, &it->second);
}
}
+// isRTLBoundary returns false on a real end-of-line boundary,
+// because otherwise the two boundary types get mixed up.
+// This is the whole purpose of this being in TextMetrics.
bool TextMetrics::isRTLBoundary(pit_type pit, pos_type pos,
Font const & font) const
{
}
// redo insets
- // FIXME: We should always use getFont(), see documentation of
- // noFontChange() in Inset.h.
Font const bufferfont = buffer.params().getFont();
InsetList::const_iterator ii = par.insetList().begin();
InsetList::const_iterator iend = par.insetList().end();
Dimension dim;
int const w = max_width_ - leftMargin(max_width_, pit, ii->pos)
- right_margin;
- Font const & font = ii->inset->noFontChange() ?
- bufferfont : displayFont(pit, ii->pos);
+ Font const & font = ii->inset->inheritFont() ?
+ displayFont(pit, ii->pos) : bufferfont;
MacroContext mc(&buffer, parPos);
MetricsInfo mi(bv_, font.fontInfo(), w, mc);
ii->inset->metrics(mi, dim);
if (first == 0 && topBottomSpace) {
BufferParams const & bufparams = buffer.params();
// some parskips VERY EASY IMPLEMENTATION
- if (bufparams.paragraph_separation
- == BufferParams::ParagraphSkipSeparation
- && inset.lyxCode() != ERT_CODE
- && inset.lyxCode() != LISTINGS_CODE
- && pit > 0
- && ((layout.isParagraph() && par.getDepth() == 0)
- || (pars[pit - 1].layout().isParagraph()
- && pars[pit - 1].getDepth() == 0)))
- {
- maxasc += bufparams.getDefSkip().inPixels(*bv_);
+ if (bufparams.paragraph_separation == BufferParams::ParagraphSkipSeparation
+ && !inset.getLayout().parbreakIsNewline()
+ && !par.layout().parbreak_is_newline
+ && pit > 0
+ && ((layout.isParagraph() && par.getDepth() == 0)
+ || (pars[pit - 1].layout().isParagraph()
+ && pars[pit - 1].getDepth() == 0))) {
+ maxasc += bufparams.getDefSkip().inPixels(*bv_);
}
if (par.params().startOfAppendix())
// This should be just before or just behind the
// cursor position set above.
LASSERT(inset == inset_before
- || inset == pars[pit].getInset(pos), /**/);
+ || inset == pars[pit].getInset(pos), return 0);
// Make sure the cursor points to the position before
// this inset.
|| (layout.labeltype == LABEL_STATIC
&& layout.latextype == LATEX_ENVIRONMENT
&& !text_->isFirstInSequence(pit)))
- && align == LYX_ALIGN_BLOCK
+ && (align == LYX_ALIGN_BLOCK || align == LYX_ALIGN_LEFT)
&& !par.params().noindent()
// in some insets, paragraphs are never indented
&& !text_->inset().neverIndent()