mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-09-20 06:49:56 +00:00
cprotect: don't consider content in Notes, deactivated branches etc.
This commit is contained in:
parent
16dc796a47
commit
00e00b32fd
@ -1090,7 +1090,7 @@ bool InsetText::needsCProtection(bool const maintext, bool const fragile) const
|
|||||||
{
|
{
|
||||||
// Nested cprotect content needs \cprotect
|
// Nested cprotect content needs \cprotect
|
||||||
// on each level
|
// on each level
|
||||||
if (hasCProtectContent(fragile))
|
if (producesOutput() && hasCProtectContent(fragile))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Environments generally need cprotection in fragile context
|
// Environments generally need cprotection in fragile context
|
||||||
@ -1105,6 +1105,11 @@ bool InsetText::needsCProtection(bool const maintext, bool const fragile) const
|
|||||||
if (!maintext && getLayout().latextype() != InsetLayout::COMMAND)
|
if (!maintext && getLayout().latextype() != InsetLayout::COMMAND)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
// If the inset does not produce output (e.g. Note or Branch),
|
||||||
|
// we can ignore the contained paragraphs
|
||||||
|
if (!producesOutput())
|
||||||
|
return false;
|
||||||
|
|
||||||
// Commands need cprotection if they contain specific chars
|
// Commands need cprotection if they contain specific chars
|
||||||
int const nchars_escape = 9;
|
int const nchars_escape = 9;
|
||||||
static char_type const chars_escape[nchars_escape] = {
|
static char_type const chars_escape[nchars_escape] = {
|
||||||
|
Loading…
Reference in New Issue
Block a user