[Libreoffice-commits] core.git: desktop/source
Tor Lillqvist
tml at collabora.com
Tue Mar 27 19:20:31 UTC 2018
desktop/source/lib/init.cxx | 14 ++++++++++++++
1 file changed, 14 insertions(+)
New commits:
commit 1bf2ed44a18666843d6c1b4a92966fd78cda07bf
Author: Tor Lillqvist <tml at collabora.com>
Date: Fri Jan 19 17:44:52 2018 +0200
Handle also []any in unoAnyToPropertyTree()
We add it as a subtree where each element in the sequence has as its
name its number.
Change-Id: I9422777d887d899f76ad6d259631d15c2db53f03
Reviewed-on: https://gerrit.libreoffice.org/51967
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Tor Lillqvist <tml at collabora.com>
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 40709157357b..8193dd5d3446 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -274,6 +274,20 @@ static boost::property_tree::ptree unoAnyToPropertyTree(const uno::Any& anyItem)
aTree.put("value", OString::number(anyItem.get<sal_uInt32>()).getStr());
else if (aType == "long")
aTree.put("value", OString::number(anyItem.get<sal_Int32>()).getStr());
+ else if (aType == "[]any")
+ {
+ uno::Sequence<uno::Any> aSeq;
+ if (anyItem >>= aSeq)
+ {
+ boost::property_tree::ptree aSubTree;
+
+ for (auto i = 0; i < aSeq.getLength(); ++i)
+ {
+ aSubTree.add_child(OString::number(i).getStr(), unoAnyToPropertyTree(aSeq[i]));
+ }
+ aTree.add_child("value", aSubTree);
+ }
+ }
// TODO: Add more as required
More information about the Libreoffice-commits
mailing list