[Libreoffice-commits] core.git: sw/source
Caolán McNamara
caolanm at redhat.com
Fri Sep 2 14:15:16 UTC 2016
sw/source/core/crsr/crstrvl.cxx | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
New commits:
commit 84e8e11dc3c73bcfe63f5e9c6cc49ee18a511a9b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Sep 2 15:12:12 2016 +0100
Resolves: rhbz#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
Change-Id: I46a8c960e528f6a9aaab5bea145c6870f22e46c5
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index d9ec218..c3def6d 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