svx/source/form/fmpage.cxx |   31 +++++++++++++++----------------
 1 file changed, 15 insertions(+), 16 deletions(-)

New commits:
commit d1c29054449b00a16da6ee7ecaef0a94fe3964bf
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Thu Apr 11 11:02:41 2024 +0200
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Fri Apr 12 08:08:06 2024 +0200

    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.wegh...@posteo.de>
    (cherry picked from commit 6347c89711903834cc9188abda5d5a253053b789)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165933
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

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;
 }
 

Reply via email to