So remove that, and restructure the code a bit.
// is it a nested text inset?
case TEXT_CODE: {
InsetText const * itext = insit.inset->asInsetText();
- // Inset needs its own scope?
- bool newScope = itext->isMacroScope();
-
- // scope which ends just behind the inset
- DocIterator insetScope = it;
- ++insetScope.pos();
// collect macros in inset
it.push_back(CursorSlice(*insit.inset));
- updateMacros(it, newScope ? insetScope : scope);
+ if (itext->producesOutput()) {
+ // the simple case
+ updateMacros(it, scope);
+ } else {
+ // We don't want macros declared in notes, comments, etc,
+ // to affect anything outside them.
+ // New scope which ends just behind the inset
+ DocIterator new_scope = it;
+ ++new_scope.pos();
+ updateMacros(it, new_scope);
+ }
it.pop_back();
break;
}
}
-bool InsetBranch::isMacroScope() const
-{
- // Its own scope if not selected by buffer
- return !producesOutput();
-}
-
-
string InsetBranch::params2string(InsetBranchParams const & params)
{
ostringstream data;
///
bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const override;
///
- bool isMacroScope() const override;
- ///
docstring toolTip(BufferView const & bv, int x, int y) const override;
///
bool usePlainLayout() const override { return false; }
}
-bool InsetNote::isMacroScope() const
-{
- // LyX note has no latex output
- if (params_.type == InsetNoteParams::Note)
- return true;
-
- return InsetCollapsible::isMacroScope();
-}
-
-
void InsetNote::latex(otexstream & os, OutputParams const & runparams_in) const
{
if (params_.type == InsetNoteParams::Note)
/// show the note dialog
bool showInsetDialog(BufferView * bv) const override;
///
- bool isMacroScope() const override;
- ///
void latex(otexstream &, OutputParams const &) const override;
///
int plaintext(odocstringstream & ods, OutputParams const & op,
///
bool allowSpellCheck() const override { return getLayout().spellcheck() && !getLayout().isPassThru(); }
///
- virtual bool isMacroScope() const { return false; }
- ///
bool allowMultiPar() const override { return getLayout().isMultiPar(); }
///
bool isInTitle() const override { return intitle_context_; }