From b04d175b03ec22c00e149fd3a42041225b156760 Mon Sep 17 00:00:00 2001 From: Aditya Dewan Date: Sat, 15 Jul 2017 21:47:14 +0530 Subject: 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 Reviewed-by: pranavk --- desktop/source/lib/init.cxx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'desktop/source') 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 #include #include +#include #include #include #include @@ -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); -- cgit