diff options
author | Mihai Varga <mihai.varga@collabora.com> | 2015-09-09 15:08:26 +0300 |
---|---|---|
committer | Mihai Varga <mihai.varga@collabora.com> | 2015-09-09 18:02:10 +0300 |
commit | 2290efa4a22d42cd9099b63b9138e4ff994c07f9 (patch) | |
tree | 421a915212dc86349f69196ba88fa1ddaa100359 /desktop/source | |
parent | 98483599b76fe6d0113a657f057ff5ad799ade96 (diff) |
LOK: moved the decalaration of LibLODocument_Impl to make it visible
We needed a better way to test LOK methods that are not app specific,
but are defined in /desktop/source/lib/init.cxx. So the decalaration
needs to be visible.
I also moved the `getStyles` test in the new test file
Change-Id: I98d97dc17a66e72732ca7bd848c131610790f48e
Diffstat (limited to 'desktop/source')
-rw-r--r-- | desktop/source/lib/init.cxx | 79 |
1 files changed, 37 insertions, 42 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index c7f3aabb58b7..a20decd3afbe 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -64,6 +64,7 @@ // We also need to hackily be able to start the main libreoffice thread: #include "../app/sofficemain.h" #include "../app/officeipcthread.hxx" +#include "../../inc/lib/init.hxx" using namespace css; using namespace vcl; @@ -72,7 +73,6 @@ using namespace utl; using namespace boost; -struct LibLODocument_Impl; struct LibLibreOffice_Impl; static LibLibreOffice_Impl *gImpl = NULL; @@ -237,51 +237,46 @@ static void doc_setGraphicSelection (LibreOfficeKitDocument* pThis, static void doc_resetSelection (LibreOfficeKitDocument* pThis); static char* doc_getStyles(LibreOfficeKitDocument* pThis); -struct LibLODocument_Impl : public _LibreOfficeKitDocument -{ - uno::Reference<css::lang::XComponent> mxComponent; - shared_ptr< LibreOfficeKitDocumentClass > m_pDocumentClass; - explicit LibLODocument_Impl(const uno::Reference <css::lang::XComponent> &xComponent) : - mxComponent( xComponent ) +LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XComponent> &xComponent) : + mxComponent( xComponent ) +{ + if (!(m_pDocumentClass = gDocumentClass.lock())) { - if (!(m_pDocumentClass = gDocumentClass.lock())) - { - m_pDocumentClass.reset(new LibreOfficeKitDocumentClass); - - m_pDocumentClass->nSize = sizeof(LibreOfficeKitDocument); - - m_pDocumentClass->destroy = doc_destroy; - m_pDocumentClass->saveAs = doc_saveAs; - m_pDocumentClass->getDocumentType = doc_getDocumentType; - m_pDocumentClass->getParts = doc_getParts; - m_pDocumentClass->getPart = doc_getPart; - m_pDocumentClass->setPart = doc_setPart; - m_pDocumentClass->getPartName = doc_getPartName; - m_pDocumentClass->setPartMode = doc_setPartMode; - m_pDocumentClass->paintTile = doc_paintTile; - m_pDocumentClass->getDocumentSize = doc_getDocumentSize; - m_pDocumentClass->initializeForRendering = doc_initializeForRendering; - m_pDocumentClass->registerCallback = doc_registerCallback; - m_pDocumentClass->postKeyEvent = doc_postKeyEvent; - m_pDocumentClass->postMouseEvent = doc_postMouseEvent; - m_pDocumentClass->postUnoCommand = doc_postUnoCommand; - m_pDocumentClass->setTextSelection = doc_setTextSelection; - m_pDocumentClass->getTextSelection = doc_getTextSelection; - m_pDocumentClass->setGraphicSelection = doc_setGraphicSelection; - m_pDocumentClass->resetSelection = doc_resetSelection; - m_pDocumentClass->getStyles = doc_getStyles; - - gDocumentClass = m_pDocumentClass; - } - pClass = m_pDocumentClass.get(); + m_pDocumentClass.reset(new LibreOfficeKitDocumentClass); + + m_pDocumentClass->nSize = sizeof(LibreOfficeKitDocument); + + m_pDocumentClass->destroy = doc_destroy; + m_pDocumentClass->saveAs = doc_saveAs; + m_pDocumentClass->getDocumentType = doc_getDocumentType; + m_pDocumentClass->getParts = doc_getParts; + m_pDocumentClass->getPart = doc_getPart; + m_pDocumentClass->setPart = doc_setPart; + m_pDocumentClass->getPartName = doc_getPartName; + m_pDocumentClass->setPartMode = doc_setPartMode; + m_pDocumentClass->paintTile = doc_paintTile; + m_pDocumentClass->getDocumentSize = doc_getDocumentSize; + m_pDocumentClass->initializeForRendering = doc_initializeForRendering; + m_pDocumentClass->registerCallback = doc_registerCallback; + m_pDocumentClass->postKeyEvent = doc_postKeyEvent; + m_pDocumentClass->postMouseEvent = doc_postMouseEvent; + m_pDocumentClass->postUnoCommand = doc_postUnoCommand; + m_pDocumentClass->setTextSelection = doc_setTextSelection; + m_pDocumentClass->getTextSelection = doc_getTextSelection; + m_pDocumentClass->setGraphicSelection = doc_setGraphicSelection; + m_pDocumentClass->resetSelection = doc_resetSelection; + m_pDocumentClass->getStyles = doc_getStyles; + + gDocumentClass = m_pDocumentClass; } + pClass = m_pDocumentClass.get(); +} - ~LibLODocument_Impl() - { - mxComponent->dispose(); - } -}; +LibLODocument_Impl::~LibLODocument_Impl() +{ + mxComponent->dispose(); +} static void doc_destroy(LibreOfficeKitDocument *pThis) { |