[LyX features/biginset] DocBook: authorsToDocBookAuthorGroup never needs to return anything.

Thibaut Cuvelier tcuvelier at lyx.org
Fri Apr 5 13:41:38 UTC 2024


commit 3973bbcf9915ad16cdd7dec3c20bd2f722dfb52e
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Fri Mar 1 13:32:17 2024 +0100

    DocBook: authorsToDocBookAuthorGroup never needs to return anything.
---
 src/BiblioInfo.cpp | 11 +++++------
 src/BiblioInfo.h   |  2 +-
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/BiblioInfo.cpp b/src/BiblioInfo.cpp
index a9245c6a77..0f697ab297 100644
--- a/src/BiblioInfo.cpp
+++ b/src/BiblioInfo.cpp
@@ -1748,7 +1748,7 @@ string citationStyleToString(const CitationStyle & cs, bool const latex)
 }
 
 
-docstring authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream & xs, Buffer const & buf)
+void authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream & xs, Buffer const & buf)
 {
 	// This function closely mimics getAuthorList, but produces DocBook instead of text.
 	// It has been greatly simplified, as the complete list of authors is always produced. No separators are required,
@@ -1756,7 +1756,7 @@ docstring authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream
 	// constructName has also been merged within, as it becomes really simple and leads to no copy-paste.
 
 	if (authorsString.empty()) {
-		return docstring();
+		return;
 	}
 
 	// Split the input list of authors into individual authors.
@@ -1776,9 +1776,10 @@ docstring authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream
 		xs << xml::CR();
 		xs << xml::StartTag("personname");
 		xs << xml::CR();
-		docstring name = *it;
+		const docstring name = *it;
 
-		// All authors go in a <personname>. If more structure is known, use it; otherwise (just "et al."), print it as such.
+		// All authors go in a <personname>. If more structure is known, use it; otherwise (just "et al."),
+		// print it as such.
 		if (name == "others") {
 			xs << buf.B_(etal);
 		} else {
@@ -1818,8 +1819,6 @@ docstring authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream
 	}
 	xs << xml::EndTag("authorgroup");
 	xs << xml::CR();
-
-	return docstring();
 }
 
 } // namespace lyx
diff --git a/src/BiblioInfo.h b/src/BiblioInfo.h
index f4051bf225..7a8ffb9081 100644
--- a/src/BiblioInfo.h
+++ b/src/BiblioInfo.h
@@ -37,7 +37,7 @@ CitationStyle citationStyleFromString(std::string const & latex_str,
 std::string citationStyleToString(CitationStyle const &, bool const latex = false);
 
 /// Transforms the information about authors into a <authorgroup> (directly written to a XMLStream).
-docstring authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream & xs, Buffer const & buf);
+void authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream & xs, Buffer const & buf);
 
 
 /// Class to represent information about a BibTeX or


More information about the lyx-cvs mailing list