[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - 2 commits - include/vcl vcl/jsdialog vcl/source

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Tue Dec 1 12:48:31 UTC 2020


 include/vcl/dialog.hxx           |    2 ++
 vcl/jsdialog/executor.cxx        |   12 ++++++++++++
 vcl/jsdialog/jsdialogbuilder.cxx |    3 +++
 vcl/source/window/dialog.cxx     |    7 +++++++
 4 files changed, 24 insertions(+)

New commits:
commit 411034066510d21a960adced5c6f0f14638da972
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Nov 19 13:50:30 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Tue Dec 1 13:48:13 2020 +0100

    jsdialog: dump dialog title
    
    Change-Id: Id4c9f336039f8a0b8d1d43fdff4852f32e2c7ae6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106967
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx
index 1f777dfc1629..d02772ce0e63 100644
--- a/include/vcl/dialog.hxx
+++ b/include/vcl/dialog.hxx
@@ -155,6 +155,8 @@ public:
     void            set_default_response(int nResponse);
     int             get_default_response() const;
     vcl::Window*    get_widget_for_response(int nResponse);
+
+    virtual boost::property_tree::ptree DumpAsPropertyTree() override;
 };
 
 #endif // INCLUDED_VCL_DIALOG_HXX
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 85f87ad92a54..f0b5a96462c9 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -1607,4 +1607,11 @@ void TopLevelWindowLocker::decBusy()
     m_aBusyStack.pop();
 }
 
+boost::property_tree::ptree Dialog::DumpAsPropertyTree()
+{
+    boost::property_tree::ptree aTree(SystemWindow::DumpAsPropertyTree());
+    aTree.put("title", GetText());
+    return aTree;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit cdeadf981ba0e4beccf3f0ad454272d199aea078
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Nov 18 12:14:35 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Tue Dec 1 13:47:56 2020 +0100

    jsdialog: remember dialog instance & handle close
    
    Change-Id: I1b10d12edfa7ffca1061f50b5219baae1ac3caeb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106930
    Tested-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index b4613db68fe9..813b9d4b00a9 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -241,6 +241,18 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& rWidget, StringMap& rDat
                 }
             }
         }
+        else if (sControlType == "dialog")
+        {
+            auto pDialog = dynamic_cast<weld::Dialog*>(pWidget);
+            if (pDialog)
+            {
+                if (sAction == "close")
+                {
+                    pDialog->response(RET_CANCEL);
+                    return true;
+                }
+            }
+        }
     }
 
     return false;
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 19a652e8e440..bc80416ac335 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -359,6 +359,9 @@ std::unique_ptr<weld::Dialog> JSInstanceBuilder::weld_dialog(const OString& id,
     std::unique_ptr<weld::Dialog> pRet(pDialog ? new JSDialog(m_aOwnedToplevel, m_aOwnedToplevel,
                                                               pDialog, this, false, m_sTypeOfJSON)
                                                : nullptr);
+
+    RememberWidget("__DIALOG__", pRet.get());
+
     if (bTakeOwnership && pDialog)
     {
         assert(!m_aOwnedToplevel && "only one toplevel per .ui allowed");


More information about the Libreoffice-commits mailing list