diff options
author | Jan Holesovsky <kendy@collabora.com> | 2017-01-31 16:47:54 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-02-18 01:04:53 +0100 |
commit | 8f13d1ebe42dfea233df3b802202b91cfa82a11c (patch) | |
tree | c676efbab00914b9d25e9eb099064968abd24e89 /sfx2 | |
parent | db15f1c9415908b10801b7bdfb0879ef834a1220 (diff) |
Build the json message a much less expensive way.
Change-Id: I10911deb52f6a0c65262f9d6af459cf6ddd2fae9
(cherry picked from commit 230f04e92d3a3c492e12e0ef2392fc45c73dd762)
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/lokhelper.cxx | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 4aa35af5edb8..bfcd000eba01 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()); } |