summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2018-09-11 08:11:47 -0400
committerAshod Nakashian <ashnakash@gmail.com>2019-04-15 02:30:30 +0200
commit6597c9be98b5058c028e980cfc6681a7fd09147d (patch)
tree9a6f9156d913bed30cfdec18ad98a184a6d94831 /desktop
parent8286ce93454e39d5669a381cb1785392ad7e43f3 (diff)
slide-sorter: multiple selection
Change-Id: I8624de25b0bb66020002890f33758e52059a24ab Reviewed-on: https://gerrit.libreoffice.org/69610 Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx3
-rw-r--r--desktop/source/lib/init.cxx20
2 files changed, 22 insertions, 1 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 691a82bcc4cb..7fe2cc41f2a0 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -2668,9 +2668,10 @@ void DesktopLOKTest::testABI()
CPPUNIT_ASSERT_EQUAL(documentClassOffset(46), offsetof(struct _LibreOfficeKitDocumentClass, renderShapeSelection));
CPPUNIT_ASSERT_EQUAL(documentClassOffset(47), offsetof(struct _LibreOfficeKitDocumentClass, createViewWithOptions));
CPPUNIT_ASSERT_EQUAL(documentClassOffset(48), offsetof(struct _LibreOfficeKitDocumentClass, postWindowGestureEvent));
+ CPPUNIT_ASSERT_EQUAL(documentClassOffset(49), offsetof(struct _LibreOfficeKitDocumentClass, selectPart));
// Extending is fine, update this, and add new assert for the offsetof the
// new method
- CPPUNIT_ASSERT_EQUAL(documentClassOffset(49), sizeof(struct _LibreOfficeKitDocumentClass));
+ CPPUNIT_ASSERT_EQUAL(documentClassOffset(50), sizeof(struct _LibreOfficeKitDocumentClass));
}
CPPUNIT_TEST_SUITE_REGISTRATION(DesktopLOKTest);
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 1d21b994289d..c70b6d97dd29 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -683,6 +683,7 @@ static int doc_getParts(LibreOfficeKitDocument* pThis);
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 char* doc_getPartName(LibreOfficeKitDocument* pThis, int nPart);
static void doc_setPartMode(LibreOfficeKitDocument* pThis, int nPartMode);
static void doc_paintTile(LibreOfficeKitDocument* pThis,
@@ -833,6 +834,7 @@ LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XCompone
m_pDocumentClass->getPartPageRectangles = doc_getPartPageRectangles;
m_pDocumentClass->getPart = doc_getPart;
m_pDocumentClass->setPart = doc_setPart;
+ m_pDocumentClass->selectPart = doc_selectPart;
m_pDocumentClass->getPartName = doc_getPartName;
m_pDocumentClass->setPartMode = doc_setPartMode;
m_pDocumentClass->paintTile = doc_paintTile;
@@ -2247,6 +2249,22 @@ static char* doc_getPartInfo(LibreOfficeKitDocument* pThis, int nPart)
return pMemory;
}
+static void doc_selectPart(LibreOfficeKitDocument* pThis, int nPart, int nSelect)
+{
+ SolarMutexGuard aGuard;
+ if (gImpl)
+ gImpl->maLastExceptionMsg.clear();
+
+ ITiledRenderable* pDoc = getTiledRenderable(pThis);
+ if (!pDoc)
+ {
+ gImpl->maLastExceptionMsg = "Document doesn't support tiled rendering";
+ return;
+ }
+
+ pDoc->selectPart( nPart, nSelect );
+}
+
static char* doc_getPartPageRectangles(LibreOfficeKitDocument* pThis)
{
SolarMutexGuard aGuard;
@@ -2604,6 +2622,8 @@ static void doc_initializeForRendering(LibreOfficeKitDocument* pThis,
if (pDoc)
{
doc_iniUnoCommands();
+ // Create the SlideSorter which is used for multiselection and reordering.
+ doc_postUnoCommand(pThis, ".uno:LeftPaneImpress", nullptr, false);
pDoc->initializeForTiledRendering(
comphelper::containerToSequence(jsonToPropertyValuesVector(pArguments)));
}