summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-02-10 17:43:18 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-02-16 09:20:48 +0100
commit565a9f3fd8333e14497f058f9e4387e511aa36c9 (patch)
treefa1ecc90c51e5cfc7f479692c5b120bc0fe120bb /desktop
parent0135d5d5c2a41bc306062334db731b98438a6caf (diff)
LOK: add lok::Document::setTextSelection()
What's interesting about this is that it allows adjusting the position of both the point and mark of the selection, while the normal UI only allows adjusting the point. Change-Id: If61f57c68c28c67fec252f2b666a706f52dd8d26
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 5a5f609325e4..d7ca1438709b 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -207,6 +207,10 @@ static void doc_postMouseEvent (LibreOfficeKitDocument* pThis,
int nX,
int nY,
int nCount);
+static void doc_setTextSelection (LibreOfficeKitDocument* pThis,
+ int nType,
+ int nX,
+ int nY);
struct LibLODocument_Impl : public _LibreOfficeKitDocument
{
@@ -235,6 +239,7 @@ struct LibLODocument_Impl : public _LibreOfficeKitDocument
m_pDocumentClass->initializeForRendering = doc_initializeForRendering;
m_pDocumentClass->registerCallback = doc_registerCallback;
m_pDocumentClass->postMouseEvent = doc_postMouseEvent;
+ m_pDocumentClass->setTextSelection = doc_setTextSelection;
gDocumentClass = m_pDocumentClass;
}
@@ -673,6 +678,17 @@ static void doc_postMouseEvent(LibreOfficeKitDocument* pThis, int nType, int nX,
pDoc->postMouseEvent(nType, nX, nY, nCount);
}
+static void doc_setTextSelection(LibreOfficeKitDocument* pThis, int nType, int nX, int nY)
+{
+ ITiledRenderable* pDoc = getTiledRenderable(pThis);
+ if (!pDoc)
+ {
+ gImpl->maLastExceptionMsg = "Document doesn't support tiled rendering";
+ return;
+ }
+
+ pDoc->setTextSelection(nType, nX, nY);
+}
static char* lo_getError (LibreOfficeKit *pThis)
{