diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2023-08-08 06:49:04 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2023-08-29 11:18:21 +0200 |
commit | beeeb3b8d5dcdee45d3fb2cb97f3def789db0f6a (patch) | |
tree | f734a3aac1a8a7108be6054fba325b790c0e3627 /desktop/source | |
parent | 7cdefb880ed6fd413b9e31fa45352cdeb074a24f (diff) |
jsdialog: detect special window id earlier
Change-Id: Ib90d9d728d93a26d44a7f52b7ca0074338b1fae9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155853
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156235
Tested-by: Jenkins
Diffstat (limited to 'desktop/source')
-rw-r--r-- | desktop/source/lib/init.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 86a32708e59b..21c47eacdfc7 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -4721,11 +4721,21 @@ static void lcl_sendDialogEvent(unsigned long long int nWindowId, const char* pA try { OUString sControlId = aMap["id"]; + OUString sWindowId = OUString::number(nWindowId); + OUString sCurrentShellId = OUString::number(nCurrentShellId); + + // special values for window id + if (nWindowId == static_cast<unsigned long long int>(-1)) + sWindowId = sCurrentShellId + "sidebar"; + if (nWindowId == static_cast<unsigned long long int>(-2)) + sWindowId = sCurrentShellId + "notebookbar"; + if (nWindowId == static_cast<unsigned long long int>(-3)) + sWindowId = sCurrentShellId + "formulabar"; // dialogs send own id but notebookbar and sidebar controls are remembered by SfxViewShell id - if (jsdialog::ExecuteAction(OUString::number(nWindowId), sControlId, aMap)) + if (jsdialog::ExecuteAction(sWindowId, sControlId, aMap)) return; - auto sCurrentShellId = OUString::number(nCurrentShellId); + if (jsdialog::ExecuteAction(sCurrentShellId + "sidebar", sControlId, aMap)) return; if (jsdialog::ExecuteAction(sCurrentShellId + "notebookbar", sControlId, aMap)) |