editeng/source/editeng/impedit.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 5e6a8c3ea3d31a17abab2c3481f1153a7ba65d5b
Author:     Gülşah Köse <[email protected]>
AuthorDate: Thu Oct 9 12:25:15 2025 +0300
Commit:     Gülşah Köse <[email protected]>
CommitDate: Thu Oct 9 14:40:27 2025 +0200

    GH#13135 ONLINE: Get URL field from selection instead of cursor position
    
    Getting field by cursor position is not safe. It uses the top left point
    of the cursor rect. Some small cursor size/pos bugs may direcly affect the
    field.
    
    Getting URL field from selection is better in this case.
    
    Signed-off-by: Gülşah Köse <[email protected]>
    Change-Id: Ib2a98322b15e9263e7024298c60021e54ba23880
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192097
    Reviewed-by: Szymon Kłos <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    (cherry picked from commit 946c4dc9637173ba106ce7d3da25393da952301c)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192101

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 8f4b74544d70..271836a1ae02 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1417,8 +1417,8 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool 
bForceVisCursor )
                 boost::property_tree::ptree aHyperlinkTree;
                 if (pActiveView && 
URLFieldHelper::IsCursorAtURLField(*pActiveView))
                 {
-                    if (const SvxFieldItem* pFld = GetField(aPos, nullptr, 
nullptr))
-                        if (auto pUrlField = dynamic_cast<const 
SvxURLField*>(pFld->GetField()))
+                    const SvxFieldData* pField  = 
pActiveView->GetFieldUnderMouseOrInSelectionOrAtCursor();
+                    if (auto pUrlField = dynamic_cast<const 
SvxURLField*>(pField))
                             aHyperlinkTree = 
getHyperlinkPropTree(pUrlField->GetRepresentation(), pUrlField->GetURL());
                 }
                 else if (GetEditSelection().HasRange())

Reply via email to