Kaydet (Commit) 13fced38 authored tarafından Andrzej Hunt's avatar Andrzej Hunt Kaydeden (comit) Tomaž Vajngerl

Hack soffice_main into LOK.

Change-Id: I86e13192ddb5904afabca38d3a201f17f145de09
üst 68a859f3
...@@ -17,6 +17,13 @@ $(eval $(call gb_Library_set_include,sofficeapp,\ ...@@ -17,6 +17,13 @@ $(eval $(call gb_Library_set_include,sofficeapp,\
-I$(SRCDIR)/vcl/inc \ -I$(SRCDIR)/vcl/inc \
)) ))
$(eval $(call gb_Library_add_libs,sofficeapp,\
$(if $(filter $(OS),LINUX), \
-ldl \
-lpthread \
) \
))
$(eval $(call gb_Library_use_external,sofficeapp,boost_headers)) $(eval $(call gb_Library_use_external,sofficeapp,boost_headers))
$(eval $(call gb_Library_use_custom_headers,sofficeapp,\ $(eval $(call gb_Library_use_custom_headers,sofficeapp,\
...@@ -47,6 +54,7 @@ $(eval $(call gb_Library_use_libraries,sofficeapp,\ ...@@ -47,6 +54,7 @@ $(eval $(call gb_Library_use_libraries,sofficeapp,\
sfx \ sfx \
svl \ svl \
svt \ svt \
sw \
tk \ tk \
tl \ tl \
ucbhelper \ ucbhelper \
......
...@@ -59,6 +59,9 @@ ...@@ -59,6 +59,9 @@
#include <basebmp/bitmapdevice.hxx> #include <basebmp/bitmapdevice.hxx>
#endif #endif
// We also need to hackily be able to start the main libreoffice thread
#include "../app/sofficemain.h"
using namespace css; using namespace css;
using namespace vcl; using namespace vcl;
using namespace utl; using namespace utl;
...@@ -638,6 +641,12 @@ static void initialize_uno(const OUString &aAppProgramURL) ...@@ -638,6 +641,12 @@ static void initialize_uno(const OUString &aAppProgramURL)
// configmgr setup ? // configmgr setup ?
} }
static void* lo_startmain(void*)
{
soffice_main();
return 0;
}
static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath) static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath)
{ {
(void) pThis; (void) pThis;
...@@ -670,8 +679,27 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath) ...@@ -670,8 +679,27 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath)
force_c_locale(); force_c_locale();
// Force headless // Force headless
// the "svp" headless vcl backend isn't able to do tiled rendering for
// us -- we need to use a full featured backend, i.e. "gen" or "gtk",
// gtk seems to be somewhat better.
rtl::Bootstrap::set("SAL_USE_VCLPLUGIN", "svp"); rtl::Bootstrap::set("SAL_USE_VCLPLUGIN", "svp");
InitVCL(); // InitVCL();
// InitVCL() happens in soffice_main for us -- and we can't call InitVCL twice
// unfortunately -- which is annoying since (see below)
pthread_t thread;
pthread_create(&thread, 0, lo_startmain, NULL);
sleep(10);
// We'll segfault trying to access Application if we're too fast...
// Specifically pImplSVData doesn't exist until InitVCL has been called,
// and that won't be immediate, but we can't call InitVCL ourselves
// as soffice_main already does so, but InitVCL would then fail
// within soffice_main if we have already called it earlier.
//
// And there's also a chance of deadlock if we try to open documents
// too early -- when running in a debugger we therefore need quite
// a large delay here (for now).
Application::EnableHeadlessMode(true); Application::EnableHeadlessMode(true);
ErrorHandler::RegisterDisplay(aBasicErrorFunc); ErrorHandler::RegisterDisplay(aBasicErrorFunc);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment