summaryrefslogtreecommitdiff
path: root/sw/source/uibase/uno
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2021-01-14 23:50:39 +0200
committerTor Lillqvist <tml@collabora.com>2021-01-15 09:09:44 +0100
commitfde2629fa5795dffde0504758f990592d294c5ff (patch)
treef8b83bd0b0cb6a71f6d63ac3a24dc300e2f47b29 /sw/source/uibase/uno
parent5aee16cf09f9d4ba50feaf804b2a7a649af276bc (diff)
Fix errors in produced JSON introduced with the switch to JsonWriter
GetRedlineAuthorInfo() should produce a JSON array and not an object with empty strings as keys, which is incorrect JSON. The code in Collabora Online expects an array, see Document::getViewColors() in kit/Kit.cpp. Producing the wrong kind of data leads to Poco throwing an exception: Assertion violation: !_key.empty() [in file "src/ParseHandler.cpp", line 64] Also SwXTextDocument::getPostIts() should produce a JSON array. Change-Id: I1ab0653ca1eaa3c466d31b1f068ba5937a04e43e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109316 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'sw/source/uibase/uno')
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 4ef8253e5fa2..9c457cf49c19 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3329,7 +3329,7 @@ void SwXTextDocument::getRulerState(tools::JsonWriter& rJsonWriter)
void SwXTextDocument::getPostIts(tools::JsonWriter& rJsonWriter)
{
SolarMutexGuard aGuard;
- auto commentsNode = rJsonWriter.startNode("comments");
+ auto commentsNode = rJsonWriter.startArray("comments");
for (auto const& sidebarItem : *m_pDocShell->GetView()->GetPostItMgr())
{
sw::annotation::SwAnnotationWin* pWin = sidebarItem->mpPostIt.get();
@@ -3355,7 +3355,7 @@ void SwXTextDocument::getPostIts(tools::JsonWriter& rJsonWriter)
}
const OString sRects = comphelper::string::join("; ", aRects);
- auto commentNode = rJsonWriter.startNode("");
+ auto commentNode = rJsonWriter.startStruct();
rJsonWriter.put("id", pField->GetPostItId());
rJsonWriter.put("parent", pWin->CalcParent());
rJsonWriter.put("author", pField->GetPar1());