From 49b71f818d84eb40719e9f18b886f7dd27bb9d56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20K=C5=82os?= Date: Thu, 20 Mar 2025 08:16:12 +0100 Subject: [PATCH] jsdialogs: shortcut legacy mobile-sidebar update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the past we used UI testing not welding for user interaction and updates so it was needed to send full update after every change. Use shortcut to avoid unnecessary operations. Change-Id: Ib3715e2287d6cc8b70db495b93cf09dd9aa20b14 (cherry picked from commit 6fd6fc9d351527059d7a7ded3155f772c5e0982a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183188 Tested-by: Jenkins Reviewed-by: Szymon Kłos --- desktop/source/lib/init.cxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index c72f5f9f94dd..7258f56393ef 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -5059,7 +5059,17 @@ static void lcl_sendDialogEvent(unsigned long long int nWindowId, const char* pA // special values for window id if (nWindowId == static_cast(-1)) + { sWindowId = sCurrentShellId + "sidebar"; + + // force sidebar resend - for legacy mobile-wizard: {"id":"-1"} + if (aMap.size() == 1) + { + // force resend - used in mobile-wizard + jsdialog::SendFullUpdate(sCurrentShellId + "sidebar", u"Panel"_ustr); + return; + } + } if (nWindowId == static_cast(-2)) sWindowId = sCurrentShellId + "notebookbar"; if (nWindowId == static_cast(-3)) @@ -5083,10 +5093,6 @@ static void lcl_sendDialogEvent(unsigned long long int nWindowId, const char* pA // these dialogs are created with WindowId "0" if (!SfxViewShell::Current() && jsdialog::ExecuteAction(u"0"_ustr, sControlId, aMap)) return; - - // force resend - used in mobile-wizard - jsdialog::SendFullUpdate(sCurrentShellId + "sidebar", u"Panel"_ustr); - } catch (std::out_of_range& e) {