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 | 18 ------------------ sd/source/ui/inc/unomodel.hxx | 2 -- sd/source/ui/unoidl/unomodel.cxx | 25 ------------------------- sw/inc/unotxdoc.hxx | 2 -- sw/source/uibase/uno/unotxdoc.cxx | 19 ------------------- 11 files changed, 1 insertion(+), 105 deletions(-)
New commits: commit 693b7fcf7aef50ef6a55c170880f2854afd8fb12 Author: Gökay Şatır <gokaysa...@gmail.com> AuthorDate: Wed Feb 14 12:08:17 2024 +0300 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Thu Mar 7 08:12:11 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. (cherry picked from commit c3f1d63178d6aaa0888085c7b641eb6d49a18276) Conflicts: sc/source/ui/unoobj/docuno.cxx sd/source/ui/unoidl/unomodel.cxx sw/source/uibase/uno/unotxdoc.cxx Change-Id: Ie821a4bca6e6b4649cea17748c44af105cd45d30 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164481 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@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 93efef57d138..92f3d52affef 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1138,9 +1138,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, @@ -1426,7 +1423,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; @@ -4718,20 +4714,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 78651128d3ac..6d446ab5aa4c 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 e94053378355..4c943a441c0a 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 df37c0cef33e..5586ee4f8963 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 25a5ca8241f4..e80a3bbed259 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -920,24 +920,6 @@ void ScModelObj::setTextSelection(int nType, int nX, int nY) } } -OUString ScModelObj::hyperlinkInfoAtPosition(int x, int y) -{ - if (ScViewData* pViewData = ScDocShell::GetViewData()) - { - ScGridWindow* pGridWindow = pViewData->GetActiveWin(); - if (pGridWindow) - { - const Point point(x * pViewData->GetPPTX(), y * pViewData->GetPPTY()); - OUString name; - OUString url; - (void)pGridWindow->GetEditUrl(point, &name, &url); - return url; - } - } - - 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 40a4a5c4b917..8139ea4686e3 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -2725,31 +2725,6 @@ void SdXImpressDocument::setTextSelection(int nType, int nX, int nY) } } -OUString SdXImpressDocument::hyperlinkInfoAtPosition(int x, int y) -{ - ::sd::ViewShell* viewSh = GetViewShell(); - - if (viewSh) - { - Point point(x, y); - point = o3tl::convert(point, o3tl::Length::twip, o3tl::Length::mm100); - SdrView* pSdrView = SfxViewShell::Current()->GetDrawView(); - - if (pSdrView) - { - SdrViewEvent aVEvt; - pSdrView->PickAnything(point, aVEvt); - if (aVEvt.mpURLField) - { - OUString aURL = INetURLObject::decode(aVEvt.mpURLField->GetURL(), INetURLObject::DecodeMechanism::WithCharset); - return aURL; - } - } - } - - return OUString(); -} - uno::Reference<datatransfer::XTransferable> SdXImpressDocument::getSelection() { SolarMutexGuard aGuard; diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index 65728f403e15..4fce95eda9ec 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -445,8 +445,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 1b36c4f249e7..d2641b6c4db4 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3726,25 +3726,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)) - { - return static_cast<const SwFormatINetFormat*>(aContentAtPos.aFnd.pAttr)->GetValue(); - } - } - - return OUString(); -} - uno::Reference<datatransfer::XTransferable> SwXTextDocument::getSelection() { SolarMutexGuard aGuard;