]> git.lyx.org Git - features.git/commitdiff
two fixes (posted to list)
authorJohn Levon <levon@movementarian.org>
Thu, 7 Nov 2002 00:37:09 +0000 (00:37 +0000)
committerJohn Levon <levon@movementarian.org>
Thu, 7 Nov 2002 00:37:09 +0000 (00:37 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5594 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/paragraph_funcs.C
src/text.C
src/toc.C

index 12d6d5864b46b6d4136136c2ef964bc46a96a7bd..29cdd579e971fe7739acf4bd3b6fa557aab0ce55 100644 (file)
@@ -1,3 +1,11 @@
+2002-11-07  John Levon  <levon@movementarian.org>
+
+       * text.C: fix progress value for spellchecker 
+       * toc.C: fix navigate menu for insetwrap inside minipage
+
+       * paragraph_funcs.C: added FIXME for suspect code
 2002-11-07  John Levon  <levon@movementarian.org>
 
        * BufferView_pimpl.C: fix redrawing of insets
index a27ef901ac4161bceab02c9e538c9891ec5731cf..c5b7171fa11e0ca64716a1b814ac7f9f64b147cf 100644 (file)
@@ -62,6 +62,14 @@ void breakParagraph(BufferParams const & bparams,
 
                // copy everything behind the break-position
                // to the new paragraph
+
+#ifdef WITH_WARNINGS
+#warning this seems wrong
+#endif
+               /* FIXME: if !keepempty, empty() == true, then we reach
+                * here with size() == 0. So pos_end becomes - 1. Why
+                * doesn't this cause problems ???
+                */
                pos_type pos_end = par->size() - 1;
                pos_type i = pos;
                pos_type j = pos;
index 03f7607331be859d865dbf62da40c5e0837c39b2..0616e7e07abfc6748d838360186a272e36a31f9a 100644 (file)
@@ -2392,7 +2392,8 @@ LyXText::selectNextWordToSpellcheck(BufferView * bview, float & value) const
        if (the_locking_inset) {
                WordLangTuple word = the_locking_inset->selectNextWordToSpellcheck(bview, value);
                if (!word.word().empty()) {
-                       value += float(cursor.y())/float(height);
+                       value += float(cursor.y());
+                       value /= float(height); 
                        return word;
                }
                // we have to go on checking so move cursor to the next char
index 676f8d43a6208f28e81e29f7350b155f91cb5886..b52154bc1b66e30eaaf94e2f067e9946b4c9ccd8 100644 (file)
--- a/src/toc.C
+++ b/src/toc.C
@@ -28,6 +28,7 @@
 #include "insets/insetfloat.h"
 #include "insets/insetwrap.h"
 #include "debug.h"
+#include "iterators.h"
 
 using std::vector;
 using std::max;
@@ -72,11 +73,14 @@ TocList const getTocList(Buffer const * buf)
        TocList toclist;
        if (!buf)
                return toclist;
-       Paragraph * par = &*(buf->paragraphs.begin());
 
        LyXTextClass const & textclass = buf->params.getLyXTextClass();
 
-       while (par) {
+       ParIterator pit = buf->par_iterator_begin();
+       ParIterator end = buf->par_iterator_end();
+       for (; pit != end; ++pit) {
+               Paragraph * par = *pit;
 #ifdef WITH_WARNINGS
 #warning bogus type (Lgb)
 #endif
@@ -106,8 +110,6 @@ TocList const getTocList(Buffer const * buf)
                                il->addToToc(toclist, buf);
                        }
                }
-
-               par = par->next();
        }
        return toclist;
 }