summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2024-04-11 11:02:41 +0200
committerAndras Timar <andras.timar@collabora.com>2024-04-15 12:36:24 +0200
commitd48ba233d076a7a4f2ed3c3d0017adffc15e266a (patch)
tree15672f63bc4dcd6a5202474689bd8c754bf5ea70 /svx
parentbaf73e671ab68865a497a99917b3282595eeef37 (diff)
tdf#160176 svx: Reset help text when form control has none
In `FmFormPage::RequestHelp`, also call `Help::ShowQuickHelp`/`Help::ShowBalloon` when the help text is empty, as that is the way to unset the help text/remove the tooltip again, see `ImplShowHelpWindow` in `vcl/source/app/help.cxx`: For the case of non-native tooltips (e.g. the gen VCL plugin on Linux), the `bRemoveHelp = true` code path is relevant. For qt5/qt6/kf5/kf6 which use native tooltips, the call to pParent->ImplGetFrame()->ShowTooltip(rHelpText, rHelpArea) further up sets the `QtFrame`'s `m_aTooltipText` member to an empty string, which prevents showing the outdated help text for the `QEvent::ToolTip` event in `QtWidget::handleEvent`. Change-Id: Iceb2424d9c72ae46333a718c677629122e517f11 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166006 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 6347c89711903834cc9188abda5d5a253053b789) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165933 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/form/fmpage.cxx31
1 files changed, 15 insertions, 16 deletions
diff --git a/svx/source/form/fmpage.cxx b/svx/source/form/fmpage.cxx
index 8c24f3cc22ae..6e4f2093d011 100644
--- a/svx/source/form/fmpage.cxx
+++ b/svx/source/form/fmpage.cxx
@@ -139,22 +139,21 @@ bool FmFormPage::RequestHelp( vcl::Window* pWindow, SdrView const * pView,
}
}
}
- if ( !aHelpText.isEmpty() )
- {
- // display the help
- tools::Rectangle aItemRect = pObj->GetCurrentBoundRect();
- aItemRect = pWindow->LogicToPixel( aItemRect );
- Point aPt = pWindow->OutputToScreenPixel( aItemRect.TopLeft() );
- aItemRect.SetLeft( aPt.X() );
- aItemRect.SetTop( aPt.Y() );
- aPt = pWindow->OutputToScreenPixel( aItemRect.BottomRight() );
- aItemRect.SetRight( aPt.X() );
- aItemRect.SetBottom( aPt.Y() );
- if( rEvt.GetMode() == HelpEventMode::BALLOON )
- Help::ShowBalloon( pWindow, aItemRect.Center(), aItemRect, aHelpText);
- else
- Help::ShowQuickHelp( pWindow, aItemRect, aHelpText );
- }
+
+ // display the help
+ tools::Rectangle aItemRect = pObj->GetCurrentBoundRect();
+ aItemRect = pWindow->LogicToPixel( aItemRect );
+ Point aPt = pWindow->OutputToScreenPixel( aItemRect.TopLeft() );
+ aItemRect.SetLeft( aPt.X() );
+ aItemRect.SetTop( aPt.Y() );
+ aPt = pWindow->OutputToScreenPixel( aItemRect.BottomRight() );
+ aItemRect.SetRight( aPt.X() );
+ aItemRect.SetBottom( aPt.Y() );
+ if( rEvt.GetMode() == HelpEventMode::BALLOON )
+ Help::ShowBalloon( pWindow, aItemRect.Center(), aItemRect, aHelpText);
+ else
+ Help::ShowQuickHelp( pWindow, aItemRect, aHelpText );
+
return true;
}