Kaydet (Commit) 41282255 authored tarafından Mike Kaganski's avatar Mike Kaganski

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/51938Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst fec7dc8d
......@@ -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 ) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment