summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorPranam Lashkari <lpranam@collabora.com>2021-02-01 22:18:01 +0530
committerPranam Lashkari <lpranam@collabora.com>2021-02-03 17:24:09 +0100
commita8c20a46efac1ef35981b48c4c8b522ad946e744 (patch)
treeef2601c30c279c5b440c85054b8c5ddbdb152d94 /sw
parentbc025dac6ce3301f5798e8ada4fee07b415de76a (diff)
enable hyperlink to be detected at the end of text
now in online hyperlink popup will appear even when the cursor is at the end of hyperlink text Change-Id: I80a1a093afa11e39236693f8a2639741f74c9876 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110264 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/crsr/crstrvl.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 9153b8b34e85..598863781a69 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -1571,8 +1571,11 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt,
&& IsAttrAtPos::InetAttr & rContentAtPos.eContentAtPos
&& !aTmpState.m_bFootnoteNoInfo )
{
- pTextAttr = pTextNd->GetTextAttrAt(
- aPos.nContent.GetIndex(), RES_TXTATR_INETFMT);
+ sal_Int32 index = aPos.nContent.GetIndex();
+ pTextAttr = pTextNd->GetTextAttrAt(index, RES_TXTATR_INETFMT);
+
+ if(!pTextAttr && index > 0)
+ pTextAttr = pTextNd->GetTextAttrAt(index - 1, RES_TXTATR_INETFMT);
// "detect" only INetAttrs with URLs
if( pTextAttr && !pTextAttr->GetINetFormat().GetValue().isEmpty() )
{