summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-01-10 10:44:31 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-01-11 14:09:42 +0100
commit3a4a90e6e59e16e2ea0883caba87e114a07642f3 (patch)
tree0453bbdc76fc9fc8a45a002f6c1194672540b457 /sfx2
parentb4b68a687c8781e58b1afe84b66323961cc2fd6d (diff)
Resolves: tdf#122404 unlock just the toplevels that were locked
push what toplevels got locked to just unlock those ones. otherwise the just dismissed toplevel may still be present in the Application toplevel list. merge all the similar examples of this. Change-Id: I77c0d55d1e4b3bcc3b8d88fef00ba289edd1e831 Reviewed-on: https://gerrit.libreoffice.org/66078 Tested-by: Jenkins Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/sfxhelp.cxx37
1 files changed, 7 insertions, 30 deletions
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index 08de23e30de6..169d6a641425 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -60,6 +60,7 @@
#include <rtl/uri.hxx>
#include <vcl/commandinfoprovider.hxx>
#include <vcl/layout.hxx>
+#include <vcl/waitobj.hxx>
#include <vcl/weld.hxx>
#include <svtools/ehdl.hxx>
#include <svtools/sfxecode.hxx>
@@ -1023,32 +1024,6 @@ namespace
}
}
-void SfxHelp::incBusy(const vcl::Window* pParent)
-{
- // lock any toplevel windows from being closed until busy is over
- // ensure any dialogs are reset before entering
- vcl::Window *xTopWin = Application::GetFirstTopLevelWindow();
- while (xTopWin)
- {
- if (xTopWin != pParent)
- xTopWin->IncModalCount();
- xTopWin = Application::GetNextTopLevelWindow(xTopWin);
- }
-}
-
-void SfxHelp::decBusy(const vcl::Window* pParent)
-{
- // unlock any toplevel windows from being closed until busy is over
- // ensure any dialogs are reset before entering
- vcl::Window *xTopWin = Application::GetFirstTopLevelWindow();
- while (xTopWin)
- {
- if (xTopWin != pParent)
- xTopWin->DecModalCount();
- xTopWin = Application::GetNextTopLevelWindow(xTopWin);
- }
-}
-
bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const OUString& rKeyword)
{
OUStringBuffer aHelpRootURL("vnd.sun.star.help://");
@@ -1155,9 +1130,11 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const
pWindow = GetBestParent(pWindow);
+ TopLevelWindowLocker aBusy;
+
if(bShowOfflineHelpPopUp)
{
- incBusy(pWindow);
+ aBusy.incBusy(pWindow);
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(pWindow ? pWindow->GetFrameWeld() : nullptr, "sfx/ui/helpmanual.ui"));
std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("onlinehelpmanual"));
std::unique_ptr<weld::CheckButton> m_xHideOfflineHelpCB(xBuilder->weld_check_button("hidedialog"));
@@ -1168,7 +1145,7 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const
short OnlineHelpBox = xQueryBox->run();
bShowOfflineHelpPopUp = OnlineHelpBox != RET_OK;
aHelpOptions.SetOfflineHelpPopUp(!m_xHideOfflineHelpCB->get_state());
- decBusy(pWindow);
+ aBusy.decBusy();
}
if(!bShowOfflineHelpPopUp)
{
@@ -1176,10 +1153,10 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const
return true;
else
{
- incBusy(pWindow);
+ aBusy.incBusy(pWindow);
NoHelpErrorBox aErrBox(pWindow ? pWindow->GetFrameWeld() : nullptr);
aErrBox.run();
- decBusy(pWindow);
+ aBusy.decBusy();
return false;
}
}