[Libreoffice-commits] core.git: vcl/source
Mike Kaganski
mike.kaganski at collabora.com
Tue Mar 27 13:39:04 UTC 2018
vcl/source/app/help.cxx | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
New commits:
commit 41282255d94bfea01c7f1f5feded9c9e2dc4b178
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date: Tue Mar 27 11:23:54 2018 +0100
Don't destroy/recreate tooltip (Help window) needlessly
Just reuse existing Help window, moving and updating it as necessary
Change-Id: Ifb06c9bbc05e1b505676102ef96069cfe283e7c1
Reviewed-on: https://gerrit.libreoffice.org/51938
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx
index 86bf084df4e2..91a7356fe43e 100644
--- a/vcl/source/app/help.cxx
+++ b/vcl/source/app/help.cxx
@@ -504,14 +504,13 @@ void ImplShowHelpWindow( vcl::Window* pParent, sal_uInt16 nHelpWinStyle, QuickHe
{
SAL_WARN_IF( pHelpWin == pParent, "vcl", "HelpInHelp ?!" );
- if ( ( ( pHelpWin->GetHelpText() != rHelpText )
+ if ( ( rHelpText.isEmpty()
|| ( pHelpWin->GetWinStyle() != nHelpWinStyle )
- || ( pHelpWin->GetHelpArea() != rHelpArea )
)
&& pSVData->maHelpData.mbRequestingHelp
)
{
- // remove help window if no HelpText or other HelpText or
+ // remove help window if no HelpText or
// other help mode. but keep it if we are scrolling, ie not requesting help
bool bWasVisible = pHelpWin->IsVisible();
if ( bWasVisible )
@@ -521,8 +520,9 @@ void ImplShowHelpWindow( vcl::Window* pParent, sal_uInt16 nHelpWinStyle, QuickHe
}
else
{
- bool const bTextChanged = rHelpText != pHelpWin->GetHelpText();
- if (bTextChanged)
+ bool const bUpdate = (pHelpWin->GetHelpText() != rHelpText) ||
+ ((pHelpWin->GetHelpArea() != rHelpArea) && pSVData->maHelpData.mbRequestingHelp);
+ if (bUpdate)
{
vcl::Window * pWindow = pHelpWin->GetParent()->ImplGetFrameWindow();
tools::Rectangle aInvRect( pHelpWin->GetWindowExtentsRelative( pWindow ) );
More information about the Libreoffice-commits
mailing list