sw/source/uibase/app/apphdl.cxx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
New commits: commit b58317e2fee41ae8dbe28604d4674cae84a7e4de Author: Paris Oplopoios <paris.oplopo...@collabora.com> AuthorDate: Mon Jun 12 00:49:27 2023 +0300 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Tue Nov 28 11:01:03 2023 +0100 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> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159991 Tested-by: Miklos Vajna <vmik...@collabora.com> Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx index 030a5b73c14e..ba92304518f2 100644 --- a/sw/source/uibase/app/apphdl.cxx +++ b/sw/source/uibase/app/apphdl.cxx @@ -984,17 +984,15 @@ 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(m_pColorConfig->GetCurrentSchemeName()); SwViewColors aViewColors(*m_pColorConfig); aNewOptions.SetColorConfig(aViewColors); pSwView->GetWrtShell().ApplyViewOptions(aNewOptions); - pViewShell->GetWindow()->Invalidate(); + if (bOnlyInvalidateCurrentView) { pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_APPLICATION_BACKGROUND_COLOR, @@ -1003,6 +1001,12 @@ void SwModule::ConfigurationChanged( utl::ConfigurationBroadcaster* pBrdCst, Con aViewColors.m_aDocColor.AsRGBHexString().toUtf8().getStr()); } } + if(pSwView != nullptr || + dynamic_cast< const SwPagePreview *>( pViewShell ) != nullptr || + dynamic_cast< const SwSrcView *>( pViewShell ) != nullptr) + { + pViewShell->GetWindow()->Invalidate(); + } } if (bOnlyInvalidateCurrentView) break;