summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2021-11-15 09:13:35 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2022-01-24 12:17:20 +0100
commitb9f53322df937098eef4fd5b2889989a38e4ffda (patch)
tree64f26297e3f7b8bdef791b573db5a95d53aa3442 /desktop
parente064a2a1e82e913c49312706cd52736fa6a4f994 (diff)
jsdialog: use string identifiers
Thanks to that it is easier to debug and find widgets in maps. Sidebar and notebookbar are now in different map entries. This fixes the issue when destroying notebookbar deleted sidebar's widgets. After this patch sidebar works correctly when using notebookbar mode in lok. Change-Id: Ie9dcb82675129bdb567b766e29779744f500cb48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125216 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128853 Tested-by: Jenkins
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 6e41ede6c35f..ef2365a017e6 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4031,15 +4031,23 @@ static void lcl_sendDialogEvent(unsigned long long int nWindowId, const char* pA
OString sControlId = OUStringToOString(aMap["id"], RTL_TEXTENCODING_ASCII_US);
// dialogs send own id but notebookbar and sidebar controls are remembered by SfxViewShell id
- bool bFoundWeldedControl = jsdialog::ExecuteAction(nWindowId, sControlId, aMap);
+ bool bFoundWeldedControl = jsdialog::ExecuteAction(std::to_string(nWindowId), sControlId, aMap);
if (!bFoundWeldedControl)
- bFoundWeldedControl = jsdialog::ExecuteAction(nCurrentShellId, sControlId, aMap);
+ bFoundWeldedControl = jsdialog::ExecuteAction(std::to_string(nCurrentShellId) + "sidebar", sControlId, aMap);
+ if (!bFoundWeldedControl)
+ bFoundWeldedControl = jsdialog::ExecuteAction(std::to_string(nCurrentShellId) + "notebookbar", sControlId, aMap);
+ if (!bFoundWeldedControl && !SfxViewShell::Current())
+ {
+ // this is needed for dialogs shown before document is loaded: MacroWarning dialog, etc...
+ // these dialogs are created with WindowId "0"
+ bFoundWeldedControl = jsdialog::ExecuteAction("0", sControlId, aMap);
+ }
if (bFoundWeldedControl)
return;
// force resend - used in mobile-wizard
- jsdialog::SendFullUpdate(nCurrentShellId, "Panel");
+ jsdialog::SendFullUpdate(std::to_string(nCurrentShellId) + "sidebar", "Panel");
} catch(...) {}
}