[LyX/master] Simplify InsetQuotes constructors

Yuriy Skalko yuriy.skalko at gmail.com
Wed Nov 25 00:14:48 UTC 2020


commit 8e60182f588a62e27a1eedabec7c94bfa85a80f3
Author: Yuriy Skalko <yuriy.skalko at gmail.com>
Date:   Tue Nov 24 22:42:06 2020 +0200

    Simplify InsetQuotes constructors
---
 src/insets/InsetQuotes.cpp |   13 ++-----------
 src/insets/InsetQuotes.h   |   16 ++++++++--------
 2 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/src/insets/InsetQuotes.cpp b/src/insets/InsetQuotes.cpp
index b9b6557..f221dd0 100644
--- a/src/insets/InsetQuotes.cpp
+++ b/src/insets/InsetQuotes.cpp
@@ -614,18 +614,12 @@ docstring const InsetQuotesParams::getShortGuiLabel(docstring const & str) const
 ///////////////////////////////////////////////////////////////////////
 
 InsetQuotes::InsetQuotes(Buffer * buf, string const & str)
-	: Inset(buf),
-	  style_(InsetQuotesParams::EnglishQuotes), side_(InsetQuotesParams::OpeningQuote),
-	  pass_thru_(false), internal_fontenc_(false), rtl_(false)
+	: Inset(buf)
 {
 	if (buf) {
 		global_style_ = buf->masterBuffer()->params().quotes_style;
 		fontspec_ = buf->masterBuffer()->params().useNonTeXFonts;
 	}
-	else {
-		global_style_ = InsetQuotesParams::EnglishQuotes;
-		fontspec_ = false;
-	}
 
 	parseString(str);
 }
@@ -633,8 +627,7 @@ InsetQuotes::InsetQuotes(Buffer * buf, string const & str)
 
 InsetQuotes::InsetQuotes(Buffer * buf, char_type c, InsetQuotesParams::QuoteLevel level,
 			 string const & side, string const & style)
-	: Inset(buf), level_(level), pass_thru_(false), fontspec_(false),
-	  internal_fontenc_(false), rtl_(false)
+	: Inset(buf), level_(level)
 {
 	bool dynamic = false;
 	if (buf) {
@@ -643,9 +636,7 @@ InsetQuotes::InsetQuotes(Buffer * buf, char_type c, InsetQuotesParams::QuoteLeve
 		dynamic = buf->masterBuffer()->params().dynamic_quotes;
 		fontspec_ = buf->masterBuffer()->params().useNonTeXFonts;
 	} else {
-		global_style_ = InsetQuotesParams::EnglishQuotes;
 		fontenc_ = "OT1";
-		fontspec_ = false;
 	}
 	if (style.empty())
 		style_ = dynamic ? InsetQuotesParams::DynamicQuotes : global_style_;
diff --git a/src/insets/InsetQuotes.h b/src/insets/InsetQuotes.h
index b4d96ff..62ba28d 100644
--- a/src/insets/InsetQuotes.h
+++ b/src/insets/InsetQuotes.h
@@ -187,25 +187,25 @@ private:
 	InsetQuotesParams::QuoteStyle getStyle(std::string const &);
 
 	///
-	InsetQuotesParams::QuoteStyle style_;
+	InsetQuotesParams::QuoteStyle style_ = InsetQuotesParams::EnglishQuotes;
 	///
-	InsetQuotesParams::QuoteSide side_;
+	InsetQuotesParams::QuoteSide side_ = InsetQuotesParams::OpeningQuote;
 	///
-	InsetQuotesParams::QuoteLevel level_;
+	InsetQuotesParams::QuoteLevel level_ = InsetQuotesParams::PrimaryQuotes;
 	///
-	InsetQuotesParams::QuoteStyle global_style_;
+	InsetQuotesParams::QuoteStyle global_style_ = InsetQuotesParams::EnglishQuotes;
 	/// Current font encoding
 	std::string fontenc_;
 	/// Code of the contextual language
 	std::string context_lang_;
 	/// Is this in a pass-thru context?
-	bool pass_thru_;
+	bool pass_thru_ = false;
 	/// Do we use fontspec?
-	bool fontspec_;
+	bool fontspec_ = false;
 	/// Do we have an internal font encoding?
-	bool internal_fontenc_;
+	bool internal_fontenc_ = false;
 	/// Are we writing RTL?
-	bool rtl_;
+	bool rtl_ = false;
 	///
 	friend class InsetQuotesParams;
 


More information about the lyx-cvs mailing list