sc/qa/unit/tiledrendering/tiledrendering.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit 84a3401c28135735c7bbe324eb3642b31c7f26f5
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Wed Jan 10 08:28:31 2024 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Wed Jan 10 09:45:31 2024 +0100

    CppunitTest_sc_tiledrendering: ignore non-json payload for STATE_CHANGED
    
    The payload can be both plain text and json here, but in practice we
    only care about json for now, and I never saw a plain text payload when
    running this suite locally.
    
    
<https://gerrit.libreoffice.org/c/core/+/161691/4#message-d4772c1362bc5e059f8ea13b4163926d9b462535>
    reports that sometimes we get an .uno:InsertAnnotation=enabled, so just
    ignore that without feeding that not-well-formed JSON to the JSON
    parser.
    
    Change-Id: Ic679ad20c453254237b906d4d2040824517d56e0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161873
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>
    Tested-by: Jenkins

diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx 
b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 25d1258c21d3..aa142a0989c0 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -589,6 +589,11 @@ public:
         case LOK_CALLBACK_STATE_CHANGED:
         {
             std::stringstream aStream(pPayload);
+            if (!aStream.str().starts_with("{"))
+            {
+                break;
+            }
+
             boost::property_tree::ptree aTree;
             boost::property_tree::read_json(aStream, aTree);
             std::string aCommandName = aTree.get<std::string>("commandName");

Reply via email to