+ else {
+ global_style_ = InsetQuotesParams::EnglishQuotes;
+ fontspec_ = false;
+ }
+
+ parseString(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)
+{
+ bool dynamic = false;
+ if (buf) {
+ global_style_ = buf->masterBuffer()->params().quotes_style;
+ fontenc_ = buf->masterBuffer()->params().main_font_encoding();
+ dynamic = buf->masterBuffer()->params().dynamic_quotes;
+ fontspec_ = buf->masterBuffer()->params().useNonTeXFonts;
+ } else {
+ global_style_ = InsetQuotesParams::EnglishQuotes;
+ fontenc_ = lyxrc.fontenc;
+ fontspec_ = false;
+ }
+ if (style.empty())
+ style_ = dynamic ? InsetQuotesParams::DynamicQuotes : global_style_;
+ else
+ style_ = getStyle(style);
+
+ if (side == "left" || side == "opening")
+ side_ = InsetQuotesParams::OpeningQuote;
+ else if (side == "right" || side == "closing")
+ side_ = InsetQuotesParams::ClosingQuote;
+ else
+ setSide(c);
+}
+
+
+docstring InsetQuotes::layoutName() const
+{
+ return from_ascii("Quotes");
+}
+
+
+void InsetQuotes::setSide(char_type c)
+{
+ // Decide whether opening or closing quote
+ if (lyx::isSpace(c) || isOpenPunctuation(c))
+ side_ = InsetQuotesParams::OpeningQuote;// opening quote
+ else
+ side_ = InsetQuotesParams::ClosingQuote;// closing quote
+}
+
+
+void InsetQuotes::parseString(string const & s, bool const allow_wildcards)
+{
+ style_ = quoteparams.getQuoteStyle(s, allow_wildcards, style_);
+ side_ = quoteparams.getQuoteSide(s, allow_wildcards, side_);
+ level_ = quoteparams.getQuoteLevel(s, allow_wildcards, level_);
+}
+
+
+InsetQuotesParams::QuoteStyle InsetQuotes::getStyle(string const & s)
+{
+ InsetQuotesParams::QuoteStyle qs = InsetQuotesParams::EnglishQuotes;
+
+ if (s == "english")
+ qs = InsetQuotesParams::EnglishQuotes;
+ else if (s == "swedish")
+ qs = InsetQuotesParams::SwedishQuotes;
+ else if (s == "german")
+ qs = InsetQuotesParams::GermanQuotes;
+ else if (s == "polish")
+ qs = InsetQuotesParams::PolishQuotes;
+ else if (s == "swiss")
+ qs = InsetQuotesParams::SwissQuotes;
+ else if (s == "danish")
+ qs = InsetQuotesParams::DanishQuotes;
+ else if (s == "plain")
+ qs = InsetQuotesParams::PlainQuotes;
+ else if (s == "british")
+ qs = InsetQuotesParams::BritishQuotes;
+ else if (s == "swedishg")
+ qs = InsetQuotesParams::SwedishGQuotes;
+ else if (s == "french")
+ qs = InsetQuotesParams::FrenchQuotes;
+ else if (s == "frenchin")
+ qs = InsetQuotesParams::FrenchINQuotes;
+ else if (s == "russian")
+ qs = InsetQuotesParams::RussianQuotes;
+ else if (s == "cjk")
+ qs = InsetQuotesParams::CJKQuotes;
+ else if (s == "cjkangle")
+ qs = InsetQuotesParams::CJKAngleQuotes;
+ else if (s == "dynamic")
+ qs = InsetQuotesParams::DynamicQuotes;
+
+ return qs;