diff options
author | homeboy445 <akshitsan13@gmail.com> | 2021-11-02 14:39:26 +0530 |
---|---|---|
committer | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2022-03-01 13:20:41 +0100 |
commit | 1c2dc4bc28a594c15464fdb0f5adaa30baf47af2 (patch) | |
tree | dfd854e7bf37a20df9f6f942f7c2a5260ded6059 /include | |
parent | f63a6f2e396fa41ed1338dcec874e06159cafa9f (diff) |
tdf#145486: Catch the error instead of re-checking readOnly state
Change-Id: I555ccad0fae604133effbcf46bf2cb0ad30ac609
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124585
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/unotools/VersionConfig.hxx | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/include/unotools/VersionConfig.hxx b/include/unotools/VersionConfig.hxx index f94dfe564b3d..a16e9f0e0b29 100644 --- a/include/unotools/VersionConfig.hxx +++ b/include/unotools/VersionConfig.hxx @@ -30,12 +30,21 @@ static bool isProductVersionUpgraded(bool aUpdateVersion) = sLastVersion.getToken(0, '.').toInt32() * 10 + sLastVersion.getToken(1, '.').toInt32(); if (iCurrent > iLast) { - if (aUpdateVersion && !officecfg::Setup::Product::ooSetupLastVersion::isReadOnly()) + if (aUpdateVersion) { //update lastversion - std::shared_ptr<comphelper::ConfigurationChanges> batch( - comphelper::ConfigurationChanges::create()); - officecfg::Setup::Product::ooSetupLastVersion::set(sSetupVersion, batch); - batch->commit(); + try + { + std::shared_ptr<comphelper::ConfigurationChanges> batch( + comphelper::ConfigurationChanges::create()); + officecfg::Setup::Product::ooSetupLastVersion::set(sSetupVersion, batch); + batch->commit(); + } + catch (css::lang::IllegalArgumentException&) + { //If the value was readOnly. + SAL_WARN("desktop.updater", "Updating property ooSetupLastVersion to version " + << sSetupVersion + << " failed (read-only property?)"); + } } return true; } |