The branch, master, has been updated.

- Log -----------------------------------------------------------------

commit b1ce75058950c0388c9a8e0279c646b7f7d0df61
Author: Juergen Spitzmueller <[email protected]>
Date:   Sun Nov 25 18:13:57 2012 +0100

    allow arguments in PassThru insets

diff --git a/src/insets/InsetArgument.cpp b/src/insets/InsetArgument.cpp
index 943adef..256afcf 100644
--- a/src/insets/InsetArgument.cpp
+++ b/src/insets/InsetArgument.cpp
@@ -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))
diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp
index 2b65245..04bee82 100644
--- a/src/insets/InsetText.cpp
+++ b/src/insets/InsetText.cpp
@@ -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;
diff --git a/src/insets/InsetText.h b/src/insets/InsetText.h
index 4fb9fc3..0113e17 100644
--- a/src/insets/InsetText.h
+++ b/src/insets/InsetText.h
@@ -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(); }
        ///

-----------------------------------------------------------------------

Summary of changes:
 src/insets/InsetArgument.cpp |    6 +++++-
 src/insets/InsetText.cpp     |   12 ++++++++++++
 src/insets/InsetText.h       |    2 +-
 3 files changed, 18 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to