Bug 152817 - Tools - Spelling in a new document: legacy.osl warning "ApplyChangedSentence in initial call or after resume"
Summary: Tools - Spelling in a new document: legacy.osl warning "ApplyChangedSentence ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: lowest trivial
Assignee: Justin L
URL:
Whiteboard: target:26.2.0
Keywords:
Depends on:
Blocks: Spell-Checking-Dialog
  Show dependency treegraph
 
Reported: 2023-01-02 08:41 UTC by BogdanB
Modified: 2025-09-28 00:32 UTC (History)
3 users (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 BogdanB 2023-01-02 08:41:18 UTC
Description:
Open a new Writer document. Write a correct sentence in the language from the status bar. Tools - Spelling.

In the dbg build of LibreOffice I get in terminal this warning:
warn:legacy.osl:370006:370006:sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx:427: ApplyChangedSentence in initial call or after resume

Steps to Reproduce:
see description

Actual Results:
warning

Expected Results:
no warning


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: b9e3e20bfd102880d12384892eaeca094c38a519
CPU threads: 16; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 1 Stéphane Guillou (stragu) 2023-02-13 22:12:30 UTC
Reproduced in:

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 5cd3a8ec6d36a389eb0be4d59f4570e3bda92dc5
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
Comment 2 BogdanB 2023-07-31 18:15:32 UTC
The same with version 
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 0e17d8ddccdee7d4f46b256153853e1cab87c99e
CPU threads: 16; OS: Linux 5.19; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded

warn:legacy.osl:72270:72270:sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx:427: ApplyChangedSentence in initial call or after resume
Comment 3 BogdanB 2024-06-07 19:36:01 UTC
warn:legacy.osl:136060:136060:sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx:425: ApplyChangedSentence in initial call or after resume

The same in
Version: 24.8.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 6d39b1a6068bbbd5ca4947f668f989dbfb73342d
CPU threads: 16; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 4 BogdanB 2024-09-25 04:25:48 UTC
warn:legacy.osl:5685:5685:sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx:425: ApplyChangedSentence in initial call or after resume

Retested with
Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: a3b0ef4088183c4a3b2ec3fef08ef91314eaef54
CPU threads: 16; OS: Linux 6.8; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 5 BogdanB 2025-03-29 18:02:20 UTC
Retested with
Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 742dbb088b44783c3a4f0fd120b11be3a74fd483
CPU threads: 16; OS: Linux 6.11; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

warn:legacy.osl:5988:5988:sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx:425: ApplyChangedSentence in initial call or after resume
Comment 6 BogdanB 2025-08-16 16:13:25 UTC
warn:legacy.osl:31539:31539:sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx:425: ApplyChangedSentence in initial call or after resume

retested with
Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 8ffeca7af4302da21d33494342017c3737d540e1
CPU threads: 16; OS: Linux 6.14; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 7 Justin L 2025-09-27 22:53:01 UTC
That has been there since the file was introduced.
commit 66c724a878a15a8d5cf4d084c6e3feaba280ecee
Author: Rüdiger Timm on Fri Sep 17 13:01:49 2004 +0000
    INTEGRATION: CWS os19 (1.1.2); FILE ADDED

It is being called by SpellDialog::GetNextSentence_Impl
  rParent.ApplyChangedSentence(m_xSentenceED->CreateSpellPortions(), ...

Since
   svx::SpellPortions  CreateSpellPortions() const;
that should mean that there are no side implications (no changes/modifications to m_xSEntenceED) right? So in theory then we could just avoid this call without causing any bad side effects. I don't see any const_cast's here either, so it really should be a constant, non-modifying, OPTIONAL event.

ApplyChangedSentence returns immediately if m_bInitialCall, so it is OPTIONAL as well.

Heh - but everything I've concluded so far is irrelevant.
GetNextSentence_Impl doesn't know it is in Initialize, so there is no flag to say the call to ApplyChangedSentence is not necessary.
Comment 8 Commit Notification 2025-09-28 00:32:47 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/6af028a2973d7a729293a09a92c7b1bd1bf4eadb

tdf#152817 SwSpellDialogChildWindow: remove irritating OSL_ENSURE

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.