desktop/source/deployment/manager/dp_extensionmanager.cxx | 59 +++++++------- 1 file changed, 33 insertions(+), 26 deletions(-)
New commits: commit 7d3addde836bbd8d990a363562310b237213527a Author: Bayram Çiçek <m...@bayramcicek.com.tr> AuthorDate: Sun Mar 14 14:39:14 2021 +0300 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Fri Mar 19 14:37:42 2021 +0100 tdf#122406: only restart when user accepted the license agreement In Tools > Extension Manager, LO requires restart after declining the license agreement on the *first* try. Don't need to restart LO because no change made. - Current location of fireModified() function doesn't respect this decision. - fireModified() has moved to proper location. Change-Id: I24cb7bcf93d1fff3172b6b4110f17aef00ef97a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112468 Tested-by: Mike Kaganski <mike.kagan...@collabora.com> Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx index 63882cefdfd3..68a6fe08579d 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.cxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx @@ -722,6 +722,39 @@ Reference<css::deployment::XPackage> ExtensionManager::addExtension( sNewExtensionIdentifier, sNewExtensionFileName, bUserDisabled2, false, xAbortChannel, Reference<ucb::XCommandEnvironment>()); + + // if reached this section, + // this means that either the licensedialog.ui didn't popup, + // or user accepted the license agreement. otherwise + // no need to call fireModified() because user declined + // the license agreement therefore no change made. + try + { + fireModified(); + + }catch ( const css::deployment::DeploymentException& ) { + throw; + } catch ( const ucb::CommandFailedException & ) { + throw; + } catch ( const ucb::CommandAbortedException & ) { + throw; + } catch (const lang::IllegalArgumentException &) { + throw; + } catch (const uno::RuntimeException &) { + throw; + } catch (const uno::Exception &) { + uno::Any excOccurred = ::cppu::getCaughtException(); + css::deployment::DeploymentException exc( + "Extension Manager: Exception on fireModified() " + "in the scope of 'if (failedPrereq == 0)'", + static_cast<OWeakObject*>(this), excOccurred); + throw exc; + } catch (...) { + throw uno::RuntimeException( + "Extension Manager: RuntimeException on fireModified() " + "in the scope of 'if (failedPrereq == 0)'", + static_cast<OWeakObject*>(this)); + } } else { @@ -780,32 +813,6 @@ Reference<css::deployment::XPackage> ExtensionManager::addExtension( } } // leaving the guarded section (getMutex()) - try - { - fireModified(); - - }catch ( const css::deployment::DeploymentException& ) { - throw; - } catch ( const ucb::CommandFailedException & ) { - throw; - } catch ( const ucb::CommandAbortedException & ) { - throw; - } catch (const lang::IllegalArgumentException &) { - throw; - } catch (const uno::RuntimeException &) { - throw; - } catch (const uno::Exception &) { - uno::Any excOccurred = ::cppu::getCaughtException(); - css::deployment::DeploymentException exc( - "Extension Manager: exception in doChecksForAddExtension", - static_cast<OWeakObject*>(this), excOccurred); - throw exc; - } catch (...) { - throw uno::RuntimeException( - "Extension Manager: unexpected exception in doChecksForAddExtension", - static_cast<OWeakObject*>(this)); - } - return xNewExtension; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits