summaryrefslogtreecommitdiff
path: root/desktop/source
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.com>2016-06-21 00:15:38 +0530
committerPranav Kant <pranavk@collabora.com>2016-06-21 14:35:59 +0530
commit90c75f775b6d1ca68389782a3768ee554b528e5d (patch)
tree2b5d59c8def159996243931e97a4415bd34dee7e /desktop/source
parent1811e656f08ba011a3c2a51cc60e90d2fa58e4c2 (diff)
lok: Expose LO version information
Change-Id: Ided924e928c04385457c7a2e231fdf57e7e38970
Diffstat (limited to 'desktop/source')
-rw-r--r--desktop/source/lib/init.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index a150535c9d53..2d30a3239e56 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -73,6 +73,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>
@@ -656,6 +657,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()
: m_pOfficeClass( gOfficeClass.lock() )
@@ -677,6 +679,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;
}
@@ -2002,6 +2005,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