lex.pushToken(token);
Paragraph par;
+ par.setInsetOwner(insetPtr);
par.params().depth(depth);
par.setFont(0, Font(inherit_font, buf.params().language));
- par.setInsetOwner(insetPtr);
pars_.push_back(par);
// FIXME: goddamn InsetTabular makes us pass a Buffer
// now, because Inset::getLayout() will return a default-constructed
// InsetLayout, and that e.g. sets the foreground color to red. So we
// need to do some work to make that possible.
- Inset const * inset = pars_[pit].inInset();
- InsetCollapsable const * icp = inset? inset->asInsetCollapsable() : 0;
+ InsetCollapsable const * icp = pars_[pit].inInset().asInsetCollapsable();
if (!icp)
return lf;
FontInfo icf = icp->getLayout().font();
if (layout.labelfont.family() == INHERIT_FAMILY)
lf.setFamily(buffer.params().getFont().fontInfo().family());
// FIXME As above....
- Inset const * inset = par.inInset();
- InsetCollapsable const * icp = inset? inset->asInsetCollapsable() : 0;
+ InsetCollapsable const * icp = par.inInset().asInsetCollapsable();
if (!icp)
return lf;
FontInfo icf = icp->getLayout().labelfont();
// add a separate paragraph for the caption inset
pars.push_back(Paragraph());
- pars.back().setInsetOwner(pars[0].inInset());
+ pars.back().setInsetOwner(&pars[0].inInset());
pars.back().setPlainOrDefaultLayout(tclass);
int cap_pit = pars.size() - 1;
// the graphics (or table).
if (!content) {
pars.push_back(Paragraph());
- pars.back().setInsetOwner(pars[0].inInset());
+ pars.back().setInsetOwner(&pars[0].inInset());
pars.back().setPlainOrDefaultLayout(tclass);
}
align = par.params().align();
// handle alignment inside tabular cells
- if (Inset const * owner = par.inInset()) {
- switch (owner->contentAlignment()) {
- case LYX_ALIGN_CENTER:
- case LYX_ALIGN_LEFT:
- case LYX_ALIGN_RIGHT:
- if (align == LYX_ALIGN_NONE
- || align == LYX_ALIGN_BLOCK)
- align = owner->contentAlignment();
- break;
- default:
- // unchanged (use align)
- break;
- }
+ Inset const & owner = par.inInset();
+ switch (owner.contentAlignment()) {
+ case LYX_ALIGN_CENTER:
+ case LYX_ALIGN_LEFT:
+ case LYX_ALIGN_RIGHT:
+ if (align == LYX_ALIGN_NONE
+ || align == LYX_ALIGN_BLOCK)
+ align = owner.contentAlignment();
+ break;
+ default:
+ // unchanged (use align)
+ break;
}
// Display-style insets should always be on a centred row
&& align == LYX_ALIGN_BLOCK
&& !par.params().noindent()
// in some insets, paragraphs are never indented
- && !(par.inInset() && par.inInset()->neverIndent())
+ && !par.inInset().neverIndent()
// display style insets are always centered, omit indentation
&& !(!par.empty()
&& par.isInset(pos)