summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-04-28 16:28:49 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-04-28 18:31:40 +0200
commita7c2f1580e928d13d02d778639a0f26de728b5be (patch)
tree7d64d63f0c9fa7c08d6b25d5aa07632bae3b0147 /basctl
parente5321eba2ddf439ac9e066365b53e5fc772d8b4c (diff)
Resolves: tdf#124704 need to state the area the tooltip is for
to make it work under gtk3 Change-Id: I4c895181af233a16292ce16b194f0a60994446fb Reviewed-on: https://gerrit.libreoffice.org/71478 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'basctl')
-rw-r--r--basctl/source/basicide/baside2b.cxx19
1 files changed, 12 insertions, 7 deletions
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 2e3425da97ce..df2b10ef5ab1 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -343,7 +343,7 @@ void EditorWindow::RequestHelp( const HelpEvent& rHEvt )
else if ( rHEvt.GetMode() & HelpEventMode::QUICK )
{
OUString aHelpText;
- Point aTopLeft;
+ tools::Rectangle aHelpRect;
if ( StarBASIC::IsRunning() )
{
Point aWindowPos = rHEvt.GetMousePosPixel();
@@ -377,15 +377,20 @@ void EditorWindow::RequestHelp( const HelpEvent& rHEvt )
}
if ( !aHelpText.isEmpty() )
{
- aTopLeft = GetEditView()->GetTextEngine()->PaMtoEditCursor( aStartOfWord ).BottomLeft();
- aTopLeft = GetEditView()->GetWindowPos( aTopLeft );
- aTopLeft.AdjustX(5 );
- aTopLeft.AdjustY(5 );
- aTopLeft = OutputToScreenPixel( aTopLeft );
+ tools::Rectangle aStartWordRect(GetEditView()->GetTextEngine()->PaMtoEditCursor(aStartOfWord));
+ TextPaM aEndOfWord(aStartOfWord.GetPara(), aStartOfWord.GetIndex() + aWord.getLength());
+ tools::Rectangle aEndWordRect(GetEditView()->GetTextEngine()->PaMtoEditCursor(aEndOfWord));
+ aHelpRect = aStartWordRect.GetUnion(aEndWordRect);
+
+ Point aTopLeft = GetEditView()->GetWindowPos(aHelpRect.TopLeft());
+ aTopLeft = GetEditView()->GetWindow()->OutputToScreenPixel(aTopLeft);
+
+ aHelpRect.setX(aTopLeft.X());
+ aHelpRect.setY(aTopLeft.Y());
}
}
}
- Help::ShowQuickHelp( this, tools::Rectangle( aTopLeft, Size( 1, 1 ) ), aHelpText, QuickHelpFlags::Top|QuickHelpFlags::Left);
+ Help::ShowQuickHelp( this, aHelpRect, aHelpText, QuickHelpFlags::NONE);
bDone = true;
}
}