[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - vcl/inc vcl/jsdialog
Szymon KÅos (via logerrit)
logerrit at kemper.freedesktop.org
Mon Jul 5 11:45:54 UTC 2021
vcl/inc/jsdialog/jsdialogbuilder.hxx | 3 ++-
vcl/jsdialog/jsdialogbuilder.cxx | 18 +++++++-----------
2 files changed, 9 insertions(+), 12 deletions(-)
New commits:
commit 38b95bef8c8b651853b7d010a8212de621e83b20
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Mon Jul 5 12:21:16 2021 +0200
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Mon Jul 5 13:45:20 2021 +0200
jsdialog: simplify popup code
Change-Id: I3a84b1f7c8521b861e99384872127bb4d224c18b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118409
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index c8282783b3e3..f80d8fad9f1a 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -50,7 +50,8 @@ enum MessageType
WidgetUpdate,
Close,
Action,
- Popup
+ Popup,
+ PopupClose
};
}
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 6251b892697e..023ed09f81f6 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -295,17 +295,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;
- }
}
}
}
@@ -382,7 +378,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();
}
More information about the Libreoffice-commits
mailing list