From: Juergen Spitzmueller Date: Mon, 19 Dec 2022 16:42:49 +0000 (+0100) Subject: Adapt inset info to new version check X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=9966b4be4a44fc7c64e0e612a209835efa4b9465;p=features.git Adapt inset info to new version check --- diff --git a/lib/doc/LaTeXConfig.lyx b/lib/doc/LaTeXConfig.lyx index 99621cb74e..83e651cce9 100644 --- a/lib/doc/LaTeXConfig.lyx +++ b/lib/doc/LaTeXConfig.lyx @@ -1,5 +1,5 @@ #LyX 2.4 created this file. For more info see https://www.lyx.org/ -\lyxformat 612 +\lyxformat 613 \begin_document \begin_header \save_transient_properties true @@ -5845,7 +5845,7 @@ babel \begin_inset Info type "package" -arg "babel-2017/11/03" +arg "babel 20171103" \end_inset ), diff --git a/src/insets/InsetInfo.cpp b/src/insets/InsetInfo.cpp index ed2566eadb..46d656c817 100644 --- a/src/insets/InsetInfo.cpp +++ b/src/insets/InsetInfo.cpp @@ -986,7 +986,19 @@ void InsetInfo::build() if (initialized_) break; // check in packages.lst - if (LaTeXFeatures::isAvailable(params_.name)) { + bool available; + // we also allow version check with version separated by blank + if (contains(params_.name, ' ')) { + string name; + string const version = split(params_.name, name, ' '); + int const y = convert(version.substr(0,4)); + int const m = convert(version.substr(4,2)); + int const d = convert(version.substr(6,2)); + available = LaTeXFeatures::isAvailableAtLeastFrom(name, y, m, d); + } else + available = LaTeXFeatures::isAvailable(params_.name); + + if (available) { gui = _("yes"); info(from_ascii("yes"), params_.lang); } else {