diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-02-23 10:01:50 +0000 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-02-27 09:25:23 +0100 |
commit | d5fbbc750ca96f0541e7bd81dd0657fac53803db (patch) | |
tree | 8ced649a12a7081e9d9df14cac19ace05d10be9f /desktop | |
parent | a9386139613735c45765a540ce8fac98f5639d49 (diff) |
use getCommandValues instead of adding a getViewRenderState
Change-Id: Ib6db5dd8ef1db2745cb3c616bb81b1ac2baf6504
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163812
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163931
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/qa/desktop_lib/test_desktop_lib.cxx | 5 | ||||
-rw-r--r-- | desktop/source/lib/init.cxx | 17 |
2 files changed, 6 insertions, 16 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index 2457771c384c..c9f276a67eeb 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -3681,13 +3681,12 @@ void DesktopLOKTest::testABI() offsetof(struct _LibreOfficeKitDocumentClass, getA11yFocusedParagraph)); CPPUNIT_ASSERT_EQUAL(documentClassOffset(71), offsetof(struct _LibreOfficeKitDocumentClass, getA11yCaretPosition)); + CPPUNIT_ASSERT_EQUAL(documentClassOffset(72), offsetof(struct _LibreOfficeKitDocumentClass, hyperlinkInfoAtPosition)); - CPPUNIT_ASSERT_EQUAL(documentClassOffset(73), - offsetof(struct _LibreOfficeKitDocumentClass, getViewRenderState)); // As above - CPPUNIT_ASSERT_EQUAL(documentClassOffset(74), sizeof(struct _LibreOfficeKitDocumentClass)); + CPPUNIT_ASSERT_EQUAL(documentClassOffset(73), sizeof(struct _LibreOfficeKitDocumentClass)); } CPPUNIT_TEST_SUITE_REGISTRATION(DesktopLOKTest); diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 83a547d3e211..93efef57d138 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1299,8 +1299,6 @@ static void doc_setAccessibilityState(LibreOfficeKitDocument* pThis, int nId, bo static char* doc_getA11yFocusedParagraph(LibreOfficeKitDocument* pThis); static int doc_getA11yCaretPosition(LibreOfficeKitDocument* pThis); - -static char* doc_getViewRenderState(LibreOfficeKitDocument* pThis); } // extern "C" namespace { @@ -1495,8 +1493,6 @@ LibLODocument_Impl::LibLODocument_Impl(uno::Reference <css::lang::XComponent> xC m_pDocumentClass->getA11yFocusedParagraph = doc_getA11yFocusedParagraph; m_pDocumentClass->getA11yCaretPosition = doc_getA11yCaretPosition; - m_pDocumentClass->getViewRenderState = doc_getViewRenderState; - gDocumentClass = m_pDocumentClass; } pClass = m_pDocumentClass.get(); @@ -4921,15 +4917,6 @@ static size_t doc_renderShapeSelection(LibreOfficeKitDocument* pThis, char** pOu return 0; } -static char* doc_getViewRenderState(LibreOfficeKitDocument* pThis) -{ - ITiledRenderable* pDoc = getTiledRenderable(pThis); - if (!pDoc) - return nullptr; - - return convertOString(pDoc->getViewRenderState()); -} - namespace { /** Class to react on finishing of a dispatched command. @@ -6386,6 +6373,10 @@ static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCo { return getRulerState(pThis); } + else if (aCommand == ".uno:ViewRenderState") + { + return convertOString(pDoc->getViewRenderState()); + } else if (aCommand.starts_with(aViewRowColumnHeaders)) { tools::Rectangle aRectangle; |