From: Juergen Spitzmueller Date: Sun, 25 Nov 2012 17:13:57 +0000 (+0100) Subject: allow arguments in PassThru insets X-Git-Tag: 2.1.0beta1~1197 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=b1ce75058950c0388c9a8e0279c646b7f7d0df61;p=features.git allow arguments in PassThru insets --- diff --git a/src/insets/InsetArgument.cpp b/src/insets/InsetArgument.cpp index 943adef319..256afcfe29 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 2b65245b5b..04bee82873 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 4fb9fc35d8..0113e174dd 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(); } ///