summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-02-20 17:07:28 +0000
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-02-26 11:15:48 +0100
commitab897d8fa045878b5a58e64a2b6e0de90e38f73e (patch)
treeb33bddb2222bdc59e77877642fb3fd54e1a11e8a /desktop
parentd3b548fdd01d73778c8ae2512e9db024e47c52d2 (diff)
add getViewRenderState to LibreOfficeKitDocument
so we can get the initial render state as it is when created Change-Id: I1202cbbf478bc4f62f4d587e1f2766c61f172cb7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163666 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit effe8f6e5cc5389b234a6e57540f935de4a6f201) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163843 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx5
-rw-r--r--desktop/source/lib/init.cxx13
2 files changed, 16 insertions, 2 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index c9f276a67eeb..2457771c384c 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -3681,12 +3681,13 @@ 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(73), sizeof(struct _LibreOfficeKitDocumentClass));
+ CPPUNIT_ASSERT_EQUAL(documentClassOffset(74), sizeof(struct _LibreOfficeKitDocumentClass));
}
CPPUNIT_TEST_SUITE_REGISTRATION(DesktopLOKTest);
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 7d5bbc66d492..5bc92fdb2a5d 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1298,6 +1298,8 @@ 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 {
@@ -1492,6 +1494,8 @@ 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();
@@ -4882,6 +4886,15 @@ 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.