summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.com>2016-06-21 20:23:13 +0530
committerPranav Kant <pranavk@collabora.com>2016-06-22 13:50:31 +0530
commit3f1c126f9f4da7113061565218f36ed878010ccd (patch)
tree89af56a3a2440325bc0a0014b5a70846c4e2bf92 /desktop
parent45c41f548500d794e925db062d527ee38e66557f (diff)
lok: Change version string to JSON format
(cherry-picked from d7b45c97b30f109aff0be6602a8fc8103af71e7f) Leaving out the lokdocview changes intentionally, because we don't need it, and too many merge conflicts. Change-Id: Ie1264fed9964b09006980df2e151e170b48b4082
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 06d1e4d04711..e88dce861f61 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1861,7 +1861,15 @@ static void lo_setDocumentPassword(LibreOfficeKit* pThis,
static char* lo_getVersionInfo(LibreOfficeKit* /*pThis*/)
{
- const OString sVersionStr = OUStringToOString(ReplaceStringHookProc("%PRODUCTNAME %PRODUCTVERSION %PRODUCTEXTENSION %BUILDID"), RTL_TEXTENCODING_UTF8);
+ const OUString sVersionStrTemplate(
+ "{ "
+ "\"ProductName\": \"%PRODUCTNAME\", "
+ "\"ProductVersion\": \"%PRODUCTVERSION\", "
+ "\"ProductExtension\": \"%PRODUCTEXTENSION\", "
+ "\"BuildId\": \"%BUILDID\" "
+ "}"
+ );
+ const OString sVersionStr = OUStringToOString(ReplaceStringHookProc(sVersionStrTemplate), RTL_TEXTENCODING_UTF8);
char* pVersion = static_cast<char*>(malloc(sVersionStr.getLength() + 1));
strcpy(pVersion, sVersionStr.getStr());