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>
This commit is contained in:
Caolán McNamara
2024-02-27 09:25:23 +01:00
parent a938613961
commit d5fbbc750c
4 changed files with 6 additions and 23 deletions
+2 -3
View File
@@ -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);
+4 -13
View File
@@ -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;
-2
View File
@@ -517,8 +517,6 @@ struct _LibreOfficeKitDocumentClass
/// @see lok::Document::hyperlinkInfoAtPosition().
char* (*hyperlinkInfoAtPosition) (LibreOfficeKitDocument* pThis, int x,int y);
char* (*getViewRenderState) (LibreOfficeKitDocument* pThis);
#endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
};
@@ -894,11 +894,6 @@ public:
return mpDoc->pClass->getA11yCaretPosition(mpDoc);
}
char* getViewRenderState()
{
return mpDoc->pClass->getViewRenderState(mpDoc);
}
#endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
};