Download it now!
Bug 36678 - Missing user-defined dictionaries with a specified language attribute via "Spelling and Grammar" <F7>
Summary: Missing user-defined dictionaries with a specified language attribute via "Sp...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Linguistic (show other bugs)
Version:
(earliest affected)
3.4.0 Beta3
Hardware: x86 (IA32) Windows (All)
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard:
Keywords: regression
: 37409 40215 (view as bug list)
Depends on:
Blocks: mab3.4
  Show dependency treegraph
 
Reported: 2011-04-29 08:29 UTC by gerdl
Modified: 2012-01-21 22:24 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Example 1: AutoSpellcheck German (Germany) (8.36 KB, image/png)
2011-04-29 13:53 UTC, manj_k
Details
Example 2: Spelling and Grammar <F7> German (Germany) (21.16 KB, image/png)
2011-04-29 13:55 UTC, manj_k
Details
Test document: 'sample_fdo#36678.odt' (14.13 KB, application/vnd.oasis.opendocument.text)
2011-10-28 10:25 UTC, manj_k
Details
Screenshot A: Spelling and Grammar, text language French (France) (21.96 KB, image/png)
2011-10-28 10:26 UTC, manj_k
Details
Screenshot B: Spelling and Grammar, text language German (Germany) (22.25 KB, image/png)
2011-10-28 10:27 UTC, manj_k
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gerdl 2011-04-29 08:29:32 UTC
only stadard.dic appearsby spellchecking. If you want to take an entry direktly with a (red) underlined word by clicking to it, all spellchecking dics appear.
Comment 1 manj_k 2011-04-29 13:52:18 UTC
Open Writer

(1)
Tools > Options > Language Settings > Writing Aids > 
User-defined dictionaries > New...

Create custom dictionaries as follows
1. add_de [Language: German (Germany)]
2. add_en [Language: English (USA)]
3. add_fr [Language: French (France)]
4. add_all [Language: All]

(2)
Test "AutoSpellcheck"

1. Type some misspelled text [language attribute German (Germany)]
2. Right click on misspelled word
3. Context menu "Add" shows the custom dictionaries:
- standard.dic
- add_de.dic
- add_all.dic
[as expected]

(3)
Test Spelling and Grammar <F7>
1. Same text as before (2)
2. Open "Spelling and Grammar" with <F7>
3. Click on "Add" for a misspelled word; shown custom dictionaries:
- standard.dic
- add_all.dic 

Bug: missing add_de.dic

(4)
Repeat the test cases (2) and (3)
with the language attributes French (France) and English (USA).

The same bug for "Spelling and Grammar" <F7>:
missing add_fr.dic or add_en.dic.

You cannot add a word to user-defined dictionaries with a specified language attribute via "Spelling and Grammar" <F7>
Comment 2 manj_k 2011-04-29 13:53:51 UTC
Created attachment 46168 [details]
Example 1: AutoSpellcheck German (Germany)
Comment 3 manj_k 2011-04-29 13:55:33 UTC
Created attachment 46169 [details]
Example 2: Spelling and Grammar <F7> German (Germany)
Comment 4 manj_k 2011-04-29 14:15:28 UTC
@gerdl:
I've tried to guess your intention, and to make the bug reproducible for developers and other. ;)

Feel free to modify the summary if I am wrong.
Comment 5 Andras Timar 2011-05-04 14:51:23 UTC
Somehow  const LanguageType nLang = aLanguageLB.GetSelectLanguage(); at http://opengrok.libreoffice.org/xref/components/cui/source/dialogs/SpellDialog.cxx#910 results nLang == LANGUAGE_DONTKNOW instead of the correct language code of the checked test. 

GetSelectLanguage() calls GetSelectEntryPos() on the list box, which returns LISTBOX_ENTRY_NOTFOUND so this is why GetSelectLanguage() returns LANGUAGE_DONTKNOW.

Subsequent calls to GetSelectEntryPos() (i.e. clicking on  the listbox and select a language) return the good result, but it's too late, the submenu of Add button is populated during initializaton of the dialog. 

BTW in 3.3.x it is also broken: all dictionaries are listed, not only language independent dictionaries and dictionaries of the given language.

