[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/lib/kotext
From:       David Faure <faure () kde ! org>
Date:       2006-03-14 21:02:26
Message-ID: 1142370146.601421.31557.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 518667 by dfaure:

Fix invalid read during (auto)saving of a document with an inline frame


 M  +2 -0      KoBgSpellCheck.cpp  
 M  +4 -2      KoTextParag.cpp  


--- trunk/koffice/lib/kotext/KoBgSpellCheck.cpp #518666:518667
@@ -157,7 +157,9 @@
     if ( misspelled && parag == d->intraWordParag &&
          d->intraWordPosition >= pos &&
          d->intraWordPosition < pos+length ) {
+#ifdef DEBUG_BGSPELLCHECKING
         kdDebug(32500) << "markWord: " << parag << " " << pos << " to " << \
pos+length << " - word being edited" << endl; +#endif
         return; // not yet
     }
 
--- trunk/koffice/lib/kotext/KoTextParag.cpp #518666:518667
@@ -2953,13 +2953,15 @@
 
 
 
+    // Make (shallow) copy of bookmark list, since saving an inline frame \
might overwrite it +    // from the context while we're saving this \
paragraph.  typedef KoSavingContext::BookmarkPositions BookmarkPositions;
-    const BookmarkPositions& bookmarkStarts = context.bookmarkStarts();
+    BookmarkPositions bookmarkStarts = context.bookmarkStarts();
     BookmarkPositions::const_iterator bkStartIter = \
                bookmarkStarts.begin();
     while ( bkStartIter != bookmarkStarts.end() && (*bkStartIter).pos < \
from )  ++bkStartIter;
     //int nextBookmarkStart = bkStartIter == bookmarkStarts.end() ? -1 : \
                (*bkStartIter).pos;
-    const BookmarkPositions& bookmarkEnds = context.bookmarkEnds();
+    BookmarkPositions bookmarkEnds = context.bookmarkEnds();
     BookmarkPositions::const_iterator bkEndIter = bookmarkEnds.begin();
     while ( bkEndIter != bookmarkEnds.end() && (*bkEndIter).pos < from )
         ++bkEndIter;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic