[Libreoffice-commits] online.git: common/Message.hpp

Dennis Francis (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 16 06:02:48 UTC 2020


 common/Message.hpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit bc7a0b262664032769b2dde3a31151f23ffd5235
Author:     Dennis Francis <dennis.francis at collabora.com>
AuthorDate: Mon Jun 15 19:56:59 2020 +0530
Commit:     Dennis Francis <dennis.francis at collabora.com>
CommitDate: Tue Jun 16 08:02:27 2020 +0200

    jsonString: allow json messages without white-spaces after '{'
    
    The json generated by boost::property_tree::write_json() has no
    white-spaces around { , : } json-characters. We use write_json()
    extensively in core.git. Without this patch we will need work-arounds
    like inserting spaces in the json strings thus generated to work with
    online's Message::jsonString()
    
    Change-Id: I0f0631088f4a8b727301bde449884e03163093f0
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96383
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>

diff --git a/common/Message.hpp b/common/Message.hpp
index cb27e2c97..7bbadd172 100644
--- a/common/Message.hpp
+++ b/common/Message.hpp
@@ -97,7 +97,7 @@ public:
     /// Returns the json part of the message, if any.
     std::string jsonString() const
     {
-        if (_tokens.size() > 1 && _tokens[1] == "{")
+        if (_tokens.size() > 1 && _tokens[1].size() && _tokens[1][0] == '{')
         {
             const size_t firstTokenSize = _tokens[0].size();
             return std::string(_data.data() + firstTokenSize, _data.size() - firstTokenSize);


More information about the Libreoffice-commits mailing list