diff options
author | Marco Cecchetti <marco.cecchetti@collabora.com> | 2018-02-01 12:17:45 +0100 |
---|---|---|
committer | Marco Cecchetti <mrcekets@gmail.com> | 2018-04-03 21:39:05 +0200 |
commit | 8ffbb86b30e2c1674ba32e9e29447cbea3585d03 (patch) | |
tree | 96119c2f2bad71aa7d39f75774a4a7719e70baae /desktop | |
parent | 866112dba79b677dfefd35f19933c5aa3f338967 (diff) |
lok - calc: add support for show/hide tabs in online
Change-Id: Ibd061414a0c3a5fad83d03f7047831cef62076d2
Reviewed-on: https://gerrit.libreoffice.org/49083
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/qa/desktop_lib/test_desktop_lib.cxx | 3 | ||||
-rw-r--r-- | desktop/source/lib/init.cxx | 22 |
2 files changed, 24 insertions, 1 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index 0714b6804ca0..51e048d04af4 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -2298,10 +2298,11 @@ void DesktopLOKTest::testABI() CPPUNIT_ASSERT_EQUAL(documentClassOffset(38), offsetof(struct _LibreOfficeKitDocumentClass, postWindowMouseEvent)); CPPUNIT_ASSERT_EQUAL(documentClassOffset(39), offsetof(struct _LibreOfficeKitDocumentClass, setViewLanguage)); CPPUNIT_ASSERT_EQUAL(documentClassOffset(40), offsetof(struct _LibreOfficeKitDocumentClass, postWindowExtTextInputEvent)); + CPPUNIT_ASSERT_EQUAL(documentClassOffset(41), offsetof(struct _LibreOfficeKitDocumentClass, getPartInfo)); // Extending is fine, update this, and add new assert for the offsetof the // new method - CPPUNIT_ASSERT_EQUAL(documentClassOffset(41), sizeof(struct _LibreOfficeKitDocumentClass)); + CPPUNIT_ASSERT_EQUAL(documentClassOffset(42), sizeof(struct _LibreOfficeKitDocumentClass)); } CPPUNIT_TEST_SUITE_REGISTRATION(DesktopLOKTest); diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 5959f4237738..67beb36d3a56 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -579,6 +579,8 @@ static void doc_paintWindow(LibreOfficeKitDocument* pThis, unsigned nLOKWindowId static void doc_postWindow(LibreOfficeKitDocument* pThis, unsigned nLOKWindowId, int nAction); +static char* doc_getPartInfo(LibreOfficeKitDocument* pThis, int nPart); + LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XComponent> &xComponent) : mxComponent(xComponent) { @@ -634,6 +636,8 @@ LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XCompone m_pDocumentClass->setViewLanguage = doc_setViewLanguage; + m_pDocumentClass->getPartInfo = doc_getPartInfo; + gDocumentClass = m_pDocumentClass; } pClass = m_pDocumentClass.get(); @@ -1856,6 +1860,24 @@ static void doc_setPart(LibreOfficeKitDocument* pThis, int nPart) pDoc->setPart( nPart ); } +static char* doc_getPartInfo(LibreOfficeKitDocument* pThis, int nPart) +{ + SolarMutexGuard aGuard; + ITiledRenderable* pDoc = getTiledRenderable(pThis); + if (!pDoc) + { + gImpl->maLastExceptionMsg = "Document doesn't support tiled rendering"; + return nullptr; + } + + OUString aPartInfo = pDoc->getPartInfo( nPart ); + OString aString = OUStringToOString(aPartInfo, RTL_TEXTENCODING_UTF8); + + char* pMemory = static_cast<char*>(malloc(aString.getLength() + 1)); + strcpy(pMemory, aString.getStr()); + return pMemory; +} + static char* doc_getPartPageRectangles(LibreOfficeKitDocument* pThis) { SolarMutexGuard aGuard; |