diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2021-01-15 09:55:24 +0100 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2021-01-22 11:31:22 +0100 |
commit | ba05c093143ba993af143e25acdeda76d9d1f888 (patch) | |
tree | efdade446320280e06dc6c2b3d04dd58451fe2d8 /vcl | |
parent | a6f45c525226e858ccca5078a6a41e8b07a78b86 (diff) |
jsdialog: fix tabcontrol json structure
Change-Id: I1a295ece6e618e3bb81b8842a8b9df5de1cbffac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109366
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/control/tabctrl.cxx | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index dee5e226452c..6579613dbd62 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -2180,18 +2180,37 @@ FactoryFunction TabControl::GetUITestFactory() const void TabControl::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) { - Control::DumpAsPropertyTree(rJsonWriter); + rJsonWriter.put("id", get_id()); + rJsonWriter.put("type", "tabcontrol"); + rJsonWriter.put("selected", GetCurPageId()); + + { + auto childrenNode = rJsonWriter.startArray("children"); + for (int i = 0; i < GetChildCount(); i++) + { + vcl::Window* pChild = GetChild(i); + + if (pChild) + { + auto childNode = rJsonWriter.startStruct(); + pChild->DumpAsPropertyTree(rJsonWriter); + + if (pChild->IsVisible()) { + rJsonWriter.put("hidden", "true"); + } + } + } + } { - auto tabsNode = rJsonWriter.startNode("tabs"); + auto tabsNode = rJsonWriter.startArray("tabs"); for(auto id : GetPageIDs()) { - auto tabNode = rJsonWriter.startNode(""); + auto tabNode = rJsonWriter.startStruct(); rJsonWriter.put("text", GetPageText(id)); rJsonWriter.put("id", id); rJsonWriter.put("name", GetPageName(id)); } } - rJsonWriter.put("selected", GetCurPageId()); } sal_uInt16 NotebookbarTabControlBase::m_nHeaderHeight = 0; |