Minor spell check interface fixes
ClosedPublic

Authored by croick on Oct 5 2017, 10:41 PM.

Details

Summary
  • empty document does not resize bar widget when spell check is started without effect
  • replacing the last word with an empty text does not leave the progress bar open
  • show first suggestion in suggestion combo box
  • clear replace-all-list when checking is finished
Test Plan
  • perform spell check on empty document
  • replace trailing misspelled word in document with empty string
  • recheck spelling of former "Replace All" word

Diff Detail

Repository
R39 KTextEditor
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
croick created this revision.Oct 5 2017, 10:41 PM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptOct 5 2017, 10:41 PM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
croick added inline comments.Oct 5 2017, 10:45 PM
src/spellcheck/spellcheckbar.cpp
146

This might have been a feature, but without clearing the map, there is no way to revert a "Replace All"-word, except for restarting the editor.

Looks already quite good. Btw, are there any bug reports in the Kate or frameworks-ktexteditor product on bugs.kde.org that you fix here?

src/spellcheck/spellcheckdialog.cpp
198

Hm, could you explain why removing this line is correct?

Is it because in line 202 we continue with the replacementStartCursor anyway?

croick added a comment.Oct 6 2017, 7:49 AM

Looks already quite good. Btw, are there any bug reports in the Kate or frameworks-ktexteditor product on bugs.kde.org that you fix here?

I didn't find one. I just discovered these yesterday and don't think anybody could investigate this with the spell check bar working only once (for whom and since when, I don't know. Bug 359682 dated back to 02-2016).

src/spellcheck/spellcheckdialog.cpp
198

Yes, the m_currentSpellCheckRange is invalidated in any case, so there is no reason to set its range here.

dhaumann accepted this revision.Oct 6 2017, 2:56 PM

Lgtm.

This revision is now accepted and ready to land.Oct 6 2017, 2:56 PM
This revision was automatically updated to reflect the committed changes.