[LyX/master] consider style-specifics for citation alias

Juergen Spitzmueller spitz at lyx.org
Sat Jul 13 15:22:10 UTC 2024


commit 08c0377f0c1bacab6d05c9d66b60034dacc8885d
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sat Jul 13 17:21:27 2024 +0200

    consider style-specifics for citation alias
---
 src/BufferParams.cpp | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp
index 43b08f9d1b..acc74f6e0c 100644
--- a/src/BufferParams.cpp
+++ b/src/BufferParams.cpp
@@ -3755,10 +3755,17 @@ bool BufferParams::fullAuthorList() const
 
 string BufferParams::getCiteAlias(string const & s) const
 {
-	vector<string> commands =
-		documentClass().citeCommands(citeEngineType());
+	bool realcmd = false;
+	vector<CitationStyle> const styles = citeStyles();
+	for (size_t i = 0; i != styles.size(); ++i) {
+		// only include variants that are supported in the current style
+		if (styles[i].name == s && isActiveBiblatexCiteStyle(styles[i])) {
+			realcmd = true;
+			break;
+		}
+	}
 	// If it is a real command, don't treat it as an alias
-	if (find(commands.begin(), commands.end(), s) != commands.end())
+	if (realcmd)
 		return string();
 	map<string,string> aliases = documentClass().citeCommandAliases();
 	if (aliases.find(s) != aliases.end())


More information about the lyx-cvs mailing list