diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-09-15 09:31:49 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-09-21 07:30:14 +0200 |
commit | 10a0cad9d6990abac507899a34fbcdeb466187f7 (patch) | |
tree | fc7e4aacd8d98ba29e80bc31498126165a87df64 /desktop | |
parent | 4f62c14748c0e62ad0212e831d606ac32e694eca (diff) |
lok::Document: add destroyView()
Change-Id: Id9e92593217541b4123e95279019cec3c958056c
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/qa/desktop_lib/test_desktop_lib.cxx | 5 | ||||
-rw-r--r-- | desktop/source/lib/init.cxx | 9 |
2 files changed, 13 insertions, 1 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index 8642f4491f9f..6baaa32239c9 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -136,8 +136,11 @@ void DesktopLOKTest::testCreateView() LibLODocument_Impl* pDocument = loadDoc("blank_text.odt"); CPPUNIT_ASSERT_EQUAL(1, SfxLokHelper::getViews()); - pDocument->m_pDocumentClass->createView(pDocument); + int nId = pDocument->m_pDocumentClass->createView(pDocument); CPPUNIT_ASSERT_EQUAL(2, SfxLokHelper::getViews()); + + pDocument->m_pDocumentClass->destroyView(pDocument, nId); + CPPUNIT_ASSERT_EQUAL(1, SfxLokHelper::getViews()); closeDoc(); } diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 95213017726f..15ab2e7ffa50 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -248,6 +248,7 @@ static void doc_resetSelection (LibreOfficeKitDocument* pThis); static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCommand); static int doc_createView(LibreOfficeKitDocument* pThis); +static void doc_destroyView(LibreOfficeKitDocument* pThis, int nId); LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XComponent> &xComponent) : mxComponent( xComponent ) @@ -280,6 +281,7 @@ LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XCompone m_pDocumentClass->getCommandValues = doc_getCommandValues; m_pDocumentClass->createView = doc_createView; + m_pDocumentClass->destroyView = doc_destroyView; gDocumentClass = m_pDocumentClass; } @@ -1055,6 +1057,13 @@ static int doc_createView(LibreOfficeKitDocument* pThis) return SfxLokHelper::createView(pViewShell); } +static void doc_destroyView(LibreOfficeKitDocument* /*pThis*/, int nId) +{ + SolarMutexGuard aGuard; + + SfxLokHelper::destroyView(nId); +} + static char* lo_getError (LibreOfficeKit *pThis) { LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(pThis); |