[LyX/master] requires is a keyword in C++2a

Richard Kimberly Heck rikiheck at lyx.org
Sun May 3 05:57:28 UTC 2020


commit 16e7f26cec287d12b4ccc419935465133598e68e
Author: Richard Kimberly Heck <rikiheck at lyx.org>
Date:   Sun May 3 02:18:17 2020 -0400

    requires is a keyword in C++2a
---
 src/Layout.cpp             |    6 +++---
 src/Layout.h               |    2 +-
 src/insets/InsetLayout.cpp |    2 +-
 src/output_latex.cpp       |    6 +++---
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/Layout.cpp b/src/Layout.cpp
index 3c1a9bd..3ed2ddf 100644
--- a/src/Layout.cpp
+++ b/src/Layout.cpp
@@ -1074,7 +1074,7 @@ void Layout::readArgument(Lexer & lex)
 			arg.tooltip = lex.getDocString();
 		} else if (tok == "requires") {
 			lex.next();
-			arg.requires = lex.getString();
+			arg.required = lex.getString();
 		} else if (tok == "decoration") {
 			lex.next();
 			arg.decoration = lex.getString();
@@ -1150,8 +1150,8 @@ void writeArgument(ostream & os, string const & id, Layout::latexarg const & arg
 		os << "\t\tPresetArg \"" << to_utf8(arg.presetarg) << "\"\n";
 	if (!arg.tooltip.empty())
 		os << "\t\tToolTip \"" << to_utf8(arg.tooltip) << "\"\n";
-	if (!arg.requires.empty())
-		os << "\t\tRequires \"" << arg.requires << "\"\n";
+	if (!arg.required.empty())
+		os << "\t\tRequires \"" << arg.required << "\"\n";
 	if (!arg.decoration.empty())
 		os << "\t\tDecoration \"" << arg.decoration << "\"\n";
 	if (!arg.newlinecmd.empty())
diff --git a/src/Layout.h b/src/Layout.h
index c8f7c95..edb9ba7 100644
--- a/src/Layout.h
+++ b/src/Layout.h
@@ -100,7 +100,7 @@ public:
 		docstring defaultarg;
 		docstring presetarg;
 		docstring tooltip;
-		std::string requires;
+		std::string required;
 		std::string decoration;
 		FontInfo font;
 		FontInfo labelfont;
diff --git a/src/insets/InsetLayout.cpp b/src/insets/InsetLayout.cpp
index dbe2909..8df2ca5 100644
--- a/src/insets/InsetLayout.cpp
+++ b/src/insets/InsetLayout.cpp
@@ -689,7 +689,7 @@ void InsetLayout::readArgument(Lexer & lex)
 			arg.tooltip = lex.getDocString();
 		} else if (tok == "requires") {
 			lex.next();
-			arg.requires = lex.getString();
+			arg.required = lex.getString();
 		} else if (tok == "decoration") {
 			lex.next();
 			arg.decoration = lex.getString();
diff --git a/src/output_latex.cpp b/src/output_latex.cpp
index 1185e2d..72a4577 100644
--- a/src/output_latex.cpp
+++ b/src/output_latex.cpp
@@ -474,8 +474,8 @@ void getArgInsets(otexstream & os, OutputParams const & runparams, Layout::LaTeX
 	// other arguments, consider this.
 	for (auto const & larg : latexargs) {
 		Layout::latexarg const & arg = larg.second;
-		if ((!arg.presetarg.empty() || !arg.defaultarg.empty()) && !arg.requires.empty()) {
-				vector<string> req = getVectorFromString(arg.requires);
+		if ((!arg.presetarg.empty() || !arg.defaultarg.empty()) && !arg.required.empty()) {
+				vector<string> req = getVectorFromString(arg.required);
 				required.insert(required.end(), req.begin(), req.end());
 			}
 	}
@@ -609,7 +609,7 @@ void addArgInsets(Paragraph const & par, string const & prefix,
 			latexargs.find(arg->name());
 		if (lit != latexargs.end()) {
 			Layout::latexarg const & larg = lit->second;
-			vector<string> req = getVectorFromString(larg.requires);
+			vector<string> req = getVectorFromString(larg.required);
 			move(req.begin(), req.end(), back_inserter(required));
 		}
 	}


More information about the lyx-cvs mailing list