From 565a9f3fd8333e14497f058f9e4387e511aa36c9 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 10 Feb 2015 17:43:18 +0100 Subject: 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 --- desktop/source/lib/init.cxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'desktop') 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) { -- cgit