summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2020-05-18 16:44:20 +0300
committerTor Lillqvist <tml@collabora.com>2020-05-18 18:52:20 +0200
commit74597acc9318177a0266535b5387dba35305171a (patch)
treeaeb36c6bcc413f7acedf4fb9b3e095caee505892
parentfd60c5a4879cb881b6c5abfe53ba80126ebb7303 (diff)
tdf#129177: Allow extensions to specify also maximum LibreOffice version
To be used by the potential packaging of language packs as extensions. Language packs are by necessity specific to a LibreOffice version as they contain message catalogs. Change-Id: I6037103dfe0949d288f8ad77fec63dd5da221c02 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94425 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
-rw-r--r--desktop/inc/strings.hrc1
-rw-r--r--desktop/source/deployment/misc/dp_dependencies.cxx9
2 files changed, 10 insertions, 0 deletions
diff --git a/desktop/inc/strings.hrc b/desktop/inc/strings.hrc
index 0f027731141a..d6d2c6244210 100644
--- a/desktop/inc/strings.hrc
+++ b/desktop/inc/strings.hrc
@@ -114,6 +114,7 @@
#define RID_DEPLOYMENT_DEPENDENCIES_OOO_MIN NC_("RID_DEPLOYMENT_DEPENDENCIES_OOO_MIN", "Extension requires at least OpenOffice.org reference version %VERSION")
#define RID_DEPLOYMENT_DEPENDENCIES_OOO_MAX NC_("RID_DEPLOYMENT_DEPENDENCIES_OOO_MAX", "Extension does not support OpenOffice.org reference versions greater than %VERSION")
#define RID_DEPLOYMENT_DEPENDENCIES_LO_MIN NC_("RID_DEPLOYMENT_DEPENDENCIES_LO_MIN", "Extension requires at least %PRODUCTNAME version %VERSION")
+#define RID_DEPLOYMENT_DEPENDENCIES_LO_MAX NC_("RID_DEPLOYMENT_DEPENDENCIES_LO_MAX", "Extension does not support %PRODUCTNAME versions greater than %VERSION")
#define RID_STR_WARNING_VERSION_LESS NC_("RID_STR_WARNING_VERSION_LESS", "You are about to install version $NEW of the extension '$NAME'.\n" \
"The newer version $DEPLOYED is already installed.\n"\
diff --git a/desktop/source/deployment/misc/dp_dependencies.cxx b/desktop/source/deployment/misc/dp_dependencies.cxx
index 0105c4ba7d62..081144af3bc1 100644
--- a/desktop/source/deployment/misc/dp_dependencies.cxx
+++ b/desktop/source/deployment/misc/dp_dependencies.cxx
@@ -47,6 +47,7 @@ static char const namespaceOpenOfficeOrg[] =
"http://openoffice.org/extensions/description/2006";
static char const minimalVersionLibreOffice[] = "LibreOffice-minimal-version";
+static char const maximalVersionLibreOffice[] = "LibreOffice-maximal-version";
static char const minimalVersionOpenOfficeOrg[] =
"OpenOffice.org-minimal-version";
@@ -134,6 +135,9 @@ check(dp_misc::DescriptionInfoset const & infoset) {
sat = satisfiesMinimalVersion(
getLibreOfficeMajorMinorMicro(),
e->getAttribute("value"));
+ } else if (e->getNamespaceURI() == namespaceLibreOffice && e->getTagName() == maximalVersionLibreOffice )
+ {
+ sat = satisfiesMaximalVersion(getLibreOfficeMajorMinorMicro(), e->getAttribute("value"));
} else if (e->hasAttributeNS(namespaceOpenOfficeOrg,
minimalVersionOpenOfficeOrg))
{
@@ -169,6 +173,11 @@ OUString getErrorText(
return produceErrorText(
DpResId(RID_DEPLOYMENT_DEPENDENCIES_LO_MIN),
dependency->getAttribute("value"));
+ } else if (dependency->getNamespaceURI() == namespaceLibreOffice && dependency->getTagName() == maximalVersionLibreOffice )
+ {
+ return produceErrorText(
+ DpResId(RID_DEPLOYMENT_DEPENDENCIES_LO_MAX),
+ dependency->getAttribute("value"));
} else if (dependency->hasAttributeNS(namespaceOpenOfficeOrg,
minimalVersionOpenOfficeOrg))
{