summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-02-20 17:07:28 +0000
committerMiklos Vajna <vmiklos@collabora.com>2024-02-23 08:40:52 +0100
commiteffe8f6e5cc5389b234a6e57540f935de4a6f201 (patch)
treecc66ac8c89e1254aadef0520753c832da2115d50 /desktop
parent77f69dc3b530eabcb15939e60f2c702374279d3d (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>
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 3b97df3faa1c..a6f35876f3ef 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1302,6 +1302,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 {
@@ -1496,6 +1498,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();
@@ -4886,6 +4890,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.