[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - desktop/source

Tor Lillqvist tml at collabora.com
Tue Apr 3 11:50:45 UTC 2018


 desktop/source/lib/init.cxx |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

New commits:
commit 5c06f1eb53f818bbf1d25eeac10201168a67e52e
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>
    (cherry picked from commit 1bf2ed44a18666843d6c1b4a92966fd78cda07bf)
    Reviewed-on: https://gerrit.libreoffice.org/52091
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 25b66ab08480..a3b77270aaa9 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -291,6 +291,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