]> git.lyx.org Git - lyx.git/commitdiff
NeedCProtect -1 also for InsetLayouts
authorJuergen Spitzmueller <spitz@lyx.org>
Tue, 14 May 2024 11:37:29 +0000 (13:37 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Wed, 15 May 2024 11:32:47 +0000 (13:32 +0200)
(cherry picked from commit a716fb96b534475759799b195a7edaeb049fbcf6)

lib/layouts/beamer.layout
src/insets/InsetLayout.cpp
src/insets/InsetLayout.h
src/insets/InsetText.cpp

index 58caf67c7d7aa52df10340004e8f02c9e65dca7a..8b9f1b2f690c2758f21fd4c2ceabf28505d1454c 100644 (file)
@@ -1576,6 +1576,7 @@ InsetLayout Flex:Only
   EndArgument
   ResetsFont       true
   CustomPars       false
+  NeedCProtect     -1
 End
 
 InsetLayout Flex:Uncover
@@ -1597,6 +1598,7 @@ InsetLayout Flex:Uncover
   EndArgument
   ResetsFont       true
   CustomPars       false
+  NeedCProtect     -1
 End
 
 InsetLayout Flex:Visible
@@ -1618,6 +1620,7 @@ InsetLayout Flex:Visible
   EndArgument
   ResetsFont       true
   CustomPars       false
+  NeedCProtect     -1
 End
 
 InsetLayout Flex:Invisible
@@ -1639,6 +1642,7 @@ InsetLayout Flex:Invisible
   EndArgument
   ResetsFont       true
   CustomPars       false
+  NeedCProtect     -1
 End
 
 InsetLayout Flex:Alternative
@@ -1666,6 +1670,7 @@ InsetLayout Flex:Alternative
   EndArgument
   ResetsFont       true
   CustomPars       false
+  NeedCProtect     -1
 End
 
 InsetLayout Flex:Beamer_Note
@@ -1701,6 +1706,7 @@ InsetLayout Flex:ArticleMode
    LabelString     Article
    MultiPar        true
    ResetsFont      true
+   NeedCProtect    -1
 End
 
 InsetLayout Flex:PresentationMode
@@ -1712,6 +1718,7 @@ InsetLayout Flex:PresentationMode
    LabelString     Presentation
    MultiPar        true
    ResetsFont      true
+   NeedCProtect    -1
 End
 
 
index 8e5ed651cf4329dd90f1bb69a2536c7b2fde5f10..b4c7dc4eeeb9d6d21cda7f292809cb4dbf6e3246 100644 (file)
@@ -400,9 +400,17 @@ bool InsetLayout::read(Lexer & lex, TextClass const & tclass,
                case IL_NEEDPROTECT:
                        lex >> needprotect_;
                        break;
-               case IL_NEEDCPROTECT:
-                       lex >> needcprotect_;
+               case IL_NEEDCPROTECT: {
+                       string val;
+                       lex >> val;
+                       nocprotect_ = false;
+                       needcprotect_ = false;
+                       if (val == "-1")
+                               nocprotect_ = true;
+                       else if (val == "1" || val == "true")
+                               needcprotect_ = true;
                        break;
+               }
                case IL_NEEDMBOXPROTECT:
                        lex >> needmboxprotect_;
                        break;
index 6700100252a24b3996938b5d5359c1ad4f407b18..ee5d4afefae0c2a31c946520fef52c04ba2ea336 100644 (file)
@@ -221,6 +221,8 @@ public:
        bool isNeedProtect() const { return needprotect_; }
        ///
        bool needsCProtect() const { return needcprotect_; }
+       ///
+       bool noCProtect() const { return nocprotect_; }
        /// Protection of some elements such as \ref and \cite
        /// in \mbox (needed by commands building on soul or ulem)
        bool isNeedMBoxProtect() const { return needmboxprotect_; }
@@ -415,6 +417,8 @@ private:
        ///
        bool needcprotect_ = false;
        ///
+       bool nocprotect_ = false;
+       ///
        bool needmboxprotect_ = false;
        /// should the contents be written to TOC strings?
        bool intoc_ = false;
index 9a60f4d85515cf8b5287fdd16188c774219ab760..5552d479befede8c3e84597a868b8d1a2343cdfa 100644 (file)
@@ -549,6 +549,8 @@ void InsetText::latex(otexstream & os, OutputParams const & runparams) const
                ++rp.inulemcmd;
        if (!il.passThruChars().empty())
                rp.pass_thru_chars += il.passThruChars();
+       if (il.noCProtect())
+               rp.no_cprotect = true;
        if (!il.newlineCmd().empty())
                rp.newlinecmd = il.newlineCmd();
        rp.par_begin = 0;