summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-01-19 10:34:17 +0530
committerAndras Timar <andras.timar@collabora.com>2017-02-17 17:08:13 +0100
commit64ccf4c2576fa5ab902322ed681c8b5a1cbdc0d4 (patch)
tree2266d4a72b0e469f418fa13e2e24feae6fd65503 /desktop
parentbf08e991d4d0b6fcdda1e0d13d11b5c9abdffdea (diff)
lok: New commandvalues command - .uno:ViewAnnotations
Change-Id: I1c3560ab4609c64da7a77e9a65febeb569ec1a3c Reviewed-on: https://gerrit.libreoffice.org/33468 Reviewed-by: pranavk <pranavk@collabora.co.uk> Tested-by: pranavk <pranavk@collabora.co.uk> (cherry picked from commit a623b3a449dfcddaad5b621ff1c0b7a520edf4d6)
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index c7ee9afecac1..7492d1378c05 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1862,6 +1862,20 @@ static void doc_registerCallback(LibreOfficeKitDocument* pThis,
pViewShell->registerLibreOfficeKitViewCallback(CallbackFlushHandler::callback, pDocument->mpCallbackFlushHandlers[nView].get());
}
+/// Returns the JSON representation of all the comments in the document
+static char* getPostIts(LibreOfficeKitDocument* pThis)
+{
+ ITiledRenderable* pDoc = getTiledRenderable(pThis);
+ if (!pDoc)
+ {
+ gImpl->maLastExceptionMsg = "Document doesn't support tiled rendering";
+ return nullptr;
+ }
+ OUString aComments = pDoc->getPostIts();
+ return strdup(aComments.toUtf8().getStr());
+}
+
+
static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nType, int nCharCode, int nKeyCode)
{
SolarMutexGuard aGuard;
@@ -2412,6 +2426,7 @@ static char* getTrackedChanges(LibreOfficeKitDocument* pThis)
return pJson;
}
+
/// Returns the JSON representation of the redline author table.
static char* getTrackedChangeAuthors(LibreOfficeKitDocument* pThis)
{
@@ -2458,6 +2473,10 @@ static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCo
{
return getTrackedChangeAuthors(pThis);
}
+ else if (aCommand == ".uno:ViewAnnotations")
+ {
+ return getPostIts(pThis);
+ }
else if (aCommand.startsWith(aViewRowColumnHeaders))
{
ITiledRenderable* pDoc = getTiledRenderable(pThis);