Bug 169145 - Spell checker in table of content does not respect header language
Summary: Spell checker in table of content does not respect header language
Status: RESOLVED INVALID
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
25.8.2.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-10-30 09:05 UTC by Jan Vlug
Modified: 2026-01-06 11:47 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Document that exposes the issue (13.54 KB, application/vnd.oasis.opendocument.text)
2025-10-30 09:05 UTC, Jan Vlug
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Vlug 2025-10-30 09:05:39 UTC
Created attachment 203605 [details]
Document that exposes the issue

Steps to reproduce

1. Enable spell checking
2. Create a document with headings in different languages.
3. Set the language for the headings correctly.
4. Insert a table of contents at the beginning of the document.

Actual result:
The spell checker reports spelling errors in the table of contents.

Expected result:
No incorrectly reported spelling errors in the table of contents.

See the attached document as an example.
Comment 1 jcline 2025-11-08 07:09:18 UTC
I was able to reproduce in these versions:

Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 620(Build:0)
CPU threads: 32; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded

Version: 25.8.2.2 (X86_64)
Build ID: d401f2107ccab8f924a8e2df40f573aab7605b6f
CPU threads: 32; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded
Comment 2 Takenori Yasuda 2025-11-08 09:40:41 UTC
I'm not sure if I reproduced the issue correctly, but I did observe the red underline from the spell checker.

However, I don't think this is a bug.
It's likely caused by the relevant paragraph styles not having appropriate languages assigned.

In the case of attachment 203605 [details], setting the language to "English" for "Contents Heading" and to "Multiple" for "Contents 1" should resolve the issue.


Version: 25.8.3.2 (X86_64) ※RC2
Build ID: 8ca8d55c161d602844f5428fa4b58097424e324e
CPU threads: 8; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Raster; VCL: win
Locale: ja-JP (ja_JP); UI: ja-JP
Calc: CL threaded Jumbo
Comment 3 tkakar 2025-11-14 05:35:31 UTC
Confirmed. I tested this using the attached file from the reporter.

1. Initially, I set the document's language to English (USA), resulting in both the Dutch heading ("Dit is Nederlands") and its entry in the table of contents showing spelling errors. 
2. I then selected the main Dutch heading and set its language to Dutch (Nederlands) using Tools > Language > For Selection. 

The red squiggly lines disappeared from the main heading, but remained in the table of contents. The table of contents didn't inherit the Dutch language setting from its source heading.

Tested in:

Version: 25.8.2.2 (X86_64)
Build ID: d401f2107ccab8f924a8e2df40f573aab7605b6f
CPU threads: 16; OS: Windows 11 X86_64 (build 26200); UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded

Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 620(Build:0)
CPU threads: 16; OS: Windows 11 X86_64 (build 26200); UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded
Comment 4 Takenori Yasuda 2025-11-14 08:50:01 UTC
I installed the Dutch dictionary and retested, but I did not observe any unexpected behavior in either Comment 0 or Comment 3.

The title of the table of contents, the TOC entries, the two headings, and the body text all use different paragraph styles. According to the style hierarchy, these four styles do not inherit from one another.

Therefore, changing the language setting for the heading alone does not affect the table of contents.

The reported behavior is reproducible, though it may not qualify as a bug.
Setting the correct language for each style should allow things to work as expected.


Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 620(Build:0)
CPU threads: 8; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Raster; VCL: win
Locale: ja-JP (ja_JP); UI: ja-JP
Calc: CL threaded Jumbo
Comment 5 Jan Vlug 2026-01-06 11:47:43 UTC
Thanks for your responses.

> setting the language to "English" for "Contents Heading" and to "Multiple" for "Contents 1" should resolve the issue.

For future readers: I had some difficulties to do this, but finally figured out: Select Edit Style... for "Contents 1", you will get a window Paragraph Style: Contents 1. At the left, select Font, in the right pane you will see Language: At the top of the drop down menu with languages is the option [Multiple] (note the [ and ] around it). When you select here [Multiple] the spelling errors in the table of content will disappear.