diff options
author | Tor Lillqvist <tml@collabora.com> | 2018-01-19 17:44:52 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2018-03-27 21:20:07 +0200 |
commit | 1bf2ed44a18666843d6c1b4a92966fd78cda07bf (patch) | |
tree | dee20ef4a3dec769a3c4da49012c3c488e3a3970 /desktop/source/lib | |
parent | aa27a25d152ab70f60fedcea3bd4cd99d68103a0 (diff) |
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@libreoffice.org>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'desktop/source/lib')
-rw-r--r-- | desktop/source/lib/init.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
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 |