[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - desktop/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Tue Oct 8 09:45:43 UTC 2019
desktop/source/deployment/gui/dp_gui_theextmgr.cxx | 58 +++++++++++++++++----
desktop/source/deployment/gui/dp_gui_theextmgr.hxx | 3 -
2 files changed, 50 insertions(+), 11 deletions(-)
New commits:
commit cb5be6961e071ea2b9efd66cd62b98ffda5a058f
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Sep 20 11:38:00 2019 +0100
Commit: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
CommitDate: Tue Oct 8 11:44:58 2019 +0200
Related: tdf#127645 update dialog has a slave extension dialog
when the update dialog is shown, the extension dialog was created but not
executed, so there isn't a dialog execution context to end, just the unexecuted
dialog to "close"
Change-Id: If4b522ca5f880d3ece8403b5350c846bd14a2992
Reviewed-on: https://gerrit.libreoffice.org/79283
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
index 65b4e1c0592c..0ee63dabc400 100644
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
@@ -59,7 +59,8 @@ TheExtensionManager::TheExtensionManager( const uno::Reference< awt::XWindow > &
const uno::Reference< uno::XComponentContext > &xContext ) :
m_xContext( xContext ),
m_xParent( xParent ),
- m_bModified(false)
+ m_bModified(false),
+ m_bExtMgrDialogExecuting(false)
{
m_xExtensionManager = deployment::ExtensionManager::get( xContext );
m_xExtensionManager->addModifyListener( this );
@@ -106,7 +107,15 @@ TheExtensionManager::~TheExtensionManager()
m_xUpdReqDialog->response(RET_CANCEL);
assert(!m_xUpdReqDialog);
if (m_xExtMgrDialog)
- m_xExtMgrDialog->response(RET_CANCEL);
+ {
+ if (m_bExtMgrDialogExecuting)
+ m_xExtMgrDialog->response(RET_CANCEL);
+ else
+ {
+ m_xExtMgrDialog->Close();
+ m_xExtMgrDialog.reset();
+ }
+ }
assert(!m_xExtMgrDialog);
}
@@ -136,7 +145,10 @@ void TheExtensionManager::Show()
{
const SolarMutexGuard guard;
+ m_bExtMgrDialogExecuting = true;
+
weld::DialogController::runAsync(m_xExtMgrDialog, [this](sal_Int32 /*nResult*/) {
+ m_bExtMgrDialogExecuting = false;
auto xExtMgrDialog = m_xExtMgrDialog;
m_xExtMgrDialog.reset();
xExtMgrDialog->Close();
@@ -158,17 +170,19 @@ void TheExtensionManager::ToTop()
getDialog()->present();
}
-
-bool TheExtensionManager::Close()
+void TheExtensionManager::Close()
{
if (m_xExtMgrDialog)
- m_xExtMgrDialog->response(RET_CANCEL);
+ {
+ if (m_bExtMgrDialogExecuting)
+ m_xExtMgrDialog->response(RET_CANCEL);
+ else
+ m_xExtMgrDialog->Close();
+ }
else if (m_xUpdReqDialog)
m_xUpdReqDialog->response(RET_CANCEL);
- return true;
}
-
sal_Int16 TheExtensionManager::execute()
{
sal_Int16 nRet = 0;
@@ -255,7 +269,15 @@ void TheExtensionManager::terminateDialog()
{
const SolarMutexGuard guard;
if (m_xExtMgrDialog)
- m_xExtMgrDialog->response(RET_CANCEL);
+ {
+ if (m_bExtMgrDialogExecuting)
+ m_xExtMgrDialog->response(RET_CANCEL);
+ else
+ {
+ m_xExtMgrDialog->Close();
+ m_xExtMgrDialog.reset();
+ }
+ }
assert(!m_xExtMgrDialog);
if (m_xUpdReqDialog)
m_xUpdReqDialog->response(RET_CANCEL);
@@ -424,7 +446,15 @@ void TheExtensionManager::disposing( lang::EventObject const & rEvt )
{
const SolarMutexGuard guard;
if (m_xExtMgrDialog)
- m_xExtMgrDialog->response(RET_CANCEL);
+ {
+ if (m_bExtMgrDialogExecuting)
+ m_xExtMgrDialog->response(RET_CANCEL);
+ else
+ {
+ m_xExtMgrDialog->Close();
+ m_xExtMgrDialog.reset();
+ }
+ }
assert(!m_xExtMgrDialog);
if (m_xUpdReqDialog)
m_xUpdReqDialog->response(RET_CANCEL);
@@ -450,7 +480,15 @@ void TheExtensionManager::queryTermination( ::lang::EventObject const & )
{
clearModified();
if (m_xExtMgrDialog)
- m_xExtMgrDialog->response(RET_CANCEL);
+ {
+ if (m_bExtMgrDialogExecuting)
+ m_xExtMgrDialog->response(RET_CANCEL);
+ else
+ {
+ m_xExtMgrDialog->Close();
+ m_xExtMgrDialog.reset();
+ }
+ }
if (m_xUpdReqDialog)
m_xUpdReqDialog->response(RET_CANCEL);
}
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.hxx b/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
index c75ec34872b0..db862a5f388d 100644
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
@@ -57,6 +57,7 @@ private:
OUString m_sGetExtensionsURL;
bool m_bModified;
+ bool m_bExtMgrDialogExecuting;
public:
static ::rtl::Reference<TheExtensionManager> s_ExtMgr;
@@ -90,7 +91,7 @@ public:
void SetText( const OUString &rTitle );
void Show();
void ToTop();
- bool Close();
+ void Close();
bool isVisible();
More information about the Libreoffice-commits
mailing list