Le 01/09/2010 20:11, Stephan Witt a écrit :
+// Paragraph::SpellRanges +//
+/////////////////////////////////////////////////////////////////////


+
+class Paragraph::SpellCheckerState {

What is the real name? Does it need to be in Paragraph, or can it
be in Paragraph::Private? Or can it even be toplevel?

I meant that the comment and the class name do not match.

It's all about two questions: * does the paragraph need a check of
spelling * where are the error locations (ranges)

I thought, Paragraph::SpellCheckerState is private...

Yes, but there is no need to expose it in Paragraph.h. The class could
be standalone and a member speller_state_ still in Paragraph::Private.
This avoid friend declarations.

I do not see why you need that. After all, the spellchecking is
done linearly in the paragraph, and thus all you have to do is to
append to the Range object (actually, a list<>  and some push_back
would be enough).

My intention was to shift all positions to left or right on delete or
insert of a char/inset. This especially will be useful, when it comes
to real "spell check as you type". Then not the whole paragraph needs
to be checked again - only the word at the current position. But I'm
not there...

I suspect this is overkill. Abdel's solution at row level was good in
this respect. Do you gain a lot in terms of performance when going at paragraph level. I fear this is going to become very fragile.

More later.

JMarc

Reply via email to