editeng/source/editeng/impedit.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
New commits: commit 819db80c7cc9f9c038cb90752f6208cc2975a767 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: Tue Oct 28 09:52:07 2025 +0100 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]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193067 Tested-by: Jenkins diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index 0dcdcaa66807..9cb809656fb8 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -1447,8 +1447,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())
