sw/source/uibase/app/appopt.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 26f5e07563f6f95dc2f9e00b9eb4315aa0e2951a
Author:     Justin Luth <[email protected]>
AuthorDate: Fri Oct 17 11:48:42 2025 -0400
Commit:     Adolfo Jayme Barrientos <[email protected]>
CommitDate: Sun Oct 19 14:12:38 2025 +0200

    tdf#99205 sw options: don't lose automatic spell checking status
    
    This patch fixes Tools - Options - Writer
    from mistakenly turning off the automatic spell checking.
    
    The SwModule m_pUsrPrefs is created early,
    before a view has been created,
    so the default value of bOnlineSpell(false)
    might still be in effect.
    
    Since "ApplyItemSet" doesn't at all control IsOnlineSpell,
    pull the global value from the current view,
    so that we don't get a mistaken change in ApplyUsrPref
        if( !(*pSh->GetViewOptions() == *xViewOpt) )
        {
            //is maybe only a SwViewShell
            pSh->ApplyViewOptions( *xViewOpt );
    
    Change-Id: I761ce6c04ee45b7f228615be57bf6235c3e18fe2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192585
    Reviewed-by: Justin Luth <[email protected]>
    Tested-by: Jenkins
    (cherry picked from commit a2de588c344f24f8f2e359d6f2b736fc4fba0a80)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192667
    Reviewed-by: Adolfo Jayme Barrientos <[email protected]>

diff --git a/sw/source/uibase/app/appopt.cxx b/sw/source/uibase/app/appopt.cxx
index 0bb46eb85279..bcd5c69d725a 100644
--- a/sw/source/uibase/app/appopt.cxx
+++ b/sw/source/uibase/app/appopt.cxx
@@ -401,6 +401,12 @@ void SwModule::ApplyItemSet( sal_uInt16 nId, const 
SfxItemSet& rSet )
         const bool bAlignFormulas = 
rWrtSh.GetDoc()->getIDocumentSettingAccess().get( 
DocumentSettingId::MATH_BASELINE_ALIGNMENT );
         pPref->SetAlignMathObjectsToBaseline( bAlignFormulas );
 
+        // tdf#99205: The itemset doesn't contain SID_AUTOSPELL_CHECK,
+        // and m_pUsrPref was created before a view existed; bOnlineSpell 
might be default value
+        // so pull the globally-shared value from the view
+        const bool bOnlineSpell = rWrtSh.GetViewOptions()->IsOnlineSpell();
+        aViewOpt.SetOnlineSpell(bOnlineSpell);
+
         // don't align formulas in documents that are currently loading
         if (bAlignFormulas && !rWrtSh.GetDoc()->IsInReading())
             rWrtSh.AlignAllFormulasToBaseline();

Reply via email to