mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-12 22:14:35 +00:00
Simplify InsetQuotes constructors
This commit is contained in:
parent
fe0ea7bff7
commit
8e60182f58
@ -614,18 +614,12 @@ docstring const InsetQuotesParams::getShortGuiLabel(docstring const & str) const
|
|||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
InsetQuotes::InsetQuotes(Buffer * buf, string const & str)
|
InsetQuotes::InsetQuotes(Buffer * buf, string const & str)
|
||||||
: Inset(buf),
|
: Inset(buf)
|
||||||
style_(InsetQuotesParams::EnglishQuotes), side_(InsetQuotesParams::OpeningQuote),
|
|
||||||
pass_thru_(false), internal_fontenc_(false), rtl_(false)
|
|
||||||
{
|
{
|
||||||
if (buf) {
|
if (buf) {
|
||||||
global_style_ = buf->masterBuffer()->params().quotes_style;
|
global_style_ = buf->masterBuffer()->params().quotes_style;
|
||||||
fontspec_ = buf->masterBuffer()->params().useNonTeXFonts;
|
fontspec_ = buf->masterBuffer()->params().useNonTeXFonts;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
global_style_ = InsetQuotesParams::EnglishQuotes;
|
|
||||||
fontspec_ = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
parseString(str);
|
parseString(str);
|
||||||
}
|
}
|
||||||
@ -633,8 +627,7 @@ InsetQuotes::InsetQuotes(Buffer * buf, string const & str)
|
|||||||
|
|
||||||
InsetQuotes::InsetQuotes(Buffer * buf, char_type c, InsetQuotesParams::QuoteLevel level,
|
InsetQuotes::InsetQuotes(Buffer * buf, char_type c, InsetQuotesParams::QuoteLevel level,
|
||||||
string const & side, string const & style)
|
string const & side, string const & style)
|
||||||
: Inset(buf), level_(level), pass_thru_(false), fontspec_(false),
|
: Inset(buf), level_(level)
|
||||||
internal_fontenc_(false), rtl_(false)
|
|
||||||
{
|
{
|
||||||
bool dynamic = false;
|
bool dynamic = false;
|
||||||
if (buf) {
|
if (buf) {
|
||||||
@ -643,9 +636,7 @@ InsetQuotes::InsetQuotes(Buffer * buf, char_type c, InsetQuotesParams::QuoteLeve
|
|||||||
dynamic = buf->masterBuffer()->params().dynamic_quotes;
|
dynamic = buf->masterBuffer()->params().dynamic_quotes;
|
||||||
fontspec_ = buf->masterBuffer()->params().useNonTeXFonts;
|
fontspec_ = buf->masterBuffer()->params().useNonTeXFonts;
|
||||||
} else {
|
} else {
|
||||||
global_style_ = InsetQuotesParams::EnglishQuotes;
|
|
||||||
fontenc_ = "OT1";
|
fontenc_ = "OT1";
|
||||||
fontspec_ = false;
|
|
||||||
}
|
}
|
||||||
if (style.empty())
|
if (style.empty())
|
||||||
style_ = dynamic ? InsetQuotesParams::DynamicQuotes : global_style_;
|
style_ = dynamic ? InsetQuotesParams::DynamicQuotes : global_style_;
|
||||||
|
@ -187,25 +187,25 @@ private:
|
|||||||
InsetQuotesParams::QuoteStyle getStyle(std::string const &);
|
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
|
/// Current font encoding
|
||||||
std::string fontenc_;
|
std::string fontenc_;
|
||||||
/// Code of the contextual language
|
/// Code of the contextual language
|
||||||
std::string context_lang_;
|
std::string context_lang_;
|
||||||
/// Is this in a pass-thru context?
|
/// Is this in a pass-thru context?
|
||||||
bool pass_thru_;
|
bool pass_thru_ = false;
|
||||||
/// Do we use fontspec?
|
/// Do we use fontspec?
|
||||||
bool fontspec_;
|
bool fontspec_ = false;
|
||||||
/// Do we have an internal font encoding?
|
/// Do we have an internal font encoding?
|
||||||
bool internal_fontenc_;
|
bool internal_fontenc_ = false;
|
||||||
/// Are we writing RTL?
|
/// Are we writing RTL?
|
||||||
bool rtl_;
|
bool rtl_ = false;
|
||||||
///
|
///
|
||||||
friend class InsetQuotesParams;
|
friend class InsetQuotesParams;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user