[Libreoffice-commits] core.git: Branch 'feature/jsdialogs' - 2 commits - include/vcl vcl/source

Szymon Kłos (via logerrit) logerrit at kemper.freedesktop.org
Sun Sep 22 19:08:48 UTC 2019


 include/vcl/button.hxx        |    2 ++
 include/vcl/layout.hxx        |    2 ++
 vcl/source/control/button.cxx |    7 +++++++
 vcl/source/window/layout.cxx  |   18 ++++++++++++++++++
 vcl/source/window/window.cxx  |    4 +++-
 5 files changed, 32 insertions(+), 1 deletion(-)

New commits:
commit 31d141e0c9570b06d86327b794cbbc555bb5c312
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Sun Sep 22 17:06:38 2019 +0200
Commit:     Szymon Kłos <eszkadev at gmail.com>
CommitDate: Sun Sep 22 21:07:27 2019 +0200

    jsdialogs: export more properties
    
    Change-Id: Iaabe560867025c30c1478d4b33357231e67b0b57

diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx
index 71a8401cce10..14bb9d89567c 100644
--- a/include/vcl/button.hxx
+++ b/include/vcl/button.hxx
@@ -93,6 +93,8 @@ public:
 
     virtual FactoryFunction GetUITestFactory() const override;
 
+    virtual boost::property_tree::ptree DumpAsPropertyTree() override;
+
 protected:
 
     /// Handler for click, in case we want the button to handle uno commands (.uno:Something).
diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index 22730520363b..cfc2b444eaef 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -322,6 +322,7 @@ private:
     Size calculateRequisitionForSpacings(sal_Int32 nRowSpacing, sal_Int32 nColSpacing) const;
     virtual Size calculateRequisition() const override;
     virtual void setAllocation(const Size &rAllocation) override;
+    virtual boost::property_tree::ptree DumpAsPropertyTree() override;
 public:
     VclGrid(vcl::Window *pParent)
         : VclContainer(pParent)
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index d2151c7018a2..b568e8e98f99 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -577,6 +577,13 @@ FactoryFunction Button::GetUITestFactory() const
     return ButtonUIObject::create;
 }
 
+boost::property_tree::ptree Button::DumpAsPropertyTree()
+{
+    boost::property_tree::ptree aTree(Control::DumpAsPropertyTree());
+    aTree.put("text", GetText());
+    return aTree;
+}
+
 IMPL_STATIC_LINK( Button, dispatchCommandHandler, Button*, pButton, void )
 {
     if (pButton == nullptr)
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 21e844d4acf6..cb8f311cdd0b 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -1437,6 +1437,17 @@ void VclGrid::setAllocation(const Size& rAllocation)
     }
 }
 
+boost::property_tree::ptree VclGrid::DumpAsPropertyTree()
+{
+    boost::property_tree::ptree aTree(VclContainer::DumpAsPropertyTree());
+    array_type A = assembleGrid(*this);
+    sal_Int32 nMaxX = A.shape()[0];
+    sal_Int32 nMaxY = A.shape()[1];
+    aTree.put("cols", nMaxX);
+    aTree.put("rows", nMaxY);
+    return aTree;
+}
+
 bool toBool(const OUString &rValue)
 {
     return (!rValue.isEmpty() && (rValue[0] == 't' || rValue[0] == 'T' || rValue[0] == '1'));
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index c83cae49b227..3dd8d1167f67 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -3347,13 +3347,15 @@ boost::property_tree::ptree Window::DumpAsPropertyTree()
     aTree.put("id", get_id());  // TODO could be missing - sort out
     aTree.put("type", windowTypeName(GetType()));
     aTree.put("text", GetText());
+    aTree.put("enabled", IsEnabled());
 
     boost::property_tree::ptree aChildren;
     if (vcl::Window* pChild = mpWindowImpl->mpFirstChild)
     {
         while (pChild)
         {
-            aChildren.push_back(std::make_pair("", pChild->DumpAsPropertyTree()));
+            if (pChild->IsVisible())
+                aChildren.push_back(std::make_pair("", pChild->DumpAsPropertyTree()));
             pChild = pChild->mpWindowImpl->mpNext;
         }
         aTree.add_child("children", aChildren);
commit 61c0b2c48919a9f898cf1a68b5890f9a00c31de2
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Sep 19 16:16:46 2019 +0200
Commit:     Szymon Kłos <eszkadev at gmail.com>
CommitDate: Sun Sep 22 21:07:21 2019 +0200

    jsdialogs: export vertical property for Boxes
    
    Change-Id: I377638b0e9c5575e41ea3f3714541cc94f61a92b

diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index fa8765277488..22730520363b 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -90,6 +90,7 @@ public:
         m_bHomogeneous = bHomogeneous;
     }
     virtual bool set_property(const OString &rKey, const OUString &rValue) override;
+    virtual boost::property_tree::ptree DumpAsPropertyTree() override;
 protected:
     virtual sal_uInt16 getDefaultAccessibleRole() const override;
     void accumulateMaxes(const Size &rChildSize, Size &rSize) const;
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index f5beadaf0a9f..21e844d4acf6 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -501,6 +501,13 @@ bool VclBox::set_property(const OString &rKey, const OUString &rValue)
     return true;
 }
 
+boost::property_tree::ptree VclBox::DumpAsPropertyTree()
+{
+    boost::property_tree::ptree aTree(VclContainer::DumpAsPropertyTree());
+    aTree.put("vertical", m_bVerticalContainer);
+    return aTree;
+}
+
 sal_uInt16 VclBox::getDefaultAccessibleRole() const
 {
 #if defined(_WIN32)


More information about the Libreoffice-commits mailing list