-void Buffer::updateBlockMacros(DocIterator & it, DocIterator & scope) const
-{
- Paragraph & par = it.paragraph();
-
- // set scope for macros in this paragraph:
- // * either the "old" outer scope
- // * or the scope ending after the environment
- if (par.layout()->isEnvironment()) {
- // find end of environment block,
- DocIterator envEnd = it;
- pit_type n = it.lastpit() + 1;
- depth_type depth = par.params().depth();
- Length const & length = par.params().leftIndent();
- // looping through the paragraph, basically until
- // the layout changes or the depth gets smaller.
- // (the logic of output_latex.cpp's TeXEnvironment)
- do {
- envEnd.pit()++;
- if (envEnd.pit() == n)
- break;
- } while (par.layout() == envEnd.paragraph().layout()
- || depth < envEnd.paragraph().params().depth()
- || length != envEnd.paragraph().params().leftIndent());
-
- // collect macros from environment block
- updateEnvironmentMacros(it, envEnd.pit() - 1, envEnd);
- } else {
- // collect macros from paragraph
- updateEnvironmentMacros(it, it.pit(), scope);
- }
-}
-
-
-void Buffer::updateInsetMacros(DocIterator & it, DocIterator & scope) const
-{
- // look for macros in each paragraph
- pit_type n = it.lastpit() + 1;
- while (it.pit() < n)
- updateBlockMacros(it, scope);
-}
-
-