summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-12-23 17:46:48 +0000
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-01-08 14:24:17 +0100
commit242119f8cdf0743afd96a5c467c81adace9a8c40 (patch)
tree7950b3edf0fbfcd3654d92ad0b542f9b27c138ae /sfx2
parenteee044b76a2c4ef515475004a550dbd11635e5df (diff)
tdf#122273 modal dialog on modeless dialog needs special handling
Change-Id: Idb5111b3f795f55c4b5644b5bcc6145106ff1392 Reviewed-on: https://gerrit.libreoffice.org/65584 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/sfxhelp.cxx30
1 files changed, 30 insertions, 0 deletions
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index 9e457b7968a8..08de23e30de6 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -1023,6 +1023,32 @@ 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://");
@@ -1131,6 +1157,7 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const
if(bShowOfflineHelpPopUp)
{
+ 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"));
@@ -1141,6 +1168,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);
}
if(!bShowOfflineHelpPopUp)
{
@@ -1148,8 +1176,10 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const
return true;
else
{
+ incBusy(pWindow);
NoHelpErrorBox aErrBox(pWindow ? pWindow->GetFrameWeld() : nullptr);
aErrBox.run();
+ decBusy(pWindow);
return false;
}
}