[Libreoffice-commits] core.git: sfx2/source

Gökay ŞATIR (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 17 12:18:04 UTC 2021


 sfx2/source/control/unoctitm.cxx |   19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

New commits:
commit 15d89ca199d78e9b3b0775c1e720c1500f514d8b
Author:     Gökay ŞATIR <gokaysatir at gmail.com>
AuthorDate: Tue Aug 17 12:04:17 2021 +0300
Commit:     Gökay ŞATIR <gokaysatir at collabora.com>
CommitDate: Tue Aug 17 14:17:28 2021 +0200

    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 at collabora.co.uk>
    Reviewed-by: Gökay ŞATIR <gokaysatir at collabora.com>
    Tested-by: Jenkins

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;
     }
 


More information about the Libreoffice-commits mailing list