summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorPranam Lashkari <lpranam@collabora.com>2021-09-17 19:13:15 +0530
committerMiklos Vajna <vmiklos@collabora.com>2021-10-22 17:49:20 +0200
commitc4b934128965cbd461f1c61255fe0c5d25cc29d6 (patch)
tree04e4015769ed37bf876e3e7eec12bb863070cd97 /desktop
parentd05c69a892535b910943fe98fbce42f5cc860aa4 (diff)
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 <vmiklos@collabora.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx5
-rw-r--r--desktop/source/lib/init.cxx17
2 files changed, 5 insertions, 17 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 0fa5dc7ae6fe..cfa8e039a5d0 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -3459,12 +3459,11 @@ void DesktopLOKTest::testABI()
CPPUNIT_ASSERT_EQUAL(documentClassOffset(60), offsetof(struct _LibreOfficeKitDocumentClass, setWindowTextSelection));
CPPUNIT_ASSERT_EQUAL(documentClassOffset(61), offsetof(struct _LibreOfficeKitDocumentClass, sendFormFieldEvent));
CPPUNIT_ASSERT_EQUAL(documentClassOffset(62), offsetof(struct _LibreOfficeKitDocumentClass, setBlockedCommandList));
- CPPUNIT_ASSERT_EQUAL(documentClassOffset(63), offsetof(struct _LibreOfficeKitDocumentClass, setBlockedCommandView));
- CPPUNIT_ASSERT_EQUAL(documentClassOffset(64), offsetof(struct _LibreOfficeKitDocumentClass, renderSearchResult));
+ CPPUNIT_ASSERT_EQUAL(documentClassOffset(63), offsetof(struct _LibreOfficeKitDocumentClass, renderSearchResult));
// Extending is fine, update this, and add new assert for the offsetof the
// new method
- CPPUNIT_ASSERT_EQUAL(documentClassOffset(65), sizeof(struct _LibreOfficeKitDocumentClass));
+ CPPUNIT_ASSERT_EQUAL(documentClassOffset(64), sizeof(struct _LibreOfficeKitDocumentClass));
}
CPPUNIT_TEST_SUITE_REGISTRATION(DesktopLOKTest);
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 62aeabfadd67..4d6a93877e6f 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1071,12 +1071,8 @@ static void doc_postKeyEvent(LibreOfficeKitDocument* pThis,
int nCharCode,
int nKeyCode);
static void doc_setBlockedCommandList(LibreOfficeKitDocument* pThis,
- const char* bolckedCommandList);
-
-static void doc_setBlockedCommandView(LibreOfficeKitDocument* pThis,
int nViewId,
- const char* type,
- bool isBlocked);
+ const char* bolckedCommandList);
static void doc_postWindowExtTextInputEvent(LibreOfficeKitDocument* pThis,
unsigned nWindowId,
@@ -1369,7 +1365,6 @@ LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XCompone
m_pDocumentClass->renderSearchResult = doc_renderSearchResult;
m_pDocumentClass->setBlockedCommandList = doc_setBlockedCommandList;
- m_pDocumentClass->setBlockedCommandView = doc_setBlockedCommandView;
gDocumentClass = m_pDocumentClass;
}
@@ -3648,16 +3643,10 @@ static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nType, int nChar
}
}
-static void doc_setBlockedCommandList(LibreOfficeKitDocument* /*pThis*/, const char* bolckedCommandList)
-{
- comphelper::LibreOfficeKit::setBlockedCommandList(bolckedCommandList);
-}
-
-static void doc_setBlockedCommandView(LibreOfficeKitDocument* /*pThis*/, int nViewId, const char* type, bool isBlocked)
+static void doc_setBlockedCommandList(LibreOfficeKitDocument* /*pThis*/, int nViewId, const char* bolckedCommandList)
{
SolarMutexGuard aGuard;
- OUString aType(type, strlen(type), RTL_TEXTENCODING_UTF8);
- SfxLokHelper::setBlockedCommandView(nViewId, aType, isBlocked);
+ SfxLokHelper::setBlockedCommandList(nViewId, bolckedCommandList);
}
static void doc_postWindowExtTextInputEvent(LibreOfficeKitDocument* pThis, unsigned nWindowId, int nType, const char* pText)