// ArabTeX, though, cannot handle this special behavior, it seems.
bool arabtex = basefont.language()->lang() == "arabic_arabtex"
|| running_font.language()->lang() == "arabic_arabtex";
- if (open_font && !inset->inheritFont()) {
+ if (open_font && (!inset->inheritFont() || inset->allowMultiPar())) {
bool closeLanguage = arabtex
|| basefont.isRightToLeft() == running_font.isRightToLeft();
unsigned int count = running_font.latexWriteStartChanges(os, bparams,
&& runningChange == change
&& change.type == Change::DELETED
&& !os.afterParbreak());
- bool const non_inherit_inset =
- (c == META_INSET && getInset(i) && !getInset(i)->inheritFont());
+ bool const multipar_inset =
+ (c == META_INSET && getInset(i) && getInset(i)->allowMultiPar());
// Do we need to close the previous font?
if (open_font &&
((current_font != running_font
|| current_font.language() != running_font.language())
- || (non_inherit_inset
+ || (multipar_inset
&& (current_font == prev_font
|| current_font.language() == prev_font.language()))))
{
column += 1;
}
otexstringstream ots;
- if (!non_inherit_inset) {
+ if (!multipar_inset) {
column += current_font.latexWriteStartChanges(ots, bparams,
runparams, basefont, last_font, false,
needsCProtection(runparams.moving_arg));
}
}
// We need to restore these after insets with
- // inheritFont() false
+ // allowMultiPar() true
Font const save_running_font = running_font;
Font const save_basefont = basefont;
d->latexInset(bparams, os, rp, running_font,
basefont, real_outerfont, open_font,
runningChange, style, i, column);
- if (non_inherit_inset) {
+ if (multipar_inset) {
running_font = save_running_font;
basefont = save_basefont;
}
virtual bool asciiOnly() const { return false; }
/// returns whether this inset is allowed in other insets of given mode
virtual bool allowedIn(mode_type) const { return true; }
+ /// returns whether paragraph breaks can occur inside this inset
+ virtual bool allowMultiPar() const { return false; }
/**
* The font is inherited from the parent for LaTeX export if this
* method returns true. No open font changes are closed in front of
void metrics(MetricsInfo &, Dimension &) const;
/// Needs to be same as InsetTabular
bool inheritFont() const { return false; }
+ /// Can the cell contain several paragraphs?
+ bool allowMultiPar() const { return !isMultiRow && (!isMultiColumn || isFixedWidth); }
private:
/// unimplemented
InsetTableCell();
virtual bool forceLocalFontSwitch() const;
/// Is the width forced to some value?
bool hasFixedWidth() const { return isFixedWidth; }
- /// Can the cell contain several paragraphs?
- bool allowMultiPar() const { return !isMultiRow && (!isMultiColumn || isFixedWidth); }
};
insets that may contain several paragraphs */
bool inheritFont() const { return false; }
///
+ bool allowMultiPar() const;
+ ///
bool allowsCaptionVariation(std::string const &) const;
//
bool isTable() const { return true; }