From c4b934128965cbd461f1c61255fe0c5d25cc29d6 Mon Sep 17 00:00:00 2001 From: Pranam Lashkari Date: Fri, 17 Sep 2021 19:13:15 +0530 Subject: LOK: maintain blocked command list per view Conflicts: include/LibreOfficeKit/LibreOfficeKitEnums.h include/sfx2/viewsh.hxx libreofficekit/source/gtk/lokdocview.cxx sfx2/source/view/viewsh.cxx Change-Id: I7c621accd84f49447ab3e08a4bb662a9b91b834a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124049 Tested-by: Jenkins Reviewed-by: Miklos Vajna --- include/LibreOfficeKit/LibreOfficeKit.h | 7 +------ include/LibreOfficeKit/LibreOfficeKit.hxx | 9 ++------- include/LibreOfficeKit/LibreOfficeKitEnums.h | 9 ++++++++- 3 files changed, 11 insertions(+), 14 deletions(-) (limited to 'include/LibreOfficeKit') diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h index 72beeb613246..29ffeff44bbb 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.h +++ b/include/LibreOfficeKit/LibreOfficeKit.h @@ -460,14 +460,9 @@ struct _LibreOfficeKitDocumentClass /// @see lok::Document::setBlockedCommandList void (*setBlockedCommandList) (LibreOfficeKitDocument* pThis, + int nViewId, const char* bolckedCommandList); - /// @see lok::Document::setBlockedCommandView - void (*setBlockedCommandView) (LibreOfficeKitDocument* pThis, - int nViewId, - const char* type, - bool isBlocked); - /// @see lok::Document::renderSearchResult bool (*renderSearchResult) (LibreOfficeKitDocument* pThis, const char* pSearchResult, diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx index 114438445350..bde89ec4240c 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -787,14 +787,9 @@ public: mpDoc->pClass->sendFormFieldEvent(mpDoc, pArguments); } - void setBlockedCommandList(const char* bolckedCommandList) + void setBlockedCommandList(int nViewId, const char* bolckedCommandList) { - mpDoc->pClass->setBlockedCommandList(mpDoc, bolckedCommandList); - } - - void setBlockedCommandView(int nViewId, const char* type, bool isBlocked) - { - mpDoc->pClass->setBlockedCommandView(mpDoc, nViewId, type, isBlocked); + mpDoc->pClass->setBlockedCommandList(mpDoc, nViewId, bolckedCommandList); } /** * Render input search result to a bitmap buffer. diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h index 497a5eacc804..006713447aed 100644 --- a/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -779,6 +779,11 @@ typedef enum */ LOK_CALLBACK_DOCUMENT_BACKGROUND_COLOR = 52, + /** + * When a user tries to use command which is restricted for that user + */ + LOK_COMMAND_BLOCKED = 53, + /** * The position of the cell cursor jumped to. * @@ -789,7 +794,7 @@ typedef enum * * Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES. */ - LOK_CALLBACK_SC_FOLLOW_JUMP = 53, + LOK_CALLBACK_SC_FOLLOW_JUMP = 54, } LibreOfficeKitCallbackType; @@ -924,6 +929,8 @@ static inline const char* lokCallbackTypeToString(int nType) return "LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY"; case LOK_CALLBACK_DOCUMENT_BACKGROUND_COLOR: return "LOK_CALLBACK_DOCUMENT_BACKGROUND_COLOR"; + case LOK_COMMAND_BLOCKED: + return "LOK_COMMAND_BLOCKED"; case LOK_CALLBACK_SC_FOLLOW_JUMP: return "LOK_CALLBACK_SC_FOLLOW_JUMP"; } -- cgit