diff options
author | Henry Castro <hcastro@collabora.com> | 2020-12-25 12:55:49 -0400 |
---|---|---|
committer | Henry Castro <hcastro@collabora.com> | 2020-12-28 13:26:46 +0100 |
commit | 6002ff0354c95c3dffbf4f933833695f3f47b73b (patch) | |
tree | bd00c1c64ad128ad12bac1fd67a100cad1affd23 /tools | |
parent | 5a8c379642358f66a6e921e8da746d845ebcd7f6 (diff) |
tools: json: fix missing escaped chars
When client side tries to show the "Macro Security Warning"
message dialog, it fails to parse the JSON objects
Change-Id: Id73c291ddd9cf739d63d69f06094eacb7b43a2f1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108287
Tested-by: Jenkins
Reviewed-by: Henry Castro <hcastro@collabora.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/misc/json_writer.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/source/misc/json_writer.cxx b/tools/source/misc/json_writer.cxx index 1246f0578fca..a50e2ada967f 100644 --- a/tools/source/misc/json_writer.cxx +++ b/tools/source/misc/json_writer.cxx @@ -140,6 +140,27 @@ void JsonWriter::writeEscapedOUString(const OUString& rPropVal) *mPos = static_cast<char>(ch); ++mPos; } + else if (ch == '\n') + { + *mPos = '\\'; + ++mPos; + *mPos = 'n'; + ++mPos; + } + else if (ch == '\r') + { + *mPos = '\\'; + ++mPos; + *mPos = 'r'; + ++mPos; + } + else if (ch == '\f') + { + *mPos = '\\'; + ++mPos; + *mPos = 'f'; + ++mPos; + } else if (ch <= 0x7F) { *mPos = static_cast<char>(ch); |