vcl/jsdialog/jsdialogbuilder.cxx |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 50fe13355e3c7f0bdbba7e2deb9cb15d9c7eb925
Author:     Szymon Kłos <[email protected]>
AuthorDate: Wed Mar 5 06:59:03 2025 +0100
Commit:     Szymon Kłos <[email protected]>
CommitDate: Wed Mar 5 15:10:14 2025 +0100

    jsdialogs: fix nested containters lookup
    
    Do not break the loop early if not found a widget.
    We need to go up sometimes. Fixes regression from
    commit  13af671fda1317175a93fd747e5455ce897ed167
    jsdialog: share code for widget registry
    
    Signed-off-by: Szymon Kłos <[email protected]>
    Change-Id: I5516c0708452e95b2b6067e3a1fb99582b47dcf7
    (cherry picked from commit 90f836f5ef250c586fe9d58637ae15dee305edb7)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182537
    Tested-by: Jenkins

diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index f28bd940f57c..00521d90a349 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -519,11 +519,9 @@ std::unique_ptr<weld::Container> 
JSInstanceBuilder::weld_container(const OUStrin
         // use parent builder to send update - avoid multiple calls from many 
builders
         vcl::Window* pParent = pContainer->GetParent();
         OUString sId = OUString::number(m_nWindowId);
-        while (pParent)
+        auto aWidgetMap = Widgets().Find(sId);
+        while (pParent && aWidgetMap && !aWidgetMap->Find(pParent->get_id()))
         {
-            auto aWidgetMap = Widgets().Find(sId);
-            if (!aWidgetMap || !aWidgetMap->Find(pParent->get_id()))
-                break;
             pParent = pParent->GetParent();
         }
 

Reply via email to