mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 21:21:32 +00:00
allow arguments in PassThru insets
This commit is contained in:
parent
bf83ca75ef
commit
b1ce750589
@ -19,6 +19,7 @@
|
|||||||
#include "InsetList.h"
|
#include "InsetList.h"
|
||||||
#include "Layout.h"
|
#include "Layout.h"
|
||||||
#include "Lexer.h"
|
#include "Lexer.h"
|
||||||
|
#include "OutputParams.h"
|
||||||
#include "ParIterator.h"
|
#include "ParIterator.h"
|
||||||
|
|
||||||
#include "support/convert.h"
|
#include "support/convert.h"
|
||||||
@ -202,12 +203,15 @@ string InsetArgument::contextMenuName() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void InsetArgument::latexArgument(otexstream & os,
|
void InsetArgument::latexArgument(otexstream & os,
|
||||||
OutputParams const & runparams, docstring const & ldelim,
|
OutputParams const & runparams_in, docstring const & ldelim,
|
||||||
docstring const & rdelim) const
|
docstring const & rdelim) const
|
||||||
{
|
{
|
||||||
TexRow texrow;
|
TexRow texrow;
|
||||||
odocstringstream ss;
|
odocstringstream ss;
|
||||||
otexstream ots(ss, texrow);
|
otexstream ots(ss, texrow);
|
||||||
|
OutputParams runparams = runparams_in;
|
||||||
|
if (getLayout().isPassThru())
|
||||||
|
runparams.pass_thru = true;
|
||||||
InsetText::latex(ots, runparams);
|
InsetText::latex(ots, runparams);
|
||||||
docstring str = ss.str();
|
docstring str = ss.str();
|
||||||
if (ldelim != "{" && support::contains(str, rdelim))
|
if (ldelim != "{" && support::contains(str, rdelim))
|
||||||
|
@ -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)
|
void InsetText::updateBuffer(ParIterator const & it, UpdateType utype)
|
||||||
{
|
{
|
||||||
ParIterator it2 = it;
|
ParIterator it2 = it;
|
||||||
|
@ -149,7 +149,7 @@ public:
|
|||||||
///
|
///
|
||||||
ParagraphList const & paragraphs() const;
|
ParagraphList const & paragraphs() const;
|
||||||
///
|
///
|
||||||
bool insetAllowed(InsetCode) const { return !getLayout().isPassThru(); }
|
bool insetAllowed(InsetCode) const;
|
||||||
///
|
///
|
||||||
bool allowSpellCheck() const { return getLayout().spellcheck() && !getLayout().isPassThru(); }
|
bool allowSpellCheck() const { return getLayout().spellcheck() && !getLayout().isPassThru(); }
|
||||||
///
|
///
|
||||||
|
Loading…
Reference in New Issue
Block a user