Bug 33636 - Spell check will not ignore unknown words in selected cells area
Summary: Spell check will not ignore unknown words in selected cells area
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Linguistic (show other bugs)
Version:
(earliest affected)
3.3.0 RC4
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-28 00:48 UTC by Rainer Bielefeld Retired
Modified: 2011-06-15 08:51 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Pls see original report (13.54 KB, application/vnd.oasis.opendocument.spreadsheet)
2011-01-28 00:48 UTC, Rainer Bielefeld Retired
Details
proposed fix (3.51 KB, patch)
2011-06-15 02:46 UTC, Caolán McNamara
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Bielefeld Retired 2011-01-28 00:48:34 UTC
Created attachment 42628 [details]
Pls see original report

Found this with "LibreOffice 3.3.0 RC4 - WIN7  Home Premium (64bit) German UI  [OOO330m19 (build 6 / tag 3.3.0.4)]"

Steps to reproduce:

1. open attached "sampleEn.ods"
2. click into 'B2' 
3. start spell check 
4. at first unknown word press "ignore"
   expected: spell check will ignore word and continue
   actual: as expected

Now the problem:


10. terminate spell check 
11. select  'B2:B9' using mouse
12. F7 for spell check
13. If spellcheck finds an unknown (wrong written) word, press "Ignore"
    expected: check should be continued
    actual: cell will be checked again and again and again …
Comment 1 Steve Edmonds 2011-03-16 22:58:36 UTC
LibreOffice 3.3.0, OOO330m19 (Build:6), tag libreoffice-3.3.0.4 Suse 11.0

If I press Ignore I get as you state. If I press ignore all it steps from one mistake to the next.

To get the spell check to start I need to press resume after F7.
Comment 2 Rainer Bielefeld Retired 2011-03-17 01:48:37 UTC
NEW due to Steve Edmonds. I still see all details of the problem with  "LibreOffice 3.3.2RC1  – WIN7  Home Premium  (64bit) German UI [OOO330m19 (Build:201 / tag 3.3.2.1)]"
Comment 3 Rainer Bielefeld Retired 2011-03-17 01:49:36 UTC
@Caolán:
I saw your activity in several Linguistic Component related bugs, pls. feel free to reassign if it's not your area.
Comment 4 Caolán McNamara 2011-06-15 02:46:35 UTC
Created attachment 47988 [details]
proposed fix
Comment 5 Caolán McNamara 2011-06-15 02:49:08 UTC
I see a bit of a nest of horrors around calc selections. The fundamental intent of the dialog seems clear however:

a) The spellchecking dialog isn't modal, so you can swap from the spell-checking dialog back to the document and back to the dialog.
b) If you were spellchecking a selection, and changed the selection while the dialog is open and return to it, it wants to change state to "resume" to indicate that you have to spell-check the new selection from scratch.

When the spellcheck dialog initalizes, it uses ScSelectionState to get the original selection, and it gets a new ScSelectionState when it gains focus and checks if their GetSheetSelections differ to determine if the selection changed, in order to know that spellchecking may need to be restarted, which seems reasonable.

Unfortunately if you launch the spell-checker dialog it activates an editview, which it uses to traverse the cells being spellchecked, and so ScSelectionState once the dialog is first initialized returns this editview as the active selection, i.e. see ScSelectionState::ScSelectionState so the act of opening the spellchecker changes the selection as far as ScSelectionState is concerned.

Its not massively clear to me how the calc selections are expected to work, but my thinking is that GetMarkData is an apparently reliable sane layer, and taking a FillRangeListWithMarks from that to use as the comparison that the selection has changed avoids the problem, and apparently works for me.
Comment 6 Caolán McNamara 2011-06-15 08:50:22 UTC
oky doky, committed to master. Will be in >= 3.5 I guess.