summaryrefslogtreecommitdiff
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:30:03 +0100
commit0753fc64eaa17e16941e07f9f52b955b59a37fca (patch)
tree3c6cf11e4a23fd85a5ff71ef272e397b15fc1de8
parent873759184cc8728af0cdea4d8b689ef6da23375c (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/+/110265 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Pranam Lashkari <lpranam@collabora.com>
-rw-r--r--editeng/source/editeng/impedit.cxx2
-rw-r--r--sw/source/core/crsr/crstrvl.cxx7
2 files changed, 6 insertions, 3 deletions
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index 58ba2ce6d43d..2d2eb31268b2 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1619,7 +1619,7 @@ const SvxFieldItem* ImpEditView::GetField( const Point& rPos, sal_Int32* pPara,
for (size_t nAttr = rAttrs.size(); nAttr; )
{
const EditCharAttrib& rAttr = *rAttrs[--nAttr].get();
- if (rAttr.GetStart() == nXPos)
+ if (rAttr.GetStart() == nXPos || rAttr.GetEnd() == nXPos)
{
if (rAttr.Which() == EE_FEATURE_FIELD)
{
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 3a46219ec7fe..c589fe01f73d 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -1564,8 +1564,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() )
{