diff options
author | Pranav Kant <pranavk@collabora.com> | 2016-06-21 00:15:38 +0530 |
---|---|---|
committer | Pranav Kant <pranavk@collabora.com> | 2016-06-22 13:49:50 +0530 |
commit | 45c41f548500d794e925db062d527ee38e66557f (patch) | |
tree | ab17054fcfe1a6addf4883017fc95eb89f9605c4 /desktop | |
parent | ac094c9fad665654c7049bef5565025efce93c47 (diff) |
lok: Expose LO version information
(cherry-picked from 90c75f775b6d1ca68389782a3768ee554b528e5d)
Leaving out lokdocview changes as we don't need it, and it
results in too many merge conflicts anyways.
Change-Id: Ided924e928c04385457c7a2e231fdf57e7e38970
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/lib/init.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 8caa01173f30..06d1e4d04711 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -82,6 +82,7 @@ #include <vcl/sysdata.hxx> #include <vcl/virdev.hxx> #include <vcl/ITiledRenderable.hxx> +#include <unotools/configmgr.hxx> #include <unotools/syslocaleoptions.hxx> #include <unotools/mediadescriptor.hxx> #include <osl/module.hxx> @@ -467,6 +468,7 @@ static void lo_setOptionalFeatures(LibreOfficeKit* pThis, uint64_t features); static void lo_setDocumentPassword(LibreOfficeKit* pThis, const char* pURL, const char* pPassword); +static char* lo_getVersionInfo(LibreOfficeKit* pThis); LibLibreOffice_Impl::LibLibreOffice_Impl() : maThread(0) @@ -487,6 +489,7 @@ LibLibreOffice_Impl::LibLibreOffice_Impl() m_pOfficeClass->getFilterTypes = lo_getFilterTypes; m_pOfficeClass->setOptionalFeatures = lo_setOptionalFeatures; m_pOfficeClass->setDocumentPassword = lo_setDocumentPassword; + m_pOfficeClass->getVersionInfo = lo_getVersionInfo; gOfficeClass = m_pOfficeClass; } @@ -1856,6 +1859,15 @@ static void lo_setDocumentPassword(LibreOfficeKit* pThis, pLib->mInteractionMap.find(OString(pURL))->second->SetPassword(pPassword); } +static char* lo_getVersionInfo(LibreOfficeKit* /*pThis*/) +{ + const OString sVersionStr = OUStringToOString(ReplaceStringHookProc("%PRODUCTNAME %PRODUCTVERSION %PRODUCTEXTENSION %BUILDID"), RTL_TEXTENCODING_UTF8); + + char* pVersion = static_cast<char*>(malloc(sVersionStr.getLength() + 1)); + strcpy(pVersion, sVersionStr.getStr()); + return pVersion; +} + static void force_c_locale() { // force locale (and resource files loaded) to en-US |