]> git.lyx.org Git - features.git/blobdiff - src/DocIterator.cpp
The way this was done here is inconsistent with how it is done
[features.git] / src / DocIterator.cpp
index 4dbd2614de2c0045e11cd77ad35ae9ea8b7eb154..352aa3a65e74831d25089ad882cf570d2c7c41b3 100644 (file)
@@ -482,6 +482,19 @@ bool DocIterator::hasPart(DocIterator const & it) const
 }
 
 
+bool DocIterator::allowSpellCheck() const
+{
+       /// spell check is disabled if the iterator position
+       /// is inside of an inset which disables the spell checker
+       size_t const n = depth();
+       for (size_t i = 0; i < n; ++i) {
+               if (!slices_[i].inset_->allowSpellCheck())
+                       return false;
+       }
+       return true;
+}
+
+
 void DocIterator::updateInsets(Inset * inset)
 {
        // this function re-creates the cache of inset pointers.
@@ -577,8 +590,7 @@ void DocIterator::sanitize()
                        fixIfBroken();
                        break;
                }
-               if ((inset->inMathed() && !inset->isActive())
-                   || (!inset->inMathed() && !inset->editable())) {
+               if (!inset->isActive()) {
                        LYXERR0("Inset found on cursor stack is not active.");
                        fixIfBroken();
                        break;