diff options
-rw-r--r-- | desktop/source/lib/init.cxx | 10 | ||||
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.hxx | 9 | ||||
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKitGtk.h | 11 |
3 files changed, 22 insertions, 8 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 346396d1a1a1..74bcc6f983ce 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1828,7 +1828,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()); diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx index f72db87ef383..fed0acc3e7e0 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -546,10 +546,13 @@ public: /** * Get version information of the LOKit process * - * @returns string containing version information in format: - * PRODUCT_NAME PRODUCT_VERSION PRODUCT_EXTENSION BUILD_ID + * @returns JSON string containing version information in format: + * {ProductName: <>, ProductVersion: <>, ProductExtension: <>, BuildId: <>} * - * Eg: LibreOffice 5.3 .0.0 alpha0 <commit hash> + * Eg: {"ProductName": "LibreOffice", + * "ProductVersion": "5.3", + * "ProductExtension": ".0.0.alpha0", + * "BuildId": "<full 40 char git hash>"} */ inline char* getVersionInfo() { diff --git a/include/LibreOfficeKit/LibreOfficeKitGtk.h b/include/LibreOfficeKit/LibreOfficeKitGtk.h index f6d087564fff..8202204f3ac6 100644 --- a/include/LibreOfficeKit/LibreOfficeKitGtk.h +++ b/include/LibreOfficeKit/LibreOfficeKitGtk.h @@ -307,12 +307,15 @@ void lok_doc_view_set_document_password (LOKDocView* * lok_doc_view_get_version_info: * @pDocView: The #LOKDocView instance * - * Get version information of underlying LOKit process + * Get version information of the LOKit process * - * Returns: string containing version information in format - * PRODUCT_NAME PRODUCT_VERSION PRODUCT_EXTENSION BUILD_ID + * Returns: JSON string containing version information in format: + * {ProductName: <>, ProductVersion: <>, ProductExtension: <>, BuildId: <>} * - * Eg: LibreOffice 5.3 .0.0.alpha0 <commit hash> + * Eg: {"ProductName": "LibreOffice", + * "ProductVersion": "5.3", + * "ProductExtension": ".0.0.alpha0", + * "BuildId": "<full 40 char git hash>"} */ gchar* lok_doc_view_get_version_info (LOKDocView* pDocView); |