summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBayram Çiçek <mail@bayramcicek.com.tr>2021-03-14 14:39:14 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-03-19 14:37:42 +0100
commit7d3addde836bbd8d990a363562310b237213527a (patch)
tree932e93b20070450c14b950fa08fa090e9528a369
parente250f17d9653042c3edcb4e55167159746d8ffae (diff)
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.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r--desktop/source/deployment/manager/dp_extensionmanager.cxx59
1 files changed, 33 insertions, 26 deletions
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;
}