diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2018-09-16 17:27:35 -0400 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2019-07-17 09:46:17 +0200 |
commit | 0e82806ed6841c0a6919f97660ed4622c89d2338 (patch) | |
tree | edd896de21e911fd93414a0ec8b96dcc06f50e0b /desktop | |
parent | 0d280f7092c2c309d712d238ae37efd0b4bb84a9 (diff) |
LOK: support for ordering/moving parts
Currently reordering of slides is only supported
for presentations, although it is provisioned for
spreadsheets as well.
Change-Id: I6c35066d6a5ef7586d34a8e8b89db69a20b86572
Reviewed-on: https://gerrit.libreoffice.org/69612
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/73495
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky <kendy@collabora.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 | 18 |
2 files changed, 20 insertions, 1 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index 75b9143e4417..a3db0fd57b1f 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -2716,9 +2716,10 @@ void DesktopLOKTest::testABI() CPPUNIT_ASSERT_EQUAL(documentClassOffset(47), offsetof(struct _LibreOfficeKitDocumentClass, postWindowGestureEvent)); CPPUNIT_ASSERT_EQUAL(documentClassOffset(48), offsetof(struct _LibreOfficeKitDocumentClass, createViewWithOptions)); CPPUNIT_ASSERT_EQUAL(documentClassOffset(49), offsetof(struct _LibreOfficeKitDocumentClass, selectPart)); + CPPUNIT_ASSERT_EQUAL(documentClassOffset(50), offsetof(struct _LibreOfficeKitDocumentClass, moveSelectedParts)); // Extending is fine, update this, and add new assert for the offsetof the // new method - CPPUNIT_ASSERT_EQUAL(documentClassOffset(50), sizeof(struct _LibreOfficeKitDocumentClass)); + CPPUNIT_ASSERT_EQUAL(documentClassOffset(51), sizeof(struct _LibreOfficeKitDocumentClass)); } CPPUNIT_TEST_SUITE_REGISTRATION(DesktopLOKTest); diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index c8ec63210664..f48f9846d063 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -711,6 +711,7 @@ static char* doc_getPartPageRectangles(LibreOfficeKitDocument* pThis); static int doc_getPart(LibreOfficeKitDocument* pThis); static void doc_setPart(LibreOfficeKitDocument* pThis, int nPart); static void doc_selectPart(LibreOfficeKitDocument* pThis, int nPart, int nSelect); +static void doc_moveSelectedParts(LibreOfficeKitDocument* pThis, int nPosition, bool bDuplicate); static char* doc_getPartName(LibreOfficeKitDocument* pThis, int nPart); static void doc_setPartMode(LibreOfficeKitDocument* pThis, int nPartMode); static void doc_paintTile(LibreOfficeKitDocument* pThis, @@ -862,6 +863,7 @@ LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XCompone m_pDocumentClass->getPart = doc_getPart; m_pDocumentClass->setPart = doc_setPart; m_pDocumentClass->selectPart = doc_selectPart; + m_pDocumentClass->moveSelectedParts = doc_moveSelectedParts; m_pDocumentClass->getPartName = doc_getPartName; m_pDocumentClass->setPartMode = doc_setPartMode; m_pDocumentClass->paintTile = doc_paintTile; @@ -2358,6 +2360,22 @@ static void doc_selectPart(LibreOfficeKitDocument* pThis, int nPart, int nSelect pDoc->selectPart( nPart, nSelect ); } +static void doc_moveSelectedParts(LibreOfficeKitDocument* pThis, int nPosition, bool bDuplicate) +{ + SolarMutexGuard aGuard; + if (gImpl) + gImpl->maLastExceptionMsg.clear(); + + ITiledRenderable* pDoc = getTiledRenderable(pThis); + if (!pDoc) + { + gImpl->maLastExceptionMsg = "Document doesn't support tiled rendering"; + return; + } + + pDoc->moveSelectedParts(nPosition, bDuplicate); +} + static char* doc_getPartPageRectangles(LibreOfficeKitDocument* pThis) { comphelper::ProfileZone aZone("doc_getPartPageRectangles"); |