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

Jan Holesovsky kendy at collabora.com
Wed Feb 1 09:51:33 UTC 2017


 sfx2/source/view/lokhelper.cxx |   14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

New commits:
commit 586626676b0aa697e153c6693a1e1407f7746989
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Tue Jan 31 16:47:54 2017 +0100

    Build the json message a much less expensive way.
    
    Change-Id: I10911deb52f6a0c65262f9d6af459cf6ddd2fae9
    Reviewed-on: https://gerrit.libreoffice.org/33761
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 4aa35af..bfcd000 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -9,8 +9,6 @@
 
 #include <sfx2/lokhelper.hxx>
 
-#include <boost/property_tree/json_parser.hpp>
-
 #include <com/sun/star/frame/Desktop.hpp>
 
 #include <comphelper/processfactory.hxx>
@@ -112,14 +110,10 @@ bool SfxLokHelper::getViewIds(int* pArray, size_t nSize)
 
 void SfxLokHelper::notifyOtherView(SfxViewShell* pThisView, SfxViewShell* pOtherView, int nType, const OString& rKey, const OString& rPayload)
 {
-    boost::property_tree::ptree aTree;
-    aTree.put("viewId", SfxLokHelper::getView(pThisView));
-    aTree.put(rKey.getStr(), rPayload.getStr());
-    aTree.put("part", pThisView->getPart());
-    aTree.put(rKey.getStr(), rPayload.getStr());
-    std::stringstream aStream;
-    boost::property_tree::write_json(aStream, aTree);
-    OString aPayload = aStream.str().c_str();
+    OString aPayload = OString("{ \"viewId\": \"") + OString::number(SfxLokHelper::getView(pThisView)) +
+        "\", \"part\": \"" + OString::number(pThisView->getPart()) +
+        "\", \"" + rKey + "\": \"" + rPayload + "\" }";
+
     pOtherView->libreOfficeKitViewCallback(nType, aPayload.getStr());
 }
 


More information about the Libreoffice-commits mailing list