diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-01-19 10:34:17 +0530 |
---|---|---|
committer | pranavk <pranavk@collabora.co.uk> | 2017-01-27 11:49:01 +0000 |
commit | a623b3a449dfcddaad5b621ff1c0b7a520edf4d6 (patch) | |
tree | ffd18a62765fc12e9f85948b1b6fb2cbe0c5e1c3 /desktop | |
parent | 6b977d5a24d5db80c59440a3358c629959d7cf86 (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>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/lib/init.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 4d2dc02a6a0a..2403ff6c8f27 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1867,6 +1867,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; @@ -2416,6 +2430,7 @@ static char* getTrackedChanges(LibreOfficeKitDocument* pThis) return pJson; } + /// Returns the JSON representation of the redline author table. static char* getTrackedChangeAuthors(LibreOfficeKitDocument* pThis) { @@ -2462,6 +2477,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); |