[Libreoffice-commits] core.git: 2 commits - desktop/source include/osl sal/osl sal/util
Tor Lillqvist
tml at collabora.com
Wed Apr 1 03:52:17 PDT 2015
desktop/source/app/officeipcthread.cxx | 15 +++++++-------
desktop/source/lib/init.cxx | 4 ++-
include/osl/lok.hxx | 34 +++++++++++++++++++++++++++++++++
sal/osl/all/utility.cxx | 20 ++++++++++++++++++-
sal/util/sal.map | 5 ++++
5 files changed, 69 insertions(+), 9 deletions(-)
New commits:
commit 4dde5a623d563f9007dd3539b835489a27128d65
Author: Tor Lillqvist <tml at collabora.com>
Date: Tue Mar 31 17:48:08 2015 +0300
Check osl::LibreOfficeKit::isActive(), not Application::IsConsoleOnly()
Console-only is really orthogonal to other things; it has one specific meaning
that is relevant on OS X only, see svapp.hxx. Let's not overload it for
LibreOfficeKit things.
Change-Id: I8b94c3a4e6f938ad70f1555a12dac8596819e031
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx
index aec9b3c..8c0ac21 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -26,6 +26,7 @@
#include "dispatchwatcher.hxx"
#include <boost/scoped_ptr.hpp>
#include <stdio.h>
+#include <osl/lok.hxx>
#include <osl/process.h>
#include <unotools/bootstrap.hxx>
#include <vcl/svapp.hxx>
@@ -460,13 +461,13 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread()
#ifndef ANDROID // On Android it might be that we still for some reason need the pipe?
- // When console-only (which includes in LibreOfficeKit-based programs) we want to be totally
- // independent from any other LibreOffice instance or LOKit-using program. Certainly no need for
- // any IPC pipes by definition, as we don't have any reason to do any IPC. Why we even call this
- // EnableOfficeIPCThread function from LibreOfficeKit's lo_initialize() I am not completely
- // sure, but that code, and this, is such horrible crack that I don't want to change it too much.
+ // In LibreOfficeKit-based programs we want to be totally independent from any other LibreOffice
+ // instance or LOKit-using program. Certainly no need for any IPC pipes by definition, as we
+ // don't have any reason to do any IPC. Why we even call this EnableOfficeIPCThread function
+ // from LibreOfficeKit's lo_initialize() I am not completely sure, but that code, and this, is
+ // such horrible crack that I don't want to change it too much.
- if (Application::IsConsoleOnly())
+ if (osl::LibreOfficeKit::isActive())
{
// Setting nPipeMode to PIPEMODE_CREATED causes the trivial path to be taken below, starting
// the listeing thread. (Which will immediately finish, see the execute() function, but what
@@ -706,7 +707,7 @@ void OfficeIPCThread::execute()
#if HAVE_FEATURE_DESKTOP || defined(ANDROID)
#ifndef ANDROID
- if (Application::IsConsoleOnly())
+ if (osl::LibreOfficeKit::isActive())
return;
#endif
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index f6aa90f..339e3fd 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -891,7 +891,6 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath)
desktop::Desktop::GetCommandLineArgs().setHeadless();
Application::EnableHeadlessMode(true);
- Application::EnableConsoleOnly();
// This is horrible crack. I really would want to go back to simply just call
// InitVCL() here. The OfficeIPCThread thing is just horrible.
commit 8955af9b2b3d29118d314c77092c5c4c0f8e456c
Author: Tor Lillqvist <tml at collabora.com>
Date: Sun Mar 29 22:59:22 2015 +0300
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
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index bdab485..f6aa90f 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -22,6 +22,7 @@
#include <tools/errinf.hxx>
#include <osl/file.hxx>
+#include <osl/lok.hxx>
#include <osl/process.h>
#include <osl/thread.h>
#include <rtl/strbuf.hxx>
@@ -852,6 +853,8 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath)
if (bInitialized)
return 1;
+ osl::LibreOfficeKit::setActive();
+
OUString aAppPath;
if (pAppPath)
{
diff --git a/include/osl/lok.hxx b/include/osl/lok.hxx
new file mode 100644
index 0000000..3b241ef
--- /dev/null
+++ b/include/osl/lok.hxx
@@ -0,0 +1,34 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_OSL_LOK_HXX
+#define INCLUDED_OSL_LOK_HXX
+
+#ifdef LIBO_INTERNAL_ONLY
+
+#include <sal/saldllapi.h>
+
+namespace osl
+{
+
+namespace LibreOfficeKit
+{
+
+SAL_DLLPUBLIC void setActive();
+
+SAL_DLLPUBLIC bool isActive();
+
+}
+}
+
+#endif // LIBO_INTERNAL_ONLY
+
+#endif // INCLUDED_OSL_LOK_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/osl/all/utility.cxx b/sal/osl/all/utility.cxx
index 98bc12f..a84111c 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 <osl/lok.hxx>
+#include <osl/time.h>
/*
* 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 2a87243..c8bcdba 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:
More information about the Libreoffice-commits
mailing list