Alfredo Braunstein wrote: > Angus Leeming wrote: > > >>This bug report >>http://bugzilla.lyx.org/show_bug.cgi?id=1876 >> >>says that LyX 1.4.x will not spell check the very first word of the >>document if the cursor is placed at the beginning of that paragraph (just >>before the first letter at position 0). >> >>The offending code, together with the proposed patch is: > > > I'd suggest (untested)
I just tested your patch and it's working now with that patch. > > >> DocIterator cur = kernel().bufferview()->cursor(); >> ptrdiff_t start = 0, total = 0; >> DocIterator it = DocIterator(kernel().buffer().inset()); >> >> for (start = 0; it != cur; it.forwardPos()) >> ++start; >> >> for (total = start; it; it.forwardPos()) >> ++total; >> >> - for (; cur && isLetter(cur); cur.forwardPos()) >> + for (; cur && cur.pos() && isLetter(cur); cur.forwardPos()) >> ++start; > > >>Unfortunately, I understand neither the code nor the fix. (I understand >>that it is incrementing the start and total flags but little more.) Can >>someone explain? > > > > At the end of this chunk, 'total' should count the total size of the > document in chars, 'start' should point at the begin of the next word to > spellcheck. The last for loop is there to skip a partial word (if the > cursor is in the middle of it). So, my patch (submitted on bugzilla) is not working because the total is never counted. > > > >>Angus (tired) > > > Me too ;-) > > Alfredo > > > -- Félix-Antoine Bourbonnais ..................................................................... GPG/PGP: http://www.rubico.info/gpg/ Fingerprint/Empreinte: D5C0 5316 7D4F 36E4 CD58 52E4 D9C7 C8CE FC3C EA60 .....................................................................
signature.asc
Description: OpenPGP digital signature