summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-03-27 11:23:54 +0100
committerMike Kaganski <mike.kaganski@collabora.com>2018-03-27 15:38:08 +0200
commit41282255d94bfea01c7f1f5feded9c9e2dc4b178 (patch)
treeeb2b1ad7f3715dc977b98248f035ac1fb45c5fa6 /vcl
parentfec7dc8d4b82cc9a60d8625f313ba12d926665b5 (diff)
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@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/app/help.cxx10
1 files changed, 5 insertions, 5 deletions
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 ) );