[LyX/master] Next attempt at correctly setting fonts in insets depending on inheritFont()

Juergen Spitzmueller spitz at lyx.org
Sun Aug 2 07:47:45 UTC 2020


commit aba8c81290a3c1f8faee7d9f6dbd214440dc523d
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sun Aug 2 10:12:19 2020 +0200

    Next attempt at correctly setting fonts in insets depending on inheritFont()
---
 src/Paragraph.cpp         |    7 ++++---
 src/insets/InsetTabular.h |    2 ++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 3c5f690..f2d97fe 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -2393,8 +2393,9 @@ void Paragraph::latex(BufferParams const & bparams,
 	pos_type body_pos = beginOfBody();
 	unsigned int column = 0;
 
-	// If we are inside an inset, the real outerfont is local_font
-	Font const real_outerfont = (runparams.local_font != nullptr)
+	// If we are inside an non inheritFont() inset, the real outerfont is local_font
+	Font const real_outerfont = (!inInset().inheritFont()
+				     && runparams.local_font != nullptr)
 			? Font(runparams.local_font->fontInfo()) : outerfont;
 
 	if (body_pos > 0) {
@@ -2558,7 +2559,7 @@ void Paragraph::latex(BufferParams const & bparams,
 		++column;
 
 		// Fully instantiated font
-		Font const current_font = getFont(bparams, i, real_outerfont);
+		Font const current_font = getFont(bparams, i, outerfont);
 
 		Font const last_font = running_font;
 		bool const in_ct_deletion = (bparams.output_changes
diff --git a/src/insets/InsetTabular.h b/src/insets/InsetTabular.h
index de26070..d917ab8 100644
--- a/src/insets/InsetTabular.h
+++ b/src/insets/InsetTabular.h
@@ -80,6 +80,8 @@ public:
 				  UpdateType utype, TocBackend & backend) const;
 	///
 	void metrics(MetricsInfo &, Dimension &) const;
+	/// Needs to be same as InsetTabular
+	bool inheritFont() const { return false; }
 private:
 	/// unimplemented
 	InsetTableCell();


More information about the lyx-cvs mailing list