diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-09-02 15:12:12 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-09-02 16:35:12 +0000 |
commit | 456b1dd03f210dc725ce134bdf9344f8e6df17aa (patch) | |
tree | 343b4dee6340b3cf4b1fb5bb373157113cf5c78e | |
parent | Resolves: tdf#98100 no valueset tooltips with extended tips... (diff) | |
download | core-456b1dd03f210dc725ce134bdf9344f8e6df17aa.tar.gz core-456b1dd03f210dc725ce134bdf9344f8e6df17aa.zip |
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@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r-- | sw/source/core/crsr/crstrvl.cxx | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index 7dd29d42c0b3..1fb7c8331e90 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); + } } } } |