]> git.lyx.org Git - lyx.git/blobdiff - src/Paragraph.cpp
Account for changes in insets when checking changes in selection
[lyx.git] / src / Paragraph.cpp
index 710587bb578a4a736420b7eac727032dc30f7b76..27d1230f97d9f7e637f28113478f8e924e626484 100644 (file)
@@ -598,6 +598,24 @@ bool Paragraph::isChanged(pos_type start, pos_type end) const
        return d->changes_.isChanged(start, end);
 }
 
+// FIXME: Ideally the diverse isChanged() methods should account for that!
+bool Paragraph::hasChangedInsets(pos_type start, pos_type end) const
+{
+       LASSERT(start >= 0 && start <= size(), return false);
+       LASSERT(end > start && end <= size() + 1, return false);
+
+       InsetList::const_iterator icit = d->insetlist_.begin();
+       InsetList::const_iterator iend = d->insetlist_.end();
+       for (; icit != iend; ++icit) {
+               if (icit->pos < start)
+                       continue;
+               if (icit->pos >= end)
+                       break;
+               if (icit->inset && icit->inset->isChanged())
+                       return true;
+       }
+       return false;
+}
 
 bool Paragraph::isChanged() const
 {