// look for macros in each paragraph
while (it.pit() <= lastpit) {
Paragraph & par = it.paragraph();
-
// iterate over the insets of the current paragraph
for (auto const & insit : par.insetList()) {
it.pos() = insit.pos;
-
- if (InsetText * itext = insit.inset->asInsetText()) {
- // collect macros in inset
- it.push_back(CursorSlice(*insit.inset));
- itext->updateMacros(it, ourscope);
- it.pop_back();
- continue;
- }
-
- if (InsetTabular * itext = insit.inset->asInsetTabular()) {
- it.push_back(CursorSlice(*insit.inset));
- itext->updateMacros(it, ourscope);
- it.pop_back();
- continue;
- }
-
- // is it an external file?
- if (insit.inset->lyxCode() == INCLUDE_CODE) {
- insit.inset->updateMacros(it, ourscope);
- continue;
- }
-
- InsetMath * im = insit.inset->asInsetMath();
- if (im) {
- InsetMathHull * hull = im->asHullInset();
- if (hull)
- hull->updateMacros(it, ourscope);
- }
-
- if (insit.inset->lyxCode() != MATHMACRO_CODE)
- continue;
-
- // get macro data
- InsetMathMacroTemplate * macroTemplate =
- insit.inset->asInsetMath()->asMacroTemplate();
- macroTemplate->updateMacros(it, ourscope);
+ it.push_back(CursorSlice(*insit.inset));
+ insit.inset->updateMacros(it, ourscope);
+ it.pop_back();
}
-
// next paragraph
it.pit()++;
it.pos() = 0;