summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2021-07-05 12:21:16 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2021-08-17 09:13:21 +0200
commit615a340fcf05845397ea3c9917e2eadf074b4514 (patch)
tree6d8b36475e9f7922c27afdebe61e98246546ee75
parent5a3f9ff4b6bd4a351efbdf0226aad03eba9456be (diff)
jsdialog: simplify popup code
Change-Id: I3a84b1f7c8521b861e99384872127bb4d224c18b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118409 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120542 Tested-by: Jenkins
-rw-r--r--vcl/inc/jsdialog/jsdialogbuilder.hxx3
-rw-r--r--vcl/jsdialog/jsdialogbuilder.cxx18
2 files changed, 9 insertions, 12 deletions
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 150a89f1f93d..cfc5e52e5bb9 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -52,7 +52,8 @@ enum MessageType
WidgetUpdate,
Close,
Action,
- Popup
+ Popup,
+ PopupClose
};
}
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index c3f4e2ac6310..4f0e6aa6bfc5 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -289,17 +289,13 @@ void JSDialogNotifyIdle::Invoke()
break;
case jsdialog::MessageType::Popup:
- {
- OUString sParentId = (*rMessage.m_pData)[PARENT_ID];
- OUString sWindowId = (*rMessage.m_pData)[WINDOW_ID];
- OUString sCloseId = (*rMessage.m_pData)[CLOSE_ID];
-
- if (!sParentId.isEmpty())
- send(*generatePopupMessage(rMessage.m_pWindow, sParentId, sCloseId));
- else if (!sWindowId.isEmpty())
- send(*generateClosePopupMessage(sWindowId));
+ send(*generatePopupMessage(rMessage.m_pWindow, (*rMessage.m_pData)[PARENT_ID],
+ (*rMessage.m_pData)[CLOSE_ID]));
+ break;
+
+ case jsdialog::MessageType::PopupClose:
+ send(*generateClosePopupMessage((*rMessage.m_pData)[WINDOW_ID]));
break;
- }
}
}
}
@@ -376,7 +372,7 @@ void JSDialogSender::sendClosePopup(vcl::LOKWindowId nWindowId)
std::unique_ptr<ActionDataMap> pData = std::make_unique<ActionDataMap>();
(*pData)[WINDOW_ID] = OUString::number(nWindowId);
- mpIdleNotify->sendMessage(jsdialog::MessageType::Popup, nullptr, std::move(pData));
+ mpIdleNotify->sendMessage(jsdialog::MessageType::PopupClose, nullptr, std::move(pData));
mpIdleNotify->Start();
}