[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - editeng/source sw/source

Pranam Lashkari (via logerrit) logerrit at kemper.freedesktop.org
Fri Apr 2 17:47:31 UTC 2021


 editeng/source/editeng/impedit.cxx |    2 +-
 sw/source/core/crsr/crstrvl.cxx    |    7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

New commits:
commit d53112eea7be0fae8224125c921c825932030671
Author:     Pranam Lashkari <lpranam at collabora.com>
AuthorDate: Mon Feb 1 22:18:01 2021 +0530
Commit:     Pranam Lashkari <lpranam at collabora.com>
CommitDate: Fri Apr 2 19:46:58 2021 +0200

    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/+/110227
    Tested-by: Jenkins
    Reviewed-by: Pranam Lashkari <lpranam at collabora.com>
    (cherry picked from commit 3233db0913193855285e1f56492d4617368441b6)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113532
    Tested-by: Pranam Lashkari <lpranam at collabora.com>

diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index f226f983f593..28c98f4b84b2 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1803,7 +1803,7 @@ const SvxFieldItem* ImpEditView::GetField( const Point& rPos, sal_Int32* pPara,
     for (size_t nAttr = rAttrs.size(); nAttr; )
     {
         const EditCharAttrib& rAttr = *rAttrs[--nAttr];
-        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 7e27e1ee899a..4216a470ebc5 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -1567,8 +1567,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() )
                     {


More information about the Libreoffice-commits mailing list