}
+void Paragraph::updateMacros(DocIterator const & us, DocIterator const & scope)
+{
+ // We expect a DocIterator pointing at the beginning of this paragraph.
+ LBUFERR(&us.paragraph() == this && us.pos() == 0);
+ DocIterator it = us;
+ // iterate over the insets of the current paragraph
+ for (auto const & insit : insetList()) {
+ it.pos() = insit.pos;
+ it.push_back(CursorSlice(*insit.inset));
+ insit.inset->updateMacros(it, scope);
+ it.pop_back();
+ }
+}
+
+
void Paragraph::Private::appendSkipPosition(SkipPositions & skips, pos_type const pos) const
{
SkipPositionsIterator begin = skips.begin();
word_location const loc, bool const ignore_deleted = false) const;
///
void updateWords();
+ ///
+ void updateMacros(DocIterator const & us, DocIterator const & scope);
/// Spellcheck word at position \p from and fill in found misspelled word
/// and \p suggestions if \p do_suggestion is true.
pit_type const lastpit = it.lastpit();
// 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;
- it.push_back(CursorSlice(*insit.inset));
- insit.inset->updateMacros(it, ourscope);
- it.pop_back();
- }
+ it.paragraph().updateMacros(it, ourscope);
// next paragraph
it.pit()++;
it.pos() = 0;