[LyX/master] Adapt inset info to new version check

Juergen Spitzmueller spitz at lyx.org
Mon Dec 19 15:46:27 UTC 2022


commit 9966b4be4a44fc7c64e0e612a209835efa4b9465
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Mon Dec 19 17:42:49 2022 +0100

    Adapt inset info to new version check
---
 lib/doc/LaTeXConfig.lyx  |    4 ++--
 src/insets/InsetInfo.cpp |   14 +++++++++++++-
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/lib/doc/LaTeXConfig.lyx b/lib/doc/LaTeXConfig.lyx
index 99621cb..83e651c 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 ed2566e..46d656c 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<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 {


More information about the lyx-cvs mailing list