<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2017-11-10 10:39 GMT+01:00 Stephan Bergmann <span dir="ltr"><<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 11/10/2017 10:17 AM, Tomáš Chvátal wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
2017-11-06 9:58 GMT+01:00 Stephan Bergmann <<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a> <mailto:<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a>>>:<div><div class="gmail-h5"><br>
<br>
    Looking at the surrounding code<br>
<br>
             // Get redline info.<br>
             boost::property_tree::ptree aTree;<br>
             char* pJSON =<br>
        pDocument->m_pDocumentClass->g<wbr>etCommandValues(pDocument,<br>
        ".uno:AcceptTrackedChanges");<br>
             std::stringstream aStream(pJSON);<br>
             free(pJSON);<br>
             CPPUNIT_ASSERT(!aStream.str().<wbr>empty());<br>
             boost::property_tree::read_jso<wbr>n(aStream, aTree);<br>
             // Make sure that pressing a key creates exactly one redline.<br>
             CPPUNIT_ASSERT_EQUAL(static_ca<wbr>st<size_t>(1),<br>
        aTree.get_child("redlines").si<wbr>ze());<br>
<br>
<br>
    what's the binary content of that "char* pJSON" stream?  If that's<br>
    still intact, then it's apparently boost::property_tree::read_jso<wbr>n<br>
    that's breaking things.  And if that's already garbled, then it's<br>
    apparently the producer side of that<br>
    pDocument->m_pDocumentClass->g<wbr>etCommandValues (whatever that is)<br>
    that is breaking it and needs further investigation.<br>
<br>
I checked the read_json function and it was indeed rewritten in between the boost versions on the distro (and there were some comments about unicode support). So I had updated the boost function (basically to use latest boost code) in my testing repo and it still fails:<br>
<br>
[ 6427s] /home/abuild/rpmbuild/BUILD/li<wbr>breoffice-5.4.2.2/desktop/qa/<wbr>desktop_lib/test_desktop_lib.<wbr>cxx:1660:DesktopLOKTest::testR<wbr>edlineWriter<br>
[ 6427s] equality assertion failed<br>
[ 6427s] - Expected: Insert “t”<br>
[ 6427s] - Actual  : Insert â€œtâ€<br>
<br>
<br>
  FWIW I enabled it on the OBS so the full build log is tracked here:<br>
<a href="https://build.opensuse.org/package/live_build_log/LibreOffice:Factory/libreoffice/openSUSE_Leap_42.3/x86_64" rel="noreferrer" target="_blank">https://build.opensuse.org/pac<wbr>kage/live_build_log/LibreOffic<wbr>e:Factory/libreoffice/<wbr>openSUSE_Leap_42.3/x86_64</a><br>
<br>
Any idea how to check the getCommandValues behaviour if it is the proper one?<br>
</div></div></blockquote>
<br>
so, again, "what's the binary content of that "char* pJSON" stream?" can't you just dump it in gdb?<div class="gmail-HOEnZb"><div class="gmail-h5"><br></div></div></blockquote><div><br></div><div>$8 = 0x2076820 "{\n    \"redlines\":\n    [\n        {\n", ' ' <repeats 12 times>, "\"index\": \"1\",\n", ' ' <repeats 12 times>, "\"author\": \"Unknown Author\",\n", ' ' <repeats 12 times>, "\"type\": \"Insert\",\n", ' ' <repeats 12 times>, "\"comment\": \"\",\n", ' ' <repeats 12 times>, "\"description\": \"Insert \\u00E2\\u0080\\u009Ct\\u00E2\\u0080\\u009D\",\n", ' ' <repeats 12 times>, "\"dateTime\": \"2017-11-10T12:29:40\",\n", ' ' <repeats 12 times>, "\"textRange\": \"1418, 1418, 67, 275\"\n        }\n    ]\n}\n"</div><div><br></div><div>Tom </div></div></div></div>