sw/source/uibase/app/apphdl.cxx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
New commits: commit a4f1e9f65559f155659a92b0e708777fb2e0c5e1 Author: Paris Oplopoios <paris.oplopo...@collabora.com> AuthorDate: Mon Jun 12 00:49:27 2023 +0300 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Wed Sep 6 14:33:07 2023 +0200 Fix unchecked dynamic cast Change-Id: If662e24bb864690ead959b2599a6448d84da0de9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152866 Tested-by: Jenkins Reviewed-by: Paris Oplopoios <parisop...@gmail.com> (cherry picked from commit 20a6c2df3ea899cce15775d954ffa50bb9dc81cd) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156448 Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> Reviewed-by: Hossein <hoss...@libreoffice.org> Tested-by: Xisco Fauli <xiscofa...@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx index bd4cdbe28f0f..d7ab78d6e392 100644 --- a/sw/source/uibase/app/apphdl.cxx +++ b/sw/source/uibase/app/apphdl.cxx @@ -983,23 +983,27 @@ void SwModule::ConfigurationChanged( utl::ConfigurationBroadcaster* pBrdCst, Con { if(pViewShell->GetWindow()) { - auto pSwView = dynamic_cast<SwView *>( pViewShell ); - if(pSwView != nullptr || - dynamic_cast< const SwPagePreview *>( pViewShell ) != nullptr || - dynamic_cast< const SwSrcView *>( pViewShell ) != nullptr) + auto pSwView = dynamic_cast<SwView *>(pViewShell); + if (pSwView) { SwViewOption aNewOptions = *pSwView->GetWrtShell().GetViewOptions(); aNewOptions.SetThemeName(svtools::ColorConfig::GetCurrentSchemeName()); SwViewColors aViewColors(*m_pColorConfig); aNewOptions.SetColorConfig(aViewColors); pSwView->GetWrtShell().ApplyViewOptions(aNewOptions); - pViewShell->GetWindow()->Invalidate(); + if (bOnlyInvalidateCurrentView) { pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_APPLICATION_BACKGROUND_COLOR, aViewColors.m_aAppBackgroundColor.AsRGBHexString().toUtf8()); } } + if(pSwView != nullptr || + dynamic_cast< const SwPagePreview *>( pViewShell ) != nullptr || + dynamic_cast< const SwSrcView *>( pViewShell ) != nullptr) + { + pViewShell->GetWindow()->Invalidate(); + } } if (bOnlyInvalidateCurrentView) break;