There also seems to be a bug in SpellCheckingUIManager.cs in function MoveToNextError().
// Spell checking begins from the beginning of the current sentence
DocumentPosition sentenceBegin =
new
DocumentPosition(
this
.radRichTextBox.Document.CaretPosition);
PositionSentenceWalker.MoveToSentenceBegin(sentenceBegin);
WordInfo incorrectWordInfo = proofingManager.GetNextErrorWord(sentenceBegin);
if
(incorrectWordInfo ==
null
)
{
if
(
this
.passedThroughEnd)
{
return
null
;
}
sentenceBegin.MoveToFirstPositionInDocument();
this
.passedThroughEnd =
true
;
incorrectWordInfo = proofingManager.GetNextErrorWord(sentenceBegin);
}
Create a RadRichTextEditor with 5 lines of text, with 3 spelling errors on each line.
Put the cursor in the middle of line 3 then run spellchecker like so:
spellDlg.ShowDialog(
new
Telerik.WinForms.Documents.UI.Extensibility.SpellCheckingUIManager(radRichTextEditor1.RichTextBoxElement),radRichTextEditor1.RichTextBoxElement);
It will start at the beginning of line 3 (as per the comment). If you click "Ignore" button a bunch of times, it will cycle through the errors in line 3, line 4, line 5. Then it will set passedThroughEnd to true and get the first error in line 1. Click "Ignore" and you get the spellcheck done confirmation dialog, then spell check dialog closes.
The problem is this line:
DocumentPosition sentenceBegin =
new
DocumentPosition(
this
.radRichTextBox.Document.CaretPosition);
Every time the function gets called it starts at the cursor position. It moves the DocumentPosition "sentenceBegin" to the beginning of the document, but it never actually moves the cursor. So the next time it's called, it starts on line 3 again.