[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

Caolán McNamara caolanm at redhat.com
Fri Sep 2 16:35:36 UTC 2016


 sw/source/core/crsr/crstrvl.cxx |   17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

New commits:
commit 456b1dd03f210dc725ce134bdf9344f8e6df17aa
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Sep 2 15:12:12 2016 +0100

    Resolves: tdf#101681 set hyperlink tooltip for the full hyperlink area
    
    not just a single point in it.
    
    This way gtk3 knows the successive tooltip hints for the positions
    along the hyperlink are for the same tooltip
    
    (cherry picked from commit 84e8e11dc3c73bcfe63f5e9c6cc49ee18a511a9b)
    
    Change-Id: I46a8c960e528f6a9aaab5bea145c6870f22e46c5
    Reviewed-on: https://gerrit.libreoffice.org/28622
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 7dd29d4..1fb7c833 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -1429,16 +1429,25 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt,
                         }
                         if( bRet )
                         {
-                            rContentAtPos.sStr = pTextNd->GetExpandText(
-                                pTextAttr->GetStart(),
-                                *pTextAttr->GetEnd() - pTextAttr->GetStart() );
+                            const sal_Int32 nSt = pTextAttr->GetStart();
+                            const sal_Int32 nEnd = *pTextAttr->End();
+
+                            rContentAtPos.sStr = pTextNd->GetExpandText(nSt, nEnd-nSt);
 
                             rContentAtPos.aFnd.pAttr = &pTextAttr->GetAttr();
                             rContentAtPos.eContentAtPos = SwContentAtPos::SW_INETATTR;
                             rContentAtPos.pFndTextAttr = pTextAttr;
 
                             if( pFieldRect && nullptr != ( pFrame = pTextNd->getLayoutFrame( GetLayout(), &aPt ) ) )
-                                pFrame->GetCharRect( *pFieldRect, aPos, &aTmpState );
+                            {
+                                SwRect aStart;
+                                SwPosition aStartPos(*pTextNd, nSt);
+                                pFrame->GetCharRect(aStart, aStartPos, &aTmpState);
+                                SwRect aEnd;
+                                SwPosition aEndPos(*pTextNd, nEnd);
+                                pFrame->GetCharRect(aEnd, aEndPos, &aTmpState);
+                                *pFieldRect = aStart.Union(aEnd);
+                            }
                         }
                     }
                 }


More information about the Libreoffice-commits mailing list