[Libreoffice-commits] core.git: include/vcl vcl/source
Szymon Kłos (via logerrit)
logerrit at kemper.freedesktop.org
Tue Oct 1 12:06:03 UTC 2019
include/vcl/toolbox.hxx | 2 ++
vcl/source/window/toolbox2.cxx | 24 ++++++++++++++++++++++++
2 files changed, 26 insertions(+)
New commits:
commit 6d46ccc6b52c45d3d64a1c66f616defd12147bc5
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Sep 25 11:58:27 2019 +0200
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Tue Oct 1 14:05:21 2019 +0200
jsdialogs: send toolitems
Change-Id: I113cd99dbcd8b7a2551271041ae749eaa68af8fc
Reviewed-on: https://gerrit.libreoffice.org/79806
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx
index 32f9c061889e..0fa569248dd2 100644
--- a/include/vcl/toolbox.hxx
+++ b/include/vcl/toolbox.hxx
@@ -521,6 +521,8 @@ public:
void SetToolBoxTextPosition( ToolBoxTextPosition ePosition );
void SetLineSpacing(bool b) { mbLineSpacing = b; }
+
+ virtual boost::property_tree::ptree DumpAsPropertyTree() override;
};
inline void ToolBox::CheckItem( sal_uInt16 nItemId, bool bCheck )
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index ba92d20db57a..4aecf7abfaa6 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -1766,4 +1766,28 @@ void ToolBox::WillUsePopupMode( bool b )
mpData->mbWillUsePopupMode = b;
}
+boost::property_tree::ptree ToolBox::DumpAsPropertyTree()
+{
+ boost::property_tree::ptree aTree(DockingWindow::DumpAsPropertyTree());
+ boost::property_tree::ptree aChildren;
+
+ for (unsigned long i = 0; i < GetItemCount(); ++i)
+ {
+ ToolBoxItemType type = GetItemType(i);
+ if (type == ToolBoxItemType::BUTTON)
+ {
+ boost::property_tree::ptree aEntry;
+ int nId = GetItemId(i);
+ aEntry.put("type", "toolitem");
+ aEntry.put("text", GetItemText(nId));
+ aEntry.put("command", GetItemCommand(nId));
+ aChildren.push_back(std::make_pair("", aEntry));
+ }
+ }
+
+ aTree.add_child("children", aChildren);
+
+ return aTree;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list