]> git.lyx.org Git - features.git/commitdiff
allow arguments in PassThru insets
authorJuergen Spitzmueller <spitz@lyx.org>
Sun, 25 Nov 2012 17:13:57 +0000 (18:13 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Sun, 25 Nov 2012 17:13:57 +0000 (18:13 +0100)
src/insets/InsetArgument.cpp
src/insets/InsetText.cpp
src/insets/InsetText.h

index 943adef319ef345a7024ee213314eea81712908c..256afcfe29e130c8a971f33bb8e7d3a17248063f 100644 (file)
@@ -19,6 +19,7 @@
 #include "InsetList.h"
 #include "Layout.h"
 #include "Lexer.h"
+#include "OutputParams.h"
 #include "ParIterator.h"
 
 #include "support/convert.h"
@@ -202,12 +203,15 @@ string InsetArgument::contextMenuName() const
 }
 
 void InsetArgument::latexArgument(otexstream & os,
-               OutputParams const & runparams, docstring const & ldelim,
+               OutputParams const & runparams_in, docstring const & ldelim,
                docstring const & rdelim) const
 {
        TexRow texrow;
        odocstringstream ss;
        otexstream ots(ss, texrow);
+       OutputParams runparams = runparams_in;
+       if (getLayout().isPassThru())
+               runparams.pass_thru = true;
        InsetText::latex(ots, runparams);
        docstring str = ss.str();
        if (ldelim != "{" && support::contains(str, rdelim))
index 2b65245b5b67dc966f9615e7f62bd3213081cd85..04bee82873fe000e1f466bc0fafcd82ee3a62cf2 100644 (file)
@@ -714,6 +714,18 @@ ParagraphList & InsetText::paragraphs()
 }
 
 
+bool InsetText::insetAllowed(InsetCode code) const
+{
+       switch (code) {
+       // Arguments are also allowed in PassThru insets
+       case ARG_CODE:
+               return true;
+       default:
+               return !getLayout().isPassThru();
+       }
+}
+
+
 void InsetText::updateBuffer(ParIterator const & it, UpdateType utype)
 {
        ParIterator it2 = it;
index 4fb9fc35d8804c3fcf7fc2f813955d05fb7da863..0113e174dd2061aab2b1fb16e9b057f00a64f526 100644 (file)
@@ -149,7 +149,7 @@ public:
        ///
        ParagraphList const & paragraphs() const;
        ///
-       bool insetAllowed(InsetCode) const { return !getLayout().isPassThru(); }
+       bool insetAllowed(InsetCode) const;
        ///
        bool allowSpellCheck() const { return getLayout().spellcheck() && !getLayout().isPassThru(); }
        ///