[Libreoffice-commits] core.git: Branch 'feature/jsdialogs' - 2 commits - include/vcl vcl/source
Szymon Kłos (via logerrit)
logerrit at kemper.freedesktop.org
Wed Sep 25 09:59:10 UTC 2019
include/vcl/toolbox.hxx | 2 ++
vcl/source/control/listbox.cxx | 12 ++++++++++++
vcl/source/window/toolbox2.cxx | 24 ++++++++++++++++++++++++
3 files changed, 38 insertions(+)
New commits:
commit 4f4baa62c3b49fc96cac858888f154b90d4579f3
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: Wed Sep 25 11:58:27 2019 +0200
jsdialogs: send toolitems
Change-Id: I113cd99dbcd8b7a2551271041ae749eaa68af8fc
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: */
commit c748366f0f06a7105e502b09a116ae68f4b28b39
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Sep 25 10:27:38 2019 +0200
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Sep 25 10:27:38 2019 +0200
jsdialogs: send selection for listbox
Change-Id: Ie5e026da0a4ca95df8fe52a6bf7967dc93b3d869
diff --git a/vcl/source/control/listbox.cxx b/vcl/source/control/listbox.cxx
index 375bf9def4cb..26b9b73f39c1 100644
--- a/vcl/source/control/listbox.cxx
+++ b/vcl/source/control/listbox.cxx
@@ -1451,6 +1451,18 @@ boost::property_tree::ptree ListBox::DumpAsPropertyTree()
aTree.add_child("entries", aEntries);
+ boost::property_tree::ptree aSelected;
+
+ for (int i = 0; i < GetSelectedEntryCount(); ++i)
+ {
+ boost::property_tree::ptree aEntry;
+ aEntry.put("", GetSelectedEntryPos(i));
+ aSelected.push_back(std::make_pair("", aEntry));
+ }
+
+ aTree.put("selectedCount", GetSelectedEntryCount());
+ aTree.add_child("selectedEntries", aSelected);
+
return aTree;
}
More information about the Libreoffice-commits
mailing list