diff options
author | Aditya Dewan <iit2015097@iiita.ac.in> | 2017-07-15 21:47:14 +0530 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2017-09-14 12:06:15 +0200 |
commit | b04d175b03ec22c00e149fd3a42041225b156760 (patch) | |
tree | 8d877e4a483648ec8be2187d588ebc32e8ea7665 /desktop | |
parent | 180dec34838389b17ed9d0d3d17fd19a6e5a9c71 (diff) |
implementing callback for ruler invalidation
adding commands to fetch and changee ruler state
'.uno:RulerState' and '.uno:RulerStateChange'
Change-Id: I66107039a7ae5893691feb45c8ab2e4aa476ea76
Reviewed-on: https://gerrit.libreoffice.org/40727
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/lib/init.cxx | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 4e7f9210a83e..b0499399b97b 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -66,6 +66,7 @@ #include <sfx2/viewsh.hxx> #include <svx/dialmgr.hxx> #include <svx/dialogs.hrc> +#include <svx/ruler.hxx> #include <svx/svxids.hrc> #include <svx/ucsubset.hxx> #include <vcl/svapp.hxx> @@ -830,6 +831,7 @@ void CallbackFlushHandler::queue(const int type, const char* data) case LOK_CALLBACK_CURSOR_VISIBLE: case LOK_CALLBACK_SET_PART: case LOK_CALLBACK_STATUS_INDICATOR_SET_VALUE: + case LOK_CALLBACK_RULER_UPDATE: { removeAll([type] (const queue_type::value_type& elem) { return (elem.first == type); }); } @@ -2071,6 +2073,18 @@ static char* getPostItsPos(LibreOfficeKitDocument* pThis) return strdup(aComments.toUtf8().getStr()); } +static char* getRulerState(LibreOfficeKitDocument* pThis) +{ + ITiledRenderable* pDoc = getTiledRenderable(pThis); + if (!pDoc) + { + gImpl->maLastExceptionMsg = "Document doesn't support tiled rendering"; + return nullptr; + } + OUString state = pDoc->getRulerState(); + return strdup(state.toUtf8().getStr()); +} + static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nType, int nCharCode, int nKeyCode) { SolarMutexGuard aGuard; @@ -2678,6 +2692,10 @@ static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCo { return getPostItsPos(pThis); } + else if (aCommand == ".uno:RulerState") + { + return getRulerState(pThis); + } else if (aCommand.startsWith(aViewRowColumnHeaders)) { ITiledRenderable* pDoc = getTiledRenderable(pThis); |