summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorGökay ŞATIR <gokaysatir@gmail.com>2021-08-17 12:04:17 +0300
committerGökay ŞATIR <gokaysatir@collabora.com>2021-08-17 14:17:28 +0200
commit15d89ca199d78e9b3b0775c1e720c1500f514d8b (patch)
tree42d6afa81179929469e472265e18147b2a871ef3 /sfx2
parent6fd0d2af5069ec23b25b7e7e2e024df9e3319a0a (diff)
Use new json_writer class for json objects.
Change-Id: I68b43829250201a716e2ec10968b90eadcba7fca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120567 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Gökay ŞATIR <gokaysatir@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/control/unoctitm.cxx19
1 files changed, 9 insertions, 10 deletions
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 4395f19cd3da..125dc88c7bb1 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -81,6 +81,7 @@
#include <desktop/crashreport.hxx>
#include <vcl/threadex.hxx>
#include <unotools/mediadescriptor.hxx>
+#include <tools/json_writer.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -532,16 +533,14 @@ void SfxDispatchController_Impl::dispatch( const css::util::URL& aURL,
SfxViewShell::Current()->isFreemiumView() &&
comphelper::LibreOfficeKit::isCommandFreemiumDenied(aURL.Complete))
{
- boost::property_tree::ptree aTree;
- aTree.put("code", "");
- aTree.put("kind", "freemiumdeny");
- aTree.put("cmd", aURL.Complete);
- aTree.put("message", "Blocked Freemium feature");
- aTree.put("viewID", SfxViewShell::Current()->GetViewShellId().get());
-
- std::stringstream aStream;
- boost::property_tree::write_json(aStream, aTree);
- SfxViewShell::Current()->libreOfficeKitViewCallback(LOK_CALLBACK_ERROR, aStream.str().c_str());
+ tools::JsonWriter aJson;
+ aJson.put("code", "");
+ aJson.put("kind", "freemiumdeny");
+ aJson.put("cmd", aURL.Complete);
+ aJson.put("message", "Blocked Freemium feature");
+ aJson.put("viewID", SfxViewShell::Current()->GetViewShellId().get());
+
+ SfxViewShell::Current()->libreOfficeKitViewCallback(LOK_CALLBACK_ERROR, aJson.extractAsOString().getStr());
return;
}