// now check whether we have insets that need cprotection
pos_type size = d->text_.size();
for (pos_type i = 0; i < size; ++i)
- if (isInset(i) && getInset(i)->needsCProtection())
+ if (isInset(i) && getInset(i)->needsCProtection(maintext))
return true;
return false;
virtual void rejectChanges() {}
///
- virtual bool needsCProtection() const { return false; }
+ virtual bool needsCProtection(bool const) const { return false; }
///
virtual ColorCode backgroundColor(PainterInfo const &) const;
}
-bool InsetText::needsCProtection() const
+bool InsetText::needsCProtection(bool const maintext) const
{
// Nested cprotect content needs \cprotect
// on each level
// Environments and "no latex" types (e.g., knitr chunks)
// need cprotection regardless the content
- if (getLayout().latextype() != InsetLayout::COMMAND)
+ if (!maintext && getLayout().latextype() != InsetLayout::COMMAND)
return true;
// Commands need cprotection if they contain specific chars
bool confirmDeletion() const { return !text().empty(); }
///
- bool needsCProtection() const;
+ bool needsCProtection(bool const maintext = false) const;
///
bool hasCProtectContent() const;