Bug 142118 - Application color "Spelling mistakes" not applied immediately
Summary: Application color "Spelling mistakes" not applied immediately
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.2.0.4 release
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:26.2.0
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Options-Dialog-Colours
  Show dependency treegraph
 
Reported: 2021-05-06 09:39 UTC by Heiko Tietze
Modified: 2025-10-15 19:26 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot with LibreOffice Dark color scheme (96.07 KB, image/png)
2021-05-06 09:39 UTC, Heiko Tietze
Details
ChoosingSpellColor.png: how to change spelling underline color in 26.2 (96.40 KB, image/png)
2025-10-10 20:06 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Heiko Tietze 2021-05-06 09:39:10 UTC
Created attachment 171683 [details]
Screenshot with LibreOffice Dark color scheme

Via Tools > Options > LibreOffice > Application Colors: AutoSpellcheck (under Text Document) it is possible to change the appearance of red-lines (wavy lines that indicate spelling errors). Changing the color has no effect until the paragraph is checked again (eg after changes to the text or return at the end).

In the screenshot the Arabic text was checked with Dark Red font color. After changing it to yellow the wrong language under Hidden Text was added.
Comment 1 Dieter 2021-05-22 08:49:28 UTC
I confirm it with

Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 1675a68526c43c6c6e4dc850ee911f0c1de75c88
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL
Comment 2 Sophie Sipasseuth 2023-05-22 08:28:03 UTC
Repro

Version: 7.6.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: f4c24da1e7f11664e0d2f688d2531f068e4a3bc0
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: fr-FR (fr_FR); UI: fr-FR
Calc: CL threaded
Comment 3 Buovjaga 2024-11-22 14:35:09 UTC
Bibisected with Linux 42max, got a range of 13 commits, of which this seems likely: 79b231f7a032c7e04b74fa019e18a5d7e3b5f4f3
Resolves: #i121733# enhancement for colored smarttags
Comment 4 LeroyG 2025-09-24 18:21:49 UTC
Version: 24.8.7.2 (X86_64) / LibreOffice Community
Build ID: e07d0a63a46349d29051da79b1fde8160bab2a89
CPU threads: 4; OS: Windows 10 X86_64 (10.0 build 19045); UI render: Skia/Raster; VCL: win
Locale: es-MX (es_ES); UI: en-US
Calc: CL threaded

Now the path is menu Tools - Options - LibreOffice - Application Colors: Spelling mistakes.

As a workaround, Find $ and Replace with \n. Or restart LibreOffice.
Comment 5 LeroyG 2025-09-25 03:30:59 UTC
Reproducible with:
Version: 24.8.5.2 (X86_64) / LibreOffice Community
Build ID: 480(Build:2)
CPU threads: 4; OS: Linux 6.4; UI render: default; VCL: gtk3
Locale: es-MX (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 6 Justin L 2025-10-10 20:06:11 UTC
Created attachment 203252 [details]
ChoosingSpellColor.png: how to change spelling underline color in 26.2

The way to change the wrong-spelling-indicator colour changed recently. This is a screenshot of where the setting is.

See WIP patch at https://gerrit.libreoffice.org/c/core/+/192180
Comment 7 Commit Notification 2025-10-15 11:22:38 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/1e89ae7b072d463ed319a6485e67dee2ca61e676

tdf#142118 sw: immediately apply Application color 'Spelling mistakes'

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Justin L 2025-10-15 11:24:42 UTC
This is basically fixed. It might take a scroll off-screen still, but more-or-less this bug is now fixed.
Comment 9 Heiko Tietze 2025-10-15 15:05:12 UTC
Thanks for fixing this. I can confirm the updated color after scrolling (using kf6).
Comment 10 Justin L 2025-10-15 19:26:10 UTC
TODO:
-all other modules need basic plumbing to restart spelling. (bug report was Writer only - but the same holds true for all modules, but they will take a ton of work to complete)
-Ideally, LinguMgr would broadcast SPELL_WRONG_WORDS_AGAIN to all modules, but it is UNO and there is no published API to allow something like this AFAICS.
-Somehow, IdleJob::Layout needs to trigger a full repaint after a SPELL_WRONG_WORDS_AGAIN.

When SpellItAgainSam SetNeedGrammarCheck(true), then getIDocumentTimerAccess().StartIdling() runs at TimeoutPriority::LOWEST, which handles IdleJob::Layout.

Soon after, pMyWin->Invalidate() which triggers maPaintIdle at higher TimeoutPriority::REPAINT.

If the grammarchecker is on and finds errors, it triggers a repaint. I don't think spellcheck has any timers like sw/source/core/txtnode/GrammarContact.cxx.


All of this is way over my head, so I'm not going to attempt any of it. Just noting here what I know is lacking in my patch.
With this patch it repaints with the new color after:
-scrolling back on-screen
-zoom changes
-edit (everything AFTER the edit point)
-switch to web view and back
-click on SwHeaderFooterArea
...
-anything that causes a repaint after IdleJob::Layout