From 8955af9b2b3d29118d314c77092c5c4c0f8e456c Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sun, 29 Mar 2015 22:59:22 +0300 Subject: Add API to check whether being used through LibreOfficeKit LibreOffice code, when used in a program through LibreOfficeKit, needs to be aware of that in certain crucial spots, to avoid behaviour and functionality that makes no sense in a LibreOfficeKit scenario. As LibreOfficeKit uses a normal LibreOffice installation to perform its job, this can't be a compile-time choice. Also, none of the existing run-time "headlessness" modes fully match what is needed. Change-Id: Iaccf7f958c549f019b508854800519f54dcadb11 --- sal/osl/all/utility.cxx | 20 +++++++++++++++++++- sal/util/sal.map | 5 +++++ 2 files changed, 24 insertions(+), 1 deletion(-) (limited to 'sal') diff --git a/sal/osl/all/utility.cxx b/sal/osl/all/utility.cxx index 98bc12f47090..a84111ce7c36 100644 --- a/sal/osl/all/utility.cxx +++ b/sal/osl/all/utility.cxx @@ -17,7 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "osl/time.h" +#include +#include /* * mfe : maybe it would be wishful to include initialization @@ -45,5 +46,22 @@ public: static OGlobalTimer aGlobalTimer; +namespace LibreOfficeKit +{ + +static bool bActive(false); + +void setActive() +{ + bActive = true; } + +bool isActive() +{ + return bActive; +} + +} // namespace LibreOfficeKit +} // namespace osl + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/util/sal.map b/sal/util/sal.map index 2a87243e4813..c8bcdbab7699 100644 --- a/sal/util/sal.map +++ b/sal/util/sal.map @@ -713,6 +713,11 @@ PRIVATE_textenc.1 { # LibreOffice 3.6 _ZN3sal6detail7textenc37handleBadInputUnicodeToTextConversion*; }; +PRIVATE_4.5 { # LibreOffice 4.5 + _ZN3osl14LibreOfficeKit8isActive*; + _ZN3osl14LibreOfficeKit9setActive*; +}; + # Unique libstdc++ symbols: GLIBCXX_3.4 { global: -- cgit