]> git.lyx.org Git - lyx.git/blobdiff - src/Paragraph.cpp
Proper implementatiom of isInToc()
[lyx.git] / src / Paragraph.cpp
index 720e3a7448f1ff864521d9558daf109b154ed616..d96ddaeefea3d282cfab127f0add726f1b00e116 100644 (file)
@@ -153,6 +153,12 @@ public:
                needsRefresh(pos);
        }
 
+       void refreshLast(pos_type pos)
+       {
+               if (pos < refresh_.last)
+                       refresh_.last = pos;
+       }
+
        SpellChecker::Result getState(pos_type pos) const
        {
                SpellChecker::Result result = SpellChecker::WORD_OK;
@@ -751,6 +757,8 @@ bool Paragraph::eraseChar(pos_type pos, bool trackChanges)
                if (!change.changed() ||
                      (change.inserted() && !change.currentAuthor())) {
                        setChange(pos, Change(Change::DELETED));
+                       // request run of spell checker
+                       requestSpellCheck(pos);
                        return false;
                }
 
@@ -782,6 +790,7 @@ bool Paragraph::eraseChar(pos_type pos, bool trackChanges)
 
        // Update list of misspelled positions
        d->speller_state_.decreasePosAfterPos(pos);
+       d->speller_state_.refreshLast(size());
 
        return true;
 }
@@ -2716,13 +2725,9 @@ docstring Paragraph::simpleLyXHTMLOnePar(Buffer const & buf,
 
                Inset const * inset = getInset(i);
                if (inset) {
-                       InsetCommand const * ic = inset->asInsetCommand();
-                       InsetLayout const & il = inset->getLayout();
-                       InsetMath const * im = inset->asInsetMath();
-                       if (!runparams.for_toc
-                           || im || il.isInToc() || (ic && ic->isInToc())) {
+                       if (!runparams.for_toc || inset->isInToc()) {
                                OutputParams np = runparams;
-                               if (!il.htmlisblock())
+                               if (!inset->getLayout().htmlisblock())
                                        np.html_in_par = true;
                                retval += inset->xhtml(xs, np);
                        }