[LyX/master] amend d4f58c96b5d

Juergen Spitzmueller spitz at lyx.org
Sat Jul 27 11:35:51 UTC 2024


commit 5c3b7889991ad670ac46c208f3df9fd45b913de9
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sat Jul 27 13:34:38 2024 +0200

    amend d4f58c96b5d
    
    avoid having to validate the whole buffer just for this information
---
 src/Buffer.cpp       |  1 +
 src/BufferParams.cpp |  1 +
 src/BufferParams.h   |  2 ++
 src/Converter.cpp    | 10 +---------
 4 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index efa6492863..ac2cca9a06 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -1888,6 +1888,7 @@ Buffer::ExportStatus Buffer::writeLaTeXSource(otexstream & os,
 		runparams.use_CJK = features.mustProvide("CJK");
 		runparams.use_memindex = features.isProvided("memoir-idx");
 	}
+	params().use_memindex = features.isProvided("memoir-idx");
 	LYXERR(Debug::OUTFILE, "  Buffer validation done.");
 
 	bool const output_preamble =
diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp
index a81d9af866..c5b1027518 100644
--- a/src/BufferParams.cpp
+++ b/src/BufferParams.cpp
@@ -413,6 +413,7 @@ BufferParams::BufferParams()
 	use_bibtopic = false;
 	multibib = string();
 	use_indices = false;
+	use_memindex = false;
 	save_transient_properties = true;
 	track_changes = false;
 	output_changes = false;
diff --git a/src/BufferParams.h b/src/BufferParams.h
index 72d2117193..d88c54e1af 100644
--- a/src/BufferParams.h
+++ b/src/BufferParams.h
@@ -454,6 +454,8 @@ public:
 	std::string multibib;
 	/// Split the index?
 	bool use_indices;
+	/// do we use the memoir way to split indexes?
+	mutable bool use_memindex;
 	/// Save transient properties?
 	bool save_transient_properties;
 	/// revision tracking for this buffer ? (this is a transient property)
diff --git a/src/Converter.cpp b/src/Converter.cpp
index 21c1938398..1a90f5b325 100644
--- a/src/Converter.cpp
+++ b/src/Converter.cpp
@@ -503,6 +503,7 @@ Converters::RetVal Converters::convert(Buffer const * buffer,
 				&& !bp.useBibtopic()
 				&& bp.multibib == "child";
 		runparams.includeall = includeall;
+		runparams.use_memindex = bp.use_memindex;
 	}
 
 	// Some converters (e.g. lilypond) can only output files to the
@@ -556,15 +557,6 @@ Converters::RetVal Converters::convert(Buffer const * buffer,
 						   "tmpfile.out"));
 		}
 
-		if (buffer && buffer->params().use_indices && conv.latex()) {
-			// We need to validate the buffer to get access to features.
-			// FIXME Not nice that we need to do this here.
-			LYXERR(Debug::OUTFILE, "  Validating buffer...");
-			LaTeXFeatures features(*buffer, buffer->params(), runparams);
-			buffer->validate(features);
-			runparams.use_memindex = features.isProvided("memoir-idx");
-		}
-
 		if (buffer && buffer->params().use_minted
 		    && lyxrc.pygmentize_command.empty() && conv.latex()) {
 			bool dowarn = false;


More information about the lyx-cvs mailing list