Adapt inset info to new version check

This commit is contained in:
Juergen Spitzmueller 2022-12-19 17:42:49 +01:00
parent 2e6ea5f613
commit 9966b4be4a
2 changed files with 15 additions and 3 deletions

View File

@ -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
),

View File

@ -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<int>(version.substr(0,4));
int const m = convert<int>(version.substr(4,2));
int const d = convert<int>(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 {