From kde-core-devel Tue Sep 11 20:05:55 2007 From: Fredy Yanardi Date: Tue, 11 Sep 2007 20:05:55 +0000 To: kde-core-devel Subject: Small Bug in Sonnet::Filter Message-Id: <200709112005.55355.fyanardi () gmail ! com> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=118967391526784 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_jUv5GVjH1GdO4mi" --Boundary-00=_jUv5GVjH1GdO4mi Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi all, I just found a problem in Sonnet::Filter that is causing words not fetched correctly in Sonnet's Backgroundchecker. The problem is when iterating a word in nextWord() method, if current iterator position exceeds word length, an end of word is returned. But I think the method should be returning current word. By changing a line in this method, this problem seems to be solved. Here I also attach a diff to make it clear what's changed. Any problem with this? Best Regards, Fredy Yanardi --Boundary-00=_jUv5GVjH1GdO4mi Content-Type: text/x-diff; charset="utf-8"; name="sonnet_filter.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="sonnet_filter.diff" Index: kdecore/sonnet/filter.cpp =================================================================== --- kdecore/sonnet/filter.cpp (revision 710627) +++ kdecore/sonnet/filter.cpp (working copy) @@ -126,7 +126,7 @@ ++m_currentPosition; //Test if currentPosition exists, otherwise go out if( m_currentPosition >= m_buffer.length()) - return Filter::end(); + return Word( foundWord, start ); currentChar = m_buffer.at( m_currentPosition ); } if ( shouldBeSkipped( allUppercase, runTogether, foundWord ) ) --Boundary-00=_jUv5GVjH1GdO4mi--