sw/source/uibase/app/apphdl.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
New commits: commit 482871586febdea7d5ccef815f8ad33ffb40c095 Author: Justin Luth <[email protected]> AuthorDate: Tue Oct 14 14:37:57 2025 -0400 Commit: Adolfo Jayme Barrientos <[email protected]> CommitDate: Mon Oct 20 17:03:23 2025 +0200 tdf#157365 sw: apply colorConfig change to SwModule This fixes a 7.6 regression from commit 1916d161902bdd52b8cfa5b29153c8f8c39fce52. Changes made were not immediately applying to new documents, and perhaps not even to the current document if the user also looked at SwModule options. Change-Id: I5fa21cac57ab1bbfc96b9d6d2b7f403b32103e84 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192410 Tested-by: Jenkins Reviewed-by: Justin Luth <[email protected]> (cherry picked from commit 2b0bc0ed83cc0ec03ea30570dc7538df22f303b1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192724 Reviewed-by: Adolfo Jayme Barrientos <[email protected]> diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx index 1aff41216524..5dc3baf1144c 100644 --- a/sw/source/uibase/app/apphdl.cxx +++ b/sw/source/uibase/app/apphdl.cxx @@ -968,8 +968,18 @@ void SwModule::ConfigurationChanged(utl::ConfigurationBroadcaster* pBrdCst, Conf } else if ( pBrdCst == m_pColorConfig.get() ) { - //invalidate only the current view in tiled rendering mode, or all views otherwise const bool bKit = comphelper::LibreOfficeKit::isActive(); + const SwViewColors aViewColors(*m_pColorConfig); + SwViewOption aViewOption = *GetViewOption(/*Web=*/false); + + // if not LOKit, then update the module defaults (for reload/open/new etc.) + if (!bKit && aViewColors != aViewOption.GetColorConfig()) + { + aViewOption.SetColorConfig(aViewColors); + ApplyUsrPref(aViewOption, /*SwView=*/nullptr); + } + + //invalidate only the current view in tiled rendering mode, or all views otherwise SfxViewShell* pViewShell = bKit ? SfxViewShell::Current() : SfxViewShell::GetFirst(); while(pViewShell) { @@ -980,7 +990,6 @@ void SwModule::ConfigurationChanged(utl::ConfigurationBroadcaster* pBrdCst, Conf { SwViewOption aNewOptions = *pSwView->GetWrtShell().GetViewOptions(); aNewOptions.SetThemeName(svtools::ColorConfig::GetCurrentSchemeName()); - SwViewColors aViewColors(*m_pColorConfig); aNewOptions.SetColorConfig(aViewColors); const bool bChanged(aNewOptions != *pSwView->GetWrtShell().GetViewOptions()); if (bChanged)
