allow arguments in PassThru insets

This commit is contained in:
Juergen Spitzmueller 2012-11-25 18:13:57 +01:00
parent bf83ca75ef
commit b1ce750589
3 changed files with 18 additions and 2 deletions

View 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))

View 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;

View 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(); }
///