[Libreoffice-commits] core.git: vcl/inc vcl/jsdialog

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 17 07:13:54 UTC 2021


 vcl/inc/jsdialog/jsdialogbuilder.hxx |    3 ++-
 vcl/jsdialog/jsdialogbuilder.cxx     |   18 +++++++-----------
 2 files changed, 9 insertions(+), 12 deletions(-)

New commits:
commit 615a340fcf05845397ea3c9917e2eadf074b4514
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: Tue Aug 17 09:13:21 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>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120542
    Tested-by: Jenkins

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();
 }
 


More information about the Libreoffice-commits mailing list