So, this is a bug but hardly a blocker.
Comment 6 Andras Timar 2011-05-20 13:49:31 UTC
*** Bug 37409 has been marked as a duplicate of this bug. ***
Comment 7 manj_k 2011-05-21 06:50:12 UTC
That bug is pretty annoying for all users with subject-specific custom dictionaries (scientific, literarily,(advertising) slang, colloquial language, etc.)
They lose access to these dictionaries via 'Spelling and Grammar'.
This situation is worse than the current bug (3.3.x), where *all* custom dictionaries are shown.
It would be nice if it will be fixed with LibO 3.4 release.
Comment 8 gerdl 2011-06-26 03:23:47 UTC
only tested with windows (w7 64)
also in 3.4.1 rc3
Comment 9 Urmas 2011-08-11 02:34:32 UTC
You can have it back though, either by re-selecting language in list above, or clicking options and pressing OK.
Comment 10 manj_k 2011-08-11 06:25:24 UTC
(In reply to comment #9)

Well, I could apply this funny workaround 'Options... > OK'.
I do prefer AutoSpellcheck (context menu).  ;)
Nevertheless, thanks for the hint.
(Re-selecting the language in the drop-down list 'Text language' doesn't work for me.)

But this is far from being satisfactory in a multilingual document.
You have to repeat that step whenever the language has changed, and with every new spell check session.

Is there anybody who wants to fix that bug?
Comment 11 Caolán McNamara 2011-08-25 08:30:11 UTC
gagh, it initializes the info it needs to know the language effectively via

   Application::PostUserEvent( STATIC_LINK(
                        this, SpellDialog, InitHdl ) );

so its sort of random when the language gets known
Comment 12 Caolán McNamara 2011-08-25 08:31:36 UTC
/* Initialize, asynchronous to prevent virtial calls
   from a constructor
 */
Comment 13 Caolán McNamara 2011-08-25 08:36:57 UTC
trying to avoid the http://www.artima.com/cppsource/nevercall.html problem
Comment 14 Caolán McNamara 2011-08-26 02:45:38 UTC
hum, a bit grotesque, but lets put that aside and simply move the code that depends on the Init_Hdl being run into Init_Hdl and then while I'm at it change things so that those language-dependent lists get regenerated when the language is changed from the language drop-drop at the top of the dialog

done in master as
http://cgit.freedesktop.org/libreoffice/core/commit/?id=c9e6df76fffe84da7529d92cba7bb79e36d9cd15

do we want this in 3-4 as well ?
Comment 15 Caolán McNamara 2011-08-30 01:50:39 UTC
fixed in master anyway
Comment 16 rpr 2011-09-05 04:59:34 UTC
*** Bug 40215 has been marked as a duplicate of this bug. ***
Comment 17 rpr 2011-09-05 05:27:10 UTC
*** Bug 33875 has been marked as a duplicate of this bug. ***
Comment 18 manj_k 2011-10-28 10:21:49 UTC
Tested with LibO 3.4.4 RC1 on WinXP
[LibreOffice 3.4.4 OOO340m1 (Build:401).

The bugfix works fine for unilingual documents.
But it works only with the first checked language in a multilingual document.

1. Create a French text language paragraph with a misspelled word.
2. Create a German text language paragraph with a misspelled word.

(You may also use the attached 'sample_fdo#36678.odt')

3. Start <F7> with the French paragraph. Selecting 'Add..' will show the user-defined dictionaries 'add_fr.dic' and 'plus_fr.dic' (see 'Screenshot A: Spelling and Grammar, text language French (France)')
4. Add the word to a French user dictionary, or ignore it.
5. Select 'Add...' again in the next--German--paragraph. It will show again the user-defined dictionaries 'add_fr.dic' and 'plus_fr.dic' instead of the also available user-defined dictionaries 'add_de.dic' and 'plus_de.dic' (see 'Screenshot B: Spelling and Grammar, text language German (Germany)').

@Caolán McNamara
I have reopened this bug due to that issue.
Maybe it would be better to create a new bug report (follow-up).
Comment 19 manj_k 2011-10-28 10:25:29 UTC
Created attachment 52860 [details]
Test document: 'sample_fdo#36678.odt'
Comment 20 manj_k 2011-10-28 10:26:36 UTC
Created attachment 52861 [details]
Screenshot A: Spelling and Grammar, text language French (France)
Comment 21 manj_k 2011-10-28 10:27:35 UTC
Created attachment 52862 [details]
Screenshot B: Spelling and Grammar, text language German (Germany)
Comment 22 manj_k 2011-10-28 11:16:03 UTC
(In reply to comment #17)
> *** Bug 33875 has been marked as a duplicate of this bug. ***

This bug is *not* a duplicate of bug 36678.
Usually, 'Spelling <F7>' in LibO 3.3.x (Calc) will show *all* user-defined
dictionaries, irrespective of their language attribute
[see also: https://bugs.freedesktop.org/show_bug.cgi?id=33875#c2 ].
Comment 23 Caolán McNamara 2011-10-29 07:11:38 UTC
"I have reopened this bug due to that issue. Maybe it would be better to create a new bug report (follow-up)."

yes, please do that. Mention the related bug in the new one by all means, but unless the very exact bug fixed under this id has returned then reusing the same bug id gets very confusing very quickly if a bunch of similar but technically unrelated bugs end up listed together.

Feel free to assign the new bug to me.
Comment 24 manj_k 2011-10-29 08:30:56 UTC
(In reply to comment #23)

Done.
→ Bug 42372 - Make *all* user-defined dictionaries with a specified language attribute available during "Spelling and Grammar" <F7>