summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-08-03 14:42:13 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-08-11 13:22:30 +0200
commitd46c7bd597e51453ac420db97fd898ed2f3b26bf (patch)
tree7d04961d35703b4440d344fbbf22334852001d78 /tools
parentd0b5ff42431d8d18ab9b70fd54206f21bbe4316a (diff)
use tools::Json for cursor messages
and tweak the JsonWriter to produce output more like the boost propertytree, to make the cypress tests happier. Change-Id: Ia2062508ae9f14a5f89306042c33884ff300f478 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119936 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'tools')
-rw-r--r--tools/qa/cppunit/test_json_writer.cxx2
-rw-r--r--tools/source/misc/json_writer.cxx2
2 files changed, 2 insertions, 2 deletions
diff --git a/tools/qa/cppunit/test_json_writer.cxx b/tools/qa/cppunit/test_json_writer.cxx
index 6a2cc7813574..6ff2810d79d4 100644
--- a/tools/qa/cppunit/test_json_writer.cxx
+++ b/tools/qa/cppunit/test_json_writer.cxx
@@ -58,7 +58,7 @@ void JsonWriterTest::test1()
std::unique_ptr<char, Free> result(aJson.extractData());
CPPUNIT_ASSERT_EQUAL(std::string("{ \"node\": { \"oustring\": \"val1\", \"ostring\": \"val2\", "
- "\"charptr\": \"val3\", \"int\": 12}}"),
+ "\"charptr\": \"val3\", \"int\": \"12\"}}"),
std::string(result.get()));
}
diff --git a/tools/source/misc/json_writer.cxx b/tools/source/misc/json_writer.cxx
index 9319db2799bc..839fbfd2eb47 100644
--- a/tools/source/misc/json_writer.cxx
+++ b/tools/source/misc/json_writer.cxx
@@ -318,7 +318,7 @@ void JsonWriter::put(const char* pPropName, int nPropVal)
memcpy(mPos, "\": ", 3);
mPos += 3;
- mPos += sprintf(mPos, "%d", nPropVal);
+ mPos += sprintf(mPos, "\"%d\"", nPropVal);
}
void JsonWriter::putRaw(const rtl::OStringBuffer& rRawBuf)