diff options
author | Aditya Dewan <iit2015097@iiita.ac.in> | 2017-07-15 21:47:14 +0530 |
---|---|---|
committer | pranavk <pranavk@collabora.co.uk> | 2017-08-17 13:10:30 +0200 |
commit | d64a7f4ba80fa2a0a0ad2bddc6906ab6b78a23c8 (patch) | |
tree | 8269f9ab235c5a4b31ede606bc64b0b474591102 /desktop/source | |
parent | ea43e0e3ceec30336273da0fb3d47c24073cffd2 (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/source')
-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 c713b4b3831a..fca53b297529 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -65,6 +65,7 @@ #include <svx/dialmgr.hxx> #include <svx/dialogs.hrc> #include <svx/strings.hrc> +#include <svx/ruler.hxx> #include <svx/svxids.hrc> #include <svx/ucsubset.hxx> #include <vcl/svapp.hxx> @@ -805,6 +806,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); }); } @@ -2044,6 +2046,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; @@ -2651,6 +2665,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); |