[Libreoffice-commits] core.git: include/vcl vcl/source

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Tue Jul 7 06:35:58 UTC 2020


 include/vcl/toolkit/combobox.hxx |    2 ++
 vcl/source/control/combobox.cxx  |   22 ++++++++++++++++++++++
 2 files changed, 24 insertions(+)

New commits:
commit f94fd72e87616e6c05a9ea07f21106f488234c15
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Feb 25 13:01:20 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Tue Jul 7 08:35:17 2020 +0200

    jsdialog: export combobox entries
    
    Change-Id: Ic0a3c93020c7c915fd908fe994ec0a3a900358eb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97625
    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/+/97862
    Tested-by: Jenkins

diff --git a/include/vcl/toolkit/combobox.hxx b/include/vcl/toolkit/combobox.hxx
index 611bce590add..fe322fc2e188 100644
--- a/include/vcl/toolkit/combobox.hxx
+++ b/include/vcl/toolkit/combobox.hxx
@@ -187,6 +187,8 @@ public:
     virtual bool set_property(const OString &rKey, const OUString &rValue) override;
 
     virtual FactoryFunction GetUITestFactory() const override;
+
+    virtual void DumpAsPropertyTree(tools::JsonWriter&) override;
 };
 
 #endif  // _COMBOBOX_HXX
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 881acd2a654c..9942da05aaed 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -32,6 +32,7 @@
 #include <listbox.hxx>
 #include <controldata.hxx>
 #include <comphelper/lok.hxx>
+#include <tools/json_writer.hxx>
 
 namespace {
 
@@ -1539,4 +1540,25 @@ FactoryFunction ComboBox::GetUITestFactory() const
     return ComboBoxUIObject::create;
 }
 
+void ComboBox::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter)
+{
+    Control::DumpAsPropertyTree(rJsonWriter);
+
+    auto entriesNode = rJsonWriter.startNode("entries");
+    for (int i = 0; i < GetEntryCount(); ++i)
+    {
+        auto entryNode = rJsonWriter.startNode("");
+        rJsonWriter.put("", GetEntry(i));
+    }
+
+    auto selectedNode = rJsonWriter.startNode("selectedEntries");
+    for (int i = 0; i < GetSelectedEntryCount(); ++i)
+    {
+        auto entryNode = rJsonWriter.startNode("");
+        rJsonWriter.put("", GetSelectedEntryPos(i));
+    }
+
+    rJsonWriter.put("selectedCount", GetSelectedEntryCount());
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list