diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-09-25 01:06:31 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-09-25 01:06:31 +0200 |
commit | 14a9a7d52074104afa24278a7a350f05d6df572a (patch) | |
tree | 78c839c59a552d7d484941261407b528ffe3173a /desktop | |
parent | 9b9f2ad9c819421c9f24bcbca98ee147f70d85b2 (diff) |
desktop: make LibLibreOffice_Impl visible to testcases
Change-Id: I345a6cab57cc594614e348700bb3c1c9a0673989
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/inc/lib/init.hxx | 12 | ||||
-rw-r--r-- | desktop/source/lib/init.cxx | 49 |
2 files changed, 31 insertions, 30 deletions
diff --git a/desktop/inc/lib/init.hxx b/desktop/inc/lib/init.hxx index 186964fdc777..da31adc27a50 100644 --- a/desktop/inc/lib/init.hxx +++ b/desktop/inc/lib/init.hxx @@ -15,6 +15,7 @@ #include <com/sun/star/lang/XComponent.hpp> #include <memory> #include "../../source/inc/desktopdllapi.h" +#include <osl/thread.h> namespace desktop { struct DESKTOP_DLLPUBLIC LibLODocument_Impl : public _LibreOfficeKitDocument @@ -25,6 +26,17 @@ namespace desktop { explicit LibLODocument_Impl(const css::uno::Reference <css::lang::XComponent> &xComponent); ~LibLODocument_Impl(); }; + + struct DESKTOP_DLLPUBLIC LibLibreOffice_Impl : public _LibreOfficeKit + { + OUString maLastExceptionMsg; + std::shared_ptr< LibreOfficeKitClass > m_pOfficeClass; + oslThread maThread; + LibreOfficeKitCallback mpCallback; + void *mpCallbackData; + + LibLibreOffice_Impl(); + }; } #endif diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 0616d3bada0d..b581bca5d011 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -85,8 +85,6 @@ using namespace vcl; using namespace desktop; using namespace utl; -struct LibLibreOffice_Impl; - static LibLibreOffice_Impl *gImpl = NULL; static std::weak_ptr< LibreOfficeKitClass > gOfficeClass; static std::weak_ptr< LibreOfficeKitDocumentClass > gDocumentClass; @@ -319,36 +317,27 @@ static void lo_registerCallback (LibreOfficeKit* pThis, void* pData); static char* lo_getFilterTypes(LibreOfficeKit* pThis); -struct LibLibreOffice_Impl : public _LibreOfficeKit +LibLibreOffice_Impl::LibLibreOffice_Impl() + : maThread(0) + , mpCallback(nullptr) + , mpCallbackData(nullptr) { - OUString maLastExceptionMsg; - std::shared_ptr< LibreOfficeKitClass > m_pOfficeClass; - oslThread maThread; - LibreOfficeKitCallback mpCallback; - void *mpCallbackData; - - LibLibreOffice_Impl() - : maThread(0) - , mpCallback(nullptr) - , mpCallbackData(nullptr) - { - if(!(m_pOfficeClass = gOfficeClass.lock())) { - m_pOfficeClass.reset(new LibreOfficeKitClass); - m_pOfficeClass->nSize = sizeof(LibreOfficeKitClass); - - m_pOfficeClass->destroy = lo_destroy; - m_pOfficeClass->documentLoad = lo_documentLoad; - m_pOfficeClass->getError = lo_getError; - m_pOfficeClass->documentLoadWithOptions = lo_documentLoadWithOptions; - m_pOfficeClass->registerCallback = lo_registerCallback; - m_pOfficeClass->getFilterTypes = lo_getFilterTypes; - - gOfficeClass = m_pOfficeClass; - } - - pClass = m_pOfficeClass.get(); + if(!(m_pOfficeClass = gOfficeClass.lock())) { + m_pOfficeClass.reset(new LibreOfficeKitClass); + m_pOfficeClass->nSize = sizeof(LibreOfficeKitClass); + + m_pOfficeClass->destroy = lo_destroy; + m_pOfficeClass->documentLoad = lo_documentLoad; + m_pOfficeClass->getError = lo_getError; + m_pOfficeClass->documentLoadWithOptions = lo_documentLoadWithOptions; + m_pOfficeClass->registerCallback = lo_registerCallback; + m_pOfficeClass->getFilterTypes = lo_getFilterTypes; + + gOfficeClass = m_pOfficeClass; } -}; + + pClass = m_pOfficeClass.get(); +} namespace { |