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

List:       koffice-devel
Subject:    KoSpell crash with linebreak
From:       Clarence Dang <dang () kde ! org>
Date:       2003-03-07 13:24:27
[Download RAW message or body]

Hi,

The line m_buffer.pop_front(); in "case SpellingDone" causes KoSpell::check2() 
to crash when m_buffer.isEmpty().  This can be triggered by pressing 
Shift+Enter in KWord.  This has been the case for quite some time now.

The attached patch appears to fix the problem.  But is it correct?  If so, 
why?

Thanks,
Clarence
["dontcrash_linebreak.diff" (text/x-diff)]

Index: kospell.cc
===================================================================
RCS file: /home/kde/koffice/lib/kotext/kospell.cc,v
retrieving revision 1.9
diff -u -b -r1.9 kospell.cc
--- kospell.cc	20 Aug 2002 09:39:39 -0000	1.9
+++ kospell.cc	8 Mar 2003 01:21:05 -0000
@@ -406,8 +407,11 @@
 	m_buffer << buffer;
 
 	// replace '\n' with ' ' ?
+    // - if you want to avoid trouble later on, I would say yes.
 	proc->fputs("^", false);
-	proc->fputs(buffer);
+    QString b = buffer;
+    b.replace ('\n', ' ');
+	proc->fputs(b);
 
 	return true;
 }

_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/koffice-devel

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

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