desktop/qa/desktop_lib/test_desktop_lib.cxx | 5 +---- desktop/source/lib/init.cxx | 18 ------------------ include/LibreOfficeKit/LibreOfficeKit.h | 3 --- include/LibreOfficeKit/LibreOfficeKit.hxx | 5 ----- include/vcl/ITiledRenderable.hxx | 6 ------ sc/inc/docuno.hxx | 3 --- sc/source/ui/unoobj/docuno.cxx | 6 ------ sd/source/ui/inc/unomodel.hxx | 2 -- sd/source/ui/unoidl/unomodel.cxx | 6 ------ sw/inc/unotxdoc.hxx | 2 -- sw/source/uibase/uno/unotxdoc.cxx | 22 ---------------------- 11 files changed, 1 insertion(+), 77 deletions(-)
New commits: commit c3f1d63178d6aaa0888085c7b641eb6d49a18276 Author: Gökay Şatır <gokaysa...@gmail.com> AuthorDate: Wed Feb 14 12:08:17 2024 +0300 Commit: Gökay ŞATIR <gokaysa...@collabora.com> CommitDate: Wed Mar 6 11:21:14 2024 +0100 Revert hyperlinkInfoAtPositon changes. Revert "Implement hyperlinkInfoAtPosition for Impress." This reverts commit 876543305c78cb596720da087454a5c54e5feb06. Revert "Readonly Hyperlink Info - normalize the clicked coordinates." This reverts commit 322669725b771f5fa2b3c10c5fb73238ca3713f6. Revert "Implement hyperlinkInfoAtPosition function for Calc." This reverts commit be01dd78c47b51b19603a6259504e29b11979b0b. Revert "Implement hyperlinkInfoAtPosition for Writer." This reverts commit 6773c8929690f557d29bc282dd8f5c4381da3484. Revert "In readonly mode, we restrict many events like click." This reverts commit a4f3b97e506f38e0c43d6fbf1192cc523750a9fd. Change-Id: Ie821a4bca6e6b4649cea17748c44af105cd45d30 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163430 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Michael Meeks <michael.me...@collabora.com> diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index c9f276a67eeb..87afe69166a8 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -3682,11 +3682,8 @@ void DesktopLOKTest::testABI() CPPUNIT_ASSERT_EQUAL(documentClassOffset(71), offsetof(struct _LibreOfficeKitDocumentClass, getA11yCaretPosition)); - CPPUNIT_ASSERT_EQUAL(documentClassOffset(72), - offsetof(struct _LibreOfficeKitDocumentClass, hyperlinkInfoAtPosition)); - // As above - CPPUNIT_ASSERT_EQUAL(documentClassOffset(73), sizeof(struct _LibreOfficeKitDocumentClass)); + CPPUNIT_ASSERT_EQUAL(documentClassOffset(72), sizeof(struct _LibreOfficeKitDocumentClass)); } CPPUNIT_TEST_SUITE_REGISTRATION(DesktopLOKTest); diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 65e131cc48a3..4ecbb58b5154 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1143,9 +1143,6 @@ static void doc_postWindowExtTextInputEvent(LibreOfficeKitDocument* pThis, unsigned nWindowId, int nType, const char* pText); - -static char* doc_hyperlinkInfoAtPosition(LibreOfficeKitDocument *pThis, int x, int y); - static void doc_removeTextContext(LibreOfficeKitDocument* pThis, unsigned nLOKWindowId, int nCharBefore, @@ -1431,7 +1428,6 @@ LibLODocument_Impl::LibLODocument_Impl(uno::Reference <css::lang::XComponent> xC m_pDocumentClass->registerCallback = doc_registerCallback; m_pDocumentClass->postKeyEvent = doc_postKeyEvent; m_pDocumentClass->postWindowExtTextInputEvent = doc_postWindowExtTextInputEvent; - m_pDocumentClass->hyperlinkInfoAtPosition = doc_hyperlinkInfoAtPosition; m_pDocumentClass->removeTextContext = doc_removeTextContext; m_pDocumentClass->postWindowKeyEvent = doc_postWindowKeyEvent; m_pDocumentClass->postMouseEvent = doc_postMouseEvent; @@ -4723,20 +4719,6 @@ static void doc_postWindowExtTextInputEvent(LibreOfficeKitDocument* pThis, unsig SfxLokHelper::postExtTextEventAsync(pWindow, nType, OUString::fromUtf8(std::string_view(pText, strlen(pText)))); } -static char* doc_hyperlinkInfoAtPosition(LibreOfficeKitDocument* pThis, int x, int y) -{ - SolarMutexGuard aGuard; - - ITiledRenderable* pDoc = getTiledRenderable(pThis); - if (!pDoc) - { - SetLastExceptionMsg("Document doesn't support tiled rendering"); - return nullptr; - } - - return convertOUString(pDoc->hyperlinkInfoAtPosition(x, y)); -} - static void doc_removeTextContext(LibreOfficeKitDocument* pThis, unsigned nLOKWindowId, int nCharBefore, int nCharAfter) { SolarMutexGuard aGuard; diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h index d924c416eb0b..8128995fec24 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.h +++ b/include/LibreOfficeKit/LibreOfficeKit.h @@ -514,9 +514,6 @@ struct _LibreOfficeKitDocumentClass /// @see lok::Document::getA11yCaretPosition. int (*getA11yCaretPosition) (LibreOfficeKitDocument* pThis); - /// @see lok::Document::hyperlinkInfoAtPosition(). - char* (*hyperlinkInfoAtPosition) (LibreOfficeKitDocument* pThis, int x,int y); - #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx index 797dd6bca73b..ccb2f0e44a79 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -362,11 +362,6 @@ public: mpDoc->pClass->setTextSelection(mpDoc, nType, nX, nY); } - char* hyperlinkInfoAtPosition(int x, int y) - { - return mpDoc->pClass->hyperlinkInfoAtPosition(mpDoc, x, y); - } - /** * Gets the currently selected text. * diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx index 41d1143bf019..be6c050ad36d 100644 --- a/include/vcl/ITiledRenderable.hxx +++ b/include/vcl/ITiledRenderable.hxx @@ -166,12 +166,6 @@ public: */ virtual void setTextSelection(int nType, int nX, int nY) = 0; - /* - * Gets the info of hyperlink under the mouse position if any. - * @see lok::Document::hyperlinkInfoAtPosition(). - */ - virtual OUString hyperlinkInfoAtPosition(int x, int y) = 0; - /** * Gets the selection as a transferable for later processing */ diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx index bc4608efbc3f..611b0c22d2b9 100644 --- a/sc/inc/docuno.hxx +++ b/sc/inc/docuno.hxx @@ -346,9 +346,6 @@ public: /// @see vcl::ITiledRenderable::setTextSelection(). virtual void setTextSelection(int nType, int nX, int nY) override; - /// @see vcl::ITiledRenderable::hyperlinkInfoAtPosition(). - virtual OUString hyperlinkInfoAtPosition(int x, int y) override; - /// @see vcl::ITiledRenderable::getSelection(). virtual css::uno::Reference<css::datatransfer::XTransferable> getSelection() override; diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 85b1cc01cf54..e9d4b633b645 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -918,12 +918,6 @@ void ScModelObj::setTextSelection(int nType, int nX, int nY) } } -OUString ScModelObj::hyperlinkInfoAtPosition(int /*x*/, int /*y*/) -{ - // To be implemented.. - return OUString(); -} - uno::Reference<datatransfer::XTransferable> ScModelObj::getSelection() { SolarMutexGuard aGuard; diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx index 37ead03a9279..e0fa051d8826 100644 --- a/sd/source/ui/inc/unomodel.hxx +++ b/sd/source/ui/inc/unomodel.hxx @@ -254,8 +254,6 @@ public: virtual void postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons, int nModifier) override; /// @see vcl::ITiledRenderable::setTextSelection(). virtual void setTextSelection(int nType, int nX, int nY) override; - /// @see vcl::ITiledRenderable::hyperlinkInfoAtPosition(). - virtual OUString hyperlinkInfoAtPosition(int x, int y) override; /// @see vcl::ITiledRenderable::getSelection(). virtual css::uno::Reference<css::datatransfer::XTransferable> getSelection() override; /// @see vcl::ITiledRenderable::setGraphicSelection(). diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 7e10b3a2a361..f8b6e6af5e87 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -2715,12 +2715,6 @@ void SdXImpressDocument::setTextSelection(int nType, int nX, int nY) } } -OUString SdXImpressDocument::hyperlinkInfoAtPosition(int /*x*/, int /*y*/) -{ - // To be implemented.. - return OUString(); -} - uno::Reference<datatransfer::XTransferable> SdXImpressDocument::getSelection() { SolarMutexGuard aGuard; diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index b9e40d23f0cd..32ae6c27e452 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -423,8 +423,6 @@ public: virtual void postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons, int nModifier) override; /// @see vcl::ITiledRenderable::setTextSelection(). virtual void setTextSelection(int nType, int nX, int nY) override; - /// @see vcl::ITiledRenderable::hyperlinkInfoAtPosition(). - virtual OUString hyperlinkInfoAtPosition(int x, int y) override; /// @see vcl::ITiledRenderable::getSelection(). virtual css::uno::Reference<css::datatransfer::XTransferable> getSelection() override; /// @see vcl::ITiledRenderable::setGraphicSelection(). diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 32b34017b660..3d8164647c06 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3791,28 +3791,6 @@ void SwXTextDocument::setTextSelection(int nType, int nX, int nY) } } -OUString SwXTextDocument::hyperlinkInfoAtPosition(int x, int y) -{ - SolarMutexGuard aGuard; - SwWrtShell* pWrtShell = m_pDocShell->GetWrtShell(); - - if (pWrtShell) - { - const Point point(x, y); - SwContentAtPos aContentAtPos(IsAttrAtPos::InetAttr); - - if (pWrtShell->GetContentAtPos(point, aContentAtPos)) - { - OUString url = static_cast<const SwFormatINetFormat*>(aContentAtPos.aFnd.pAttr)->GetValue(); - return url; - } - else - return OUString(); - } - else - return OUString(); -} - uno::Reference<datatransfer::XTransferable> SwXTextDocument::getSelection() { SolarMutexGuard aGuard;