summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2019-09-22 17:06:38 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2019-10-01 10:22:44 +0200
commit7388db1b63fb19224f80cd7930268ec924f2c93f (patch)
treec2157ca7523bc863397f39a97ffb349dc9adf4dc
parent7362568a87256c367f79fd17de68cb447e79f265 (diff)
jsdialogs: export more properties
Change-Id: Iaabe560867025c30c1478d4b33357231e67b0b57 Reviewed-on: https://gerrit.libreoffice.org/79799 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
-rw-r--r--include/vcl/button.hxx2
-rw-r--r--include/vcl/layout.hxx1
-rw-r--r--vcl/source/control/button.cxx7
-rw-r--r--vcl/source/window/layout.cxx11
-rw-r--r--vcl/source/window/window.cxx4
5 files changed, 24 insertions, 1 deletions
diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx
index bff3c8af3de9..eaa074332cba 100644
--- a/include/vcl/button.hxx
+++ b/include/vcl/button.hxx
@@ -91,6 +91,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 fa8765277488..6a2d38d77a49 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -321,6 +321,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 b130686d82ee..5fbf156417b9 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -578,6 +578,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 49fecb7476fc..f558e6118da2 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -1431,6 +1431,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 4121cb565c30..7339e881b4db 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -3350,13 +3350,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);