From 125a79c569f86369a8b3699bfb4e11d57c072d15 Mon Sep 17 00:00:00 2001 From: John Levon Date: Thu, 7 Nov 2002 00:37:09 +0000 Subject: [PATCH] two fixes (posted to list) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5594 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 8 ++++++++ src/paragraph_funcs.C | 8 ++++++++ src/text.C | 3 ++- src/toc.C | 10 ++++++---- 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 12d6d5864b..29cdd579e9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2002-11-07 John Levon + + * 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 * BufferView_pimpl.C: fix redrawing of insets diff --git a/src/paragraph_funcs.C b/src/paragraph_funcs.C index a27ef901ac..c5b7171fa1 100644 --- a/src/paragraph_funcs.C +++ b/src/paragraph_funcs.C @@ -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; diff --git a/src/text.C b/src/text.C index 03f7607331..0616e7e07a 100644 --- a/src/text.C +++ b/src/text.C @@ -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 diff --git a/src/toc.C b/src/toc.C index 676f8d43a6..b52154bc1b 100644 --- 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; } -- 2.39.5