+char InsetQuotesParams::getStyleChar(QuoteStyle const & style) const
+{
+ return style_char[style];
+}
+
+
+InsetQuotesParams::QuoteStyle InsetQuotesParams::getQuoteStyle(string const & s,
+ bool const allow_wildcards, QuoteStyle fb)
+{
+ QuoteStyle res = fb;
+
+ string str = s;
+ if (str.length() != 3) {
+ LYXERR0("ERROR (InsetQuotes::InsetQuotes):"
+ " bad string length.");
+ str = "eld";
+ }
+
+ int i;
+
+ // '.' wildcard means: keep current style
+ if (!allow_wildcards || str[0] != '.') {
+ for (i = 0; i < stylescount(); ++i) {
+ if (str[0] == style_char[i]) {
+ res = QuoteStyle(i);
+ break;
+ }
+ }
+ if (i >= stylescount()) {
+ LYXERR0("ERROR (InsetQuotes::InsetQuotes):"
+ " bad style specification.");
+ res = EnglishQuotes;
+ }
+ }
+
+ return res;
+}
+
+
+InsetQuotesParams::QuoteSide InsetQuotesParams::getQuoteSide(string const & s,
+ bool const allow_wildcards, QuoteSide fb)
+{
+ QuoteSide res = fb;
+
+ string str = s;
+ if (str.length() != 3) {
+ LYXERR0("ERROR (InsetQuotes::InsetQuotes):"
+ " bad string length.");
+ str = "eld";
+ }
+
+ int i;
+
+ // '.' wildcard means: keep current side
+ if (!allow_wildcards || str[1] != '.') {
+ for (i = 0; i < 2; ++i) {
+ if (str[1] == side_char[i]) {
+ res = InsetQuotesParams::QuoteSide(i);
+ break;
+ }
+ }
+ if (i >= 2) {
+ LYXERR0("ERROR (InsetQuotes::InsetQuotes):"
+ " bad side specification.");
+ res = OpeningQuote;
+ }
+ }
+
+ return res;
+}
+
+
+InsetQuotesParams::QuoteLevel InsetQuotesParams::getQuoteLevel(string const & s,
+ bool const allow_wildcards, QuoteLevel fb)
+{
+ QuoteLevel res = fb;
+
+ string str = s;
+ if (str.length() != 3) {
+ LYXERR0("ERROR (InsetQuotes::InsetQuotes):"
+ " bad string length.");
+ str = "eld";
+ }
+
+ int i;
+
+ // '.' wildcard means: keep current level
+ if (!allow_wildcards || str[2] != '.') {
+ for (i = 0; i < 2; ++i) {
+ if (str[2] == level_char[i]) {
+ res = InsetQuotesParams::QuoteLevel(i);
+ break;
+ }
+ }
+ if (i >= 2) {
+ LYXERR0("ERROR (InsetQuotes::InsetQuotes):"
+ " bad level specification.");
+ res = InsetQuotesParams::PrimaryQuotes;
+ }
+ }
+
+ return res;
+}
+
+