vcl/source/window/settings.cxx |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit 6b756ce38364b568c28f0eba48b90a1ae4676f24
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue Feb 14 12:26:47 2023 +0000
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Wed Feb 15 04:07:02 2023 +0000

    tdf#153541 NotebookBar not getting settings change notifications
    
    NotebookBar is a child of a BorderWindow, which is an unusual parent
    for a widget, special handling is needed in that case to get updated
    when Settings change
    
    Change-Id: I1eca5188cb3aca974281987b7b3619b77bb5f26a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146983
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

diff --git a/vcl/source/window/settings.cxx b/vcl/source/window/settings.cxx
index 9edfaac2a546..378ba1c6004d 100644
--- a/vcl/source/window/settings.cxx
+++ b/vcl/source/window/settings.cxx
@@ -85,9 +85,14 @@ void Window::UpdateSettings( const AllSettings& rSettings, 
bool bChild )
     if ( mpWindowImpl->mpBorderWindow )
     {
         mpWindowImpl->mpBorderWindow->UpdateSettings( rSettings );
-        if ( (mpWindowImpl->mpBorderWindow->GetType() == 
WindowType::BORDERWINDOW) &&
-             
static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->mpMenuBarWindow
 )
-            
static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->mpMenuBarWindow->UpdateSettings(
 rSettings, true );
+        if (mpWindowImpl->mpBorderWindow->GetType() == 
WindowType::BORDERWINDOW)
+        {
+            ImplBorderWindow* pImpl = 
static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get());
+            if (pImpl->mpMenuBarWindow)
+                pImpl->mpMenuBarWindow->UpdateSettings(rSettings, true);
+            if (pImpl->mpNotebookBar)
+                pImpl->mpNotebookBar->UpdateSettings(rSettings, true);
+        }
     }
 
     AllSettings aOldSettings(*mpWindowImpl->mxOutDev->moSettings);

Reply via email to