Bug 35282 - tools->language->for_all_text fails to override style language settings, spellcheck fails as result
Summary: tools->language->for_all_text fails to override style language settings, spel...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Linguistic (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-13 23:17 UTC by Nicolas
Modified: 2011-03-14 09:52 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas 2011-03-13 23:17:39 UTC
My issue is that after changing settings a bit, LibreOffice would suddenly no longer do any sort of spell-checking. I installed dictionaries, extensions, etc... Nothing would work, not even clearing the user profile or changing Tools-Options-Language Settings defaults would fix  it.

I reproduced this problem under Windows 7 and Ubuntu Maverick 10.10 so it's highly likely to be a platform-generic bug. The problem started happening about 1 week ago, I reinstalled LibreOffice, tried OpenOffice, they both had the same bug. And 3.3.2 RC1 has the same bug, it's my current version.

Basically, the result is that no spellchecking at all would work. I use two languages, English-Canada and French-Canada. And both failed to spellcheck. I would click the spell-check button and it would give this: 

http://img135.imageshack.us/img135/1944/spellcheckfail.png

As you can see, there's no language set and spellcheck did nothing. However, the normal way to fix this would be to use Tools-Language-For All Text-English (Canada). I did it and it didn't change anything. Same issue when I try "For this paragraph". It doesn't remember the setting : 

http://img34.imageshack.us/img34/2342/foralltextenglish.png

However, thanks to someone's tip and a crapload of perseverance (http://permalink.gmane.org/gmane.comp.documentfoundation.libreoffice.user/3145), I realized I accidentally put the default font to Language=None.

http://img28.imageshack.us/img28/3170/defaultfont.png

Oddly enough, if I selected the whole text and went to "This selection"- English (Canada), it would suddenly work and underline in red typos: 

http://img171.imageshack.us/img171/3702/selectionworkingspellch.png

So as you can see, the bug is that if you have a default font language set to "None" in my example, using "This Text" should override it or outright change the default to English (Canada). 

I know it being set to "None" a bit silly but it's also do-able if set to another language. For example, I'm French and I set the default font to French (Canada). Now, "This selection" is checked at French (Canada). When I click "This Text"-English (Canada), it fails to change it to English (Canada) and keeps the spellcheck at French (Canada) unless I change it manually through "This selection" or re-change the default font.

I believe this to be a fairly important bug for any user who will use documents with different languages as it's mind-boggling to try changing the language and see the spellcheck remain the same so I put the severity at "Major".
Comment 1 Caolán McNamara 2011-03-14 02:36:41 UTC
I set Tools->options->language settings->languages to "none", created a new document, confirmed language was none in format->character, used tools->language->for all text->English(Eire), confirmed language was "English (Eire)" in format->character as expected.

So when you say "if you have a default font language set to "None" in my example, using "This Text" should override it or outright change the default to English (Canada)." what do you mean by using "This Text", there is no menu entry that states "This Text", if you mean "For All Text", that appears to work for me.
Comment 2 Nicolas 2011-03-14 08:20:48 UTC
You don't have to go to Tools-Options-Language settings and set it to None. It was set to English Canada in my example. By default font language, I mean, by the menu Styles and Formatting (F11)-Default and choose Modify and set the current font to None (or French Canada).

I mean that if I use the menu "For All Text" (not "This Text, sorry) to try to change the language of the text document when the default font is set to something else (such as none or French Canada), it doesn't work but if I select the entire text by highlighting it and then select "For this selection"-English Canada, it works.

If I want to reproduce the problem, the current document has to be set to have no language (or a different one), so you might want to highlight everything, pick "For this selection"-None (or French Canada) and then try picking "For All Text"-English Canada and the spell-checking language doesn't change.

If you want, I can try using software to capture a video of myself reproducing the problem if that can help you. It's a bit complex to explain.
Comment 3 Nicolas 2011-03-14 08:23:34 UTC
My bad. Small error in the above text. I meant to say "Formatting (F11)-Default and choose Modify and set the current font to None (or English Canada)". The goal is to try changing the language from the default spell checker.
Comment 4 Caolán McNamara 2011-03-14 08:40:17 UTC
How to reproduce:

1. Blank document with default config
2. F11->Paragraph Styles->Right Click on Default, set language to e.g. "Zulu"
3. Format->Character states "Zulu" as expected
4. tools->language->for all text->e.g. "English (USA)"
5. Format->Character still states "Zulu", not "English (USA)"

however...

1. Blank document with default config
2. F11->Paragraph Styles->Right Click on Default, set language to e.g. "Zulu"
3. Format->Character states "Zulu" as expected
4. ctrl+a to select all
5. tools->language->for selection->e.g. English (USA)
6. Format->Character states "English (USA)" as expected
Comment 5 Caolán McNamara 2011-03-14 09:00:22 UTC
The final language of text is derived as

"Global Default Language"
"Style Language"
"Hard Formatting"

Using "For All Text" is setting "Global Default Language", and then stripping any "Hard Formatting" off all text, allowing the text to take the "Style Language" setting. If it happens however that a style has a language set, then we of course don't fall back to the "Global Default Language", but use the language of the style.

Two options: either in the "all text" mode we change the language of *styles* as well, which would resolve this. The other option is to leave styles alone and treat "all text" the same as a selection over the entire doc and add extra hard formatting to text to force it away from the styles language and back to the default language.
Comment 6 Caolán McNamara 2011-03-14 09:50:19 UTC
Done for 3.4 using option a as

http://cgit.freedesktop.org/libreoffice/writer/commit
/?id=5054bf5dae5fbb7e1e2641480911a0e9dbb438cd