summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-12-23 17:46:48 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-01-09 14:23:45 +0100
commit07d34ce7ace8060bbef18a4d98be73970430da61 (patch)
tree06adfc3d83a0ae80ec1f22fb2ab0dd6b1352a03b
parent7838e0a33a320ca90d2379982234ca89ccb9a229 (diff)
tdf#122273 modal dialog on modeless dialog needs special handling
Change-Id: Idb5111b3f795f55c4b5644b5bcc6145106ff1392 Reviewed-on: https://gerrit.libreoffice.org/65585 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--include/sfx2/sfxhelp.hxx2
-rw-r--r--sfx2/source/appl/sfxhelp.cxx30
2 files changed, 32 insertions, 0 deletions
diff --git a/include/sfx2/sfxhelp.hxx b/include/sfx2/sfxhelp.hxx
index bdfaaf867143..cda688c57b1e 100644
--- a/include/sfx2/sfxhelp.hxx
+++ b/include/sfx2/sfxhelp.hxx
@@ -40,6 +40,8 @@ private:
SAL_DLLPRIVATE virtual bool Start(const OUString& rURL, weld::Widget* pWidget) override;
SAL_DLLPRIVATE static OUString GetHelpModuleName_Impl(const OUString &rHelpId);
SAL_DLLPRIVATE static OUString CreateHelpURL_Impl( const OUString& aCommandURL, const OUString& rModuleName );
+ SAL_DLLPRIVATE static void incBusy(const vcl::Window* pParent);
+ SAL_DLLPRIVATE static void decBusy(const vcl::Window* pParent);
public:
SfxHelp();
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index 8cf29fedbdf4..ec8f0735c438 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -739,6 +739,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://");
@@ -843,6 +869,7 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const
if ( !impl_hasHelpInstalled() )
{
+ 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"));
@@ -851,6 +878,7 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const
OUString sPrimText = xQueryBox->get_primary_text();
xQueryBox->set_primary_text(sPrimText.replaceAll("$UILOCALE", sLocaleString));
short OnlineHelpBox = xQueryBox->run();
+ decBusy(pWindow);
if(OnlineHelpBox == RET_OK)
{
@@ -858,8 +886,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;
}
}