desktop/qa/desktop_lib/test_desktop_lib.cxx |    5 ++---
 desktop/source/lib/init.cxx                 |   17 ++++-------------
 include/LibreOfficeKit/LibreOfficeKit.h     |    2 --
 include/LibreOfficeKit/LibreOfficeKit.hxx   |    5 -----
 4 files changed, 6 insertions(+), 23 deletions(-)

New commits:
commit d5fbbc750ca96f0541e7bd81dd0657fac53803db
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Fri Feb 23 10:01:50 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Tue Feb 27 09:25:23 2024 +0100

    use getCommandValues instead of adding a getViewRenderState
    
    Change-Id: Ib6db5dd8ef1db2745cb3c616bb81b1ac2baf6504
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163812
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163931
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

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;
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h 
b/include/LibreOfficeKit/LibreOfficeKit.h
index f66083e2d301..78651128d3ac 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -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
 };
 
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index b6cc69e8c92c..e94053378355 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -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
 };
 

Reply via email to