diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-07-07 07:52:34 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-07-07 09:32:10 +0200 |
commit | 1652fe3ece911af37b6d3a65d452cbcf86513c42 (patch) | |
tree | 491fd37d64713590999e46bedfafa7f05f50a814 | |
parent | a6b8c40d26c023cf8936017b92821f2b0df7ec58 (diff) |
Some refactor to combine code deciding bNoDelay value
Change-Id: Ie04288c14801dfc8090ed8bd92a85e426a66d654
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154153
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r-- | vcl/source/app/help.cxx | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx index 9f92a46b856c..8336a5b1c20f 100644 --- a/vcl/source/app/help.cxx +++ b/vcl/source/app/help.cxx @@ -529,10 +529,6 @@ void ImplShowHelpWindow( vcl::Window* pParent, sal_uInt16 nHelpWinStyle, QuickHe if (rHelpText.isEmpty()) return; - sal_uInt64 nCurTime = tools::Time::GetSystemTicks(); - if ( ( nCurTime - aHelpData.mnLastHelpHideTime ) < o3tl::make_unsigned(HelpSettings::GetTipDelay()) ) - bNoDelay = true; - VclPtr<HelpTextWindow> pHelpWin = VclPtr<HelpTextWindow>::Create( pParent, rHelpText, nHelpWinStyle, nStyle ); aHelpData.mpHelpWin = pHelpWin; pHelpWin->SetHelpArea( rHelpArea ); @@ -542,8 +538,19 @@ void ImplShowHelpWindow( vcl::Window* pParent, sal_uInt16 nHelpWinStyle, QuickHe pHelpWin->SetOutputSizePixel( aSz ); ImplSetHelpWindowPos( pHelpWin, nHelpWinStyle, nStyle, rScreenPos, rHelpArea ); // if not called from Window::RequestHelp, then without delay... - if ( !aHelpData.mbRequestingHelp ) - bNoDelay = true; + if (!bNoDelay) + { + if ( !aHelpData.mbRequestingHelp ) + { + bNoDelay = true; + } + else + { + sal_uInt64 nCurTime = tools::Time::GetSystemTicks(); + if ( ( nCurTime - aHelpData.mnLastHelpHideTime ) < o3tl::make_unsigned(HelpSettings::GetTipDelay()) ) + bNoDelay = true; + } + } pHelpWin->ShowHelp(bNoDelay); } |