]> git.lyx.org Git - features.git/blobdiff - src/BufferParams.cpp
Typos
[features.git] / src / BufferParams.cpp
index 4927741e50b44dbb0cb4d7a73e3f874a50e606e9..ec4cc0d60aed42f5ca4c94d4ea8d8bc3f1c2042c 100644 (file)
@@ -478,6 +478,7 @@ BufferParams::BufferParams()
        html_math_img_scale = 1.0;
        html_css_as_file = false;
        docbook_table_output = HTMLTable;
+       docbook_mathml_prefix = MPrefix;
        display_pixel_ratio = 1.0;
 
        shell_escape = false;
@@ -616,6 +617,23 @@ IgnoreList const & BufferParams::spellignore() const
 }
 
 
+bool BufferParams::spellignored(WordLangTuple const & wl) const
+{
+       bool has_item = false;
+       vector<WordLangTuple> il = spellignore();
+       vector<WordLangTuple>::const_iterator it = il.begin();
+       for (; it != il.end(); ++it) {
+               if (it->lang()->code() != wl.lang()->code())
+                       continue;
+               if (it->word() == wl.word()) {
+                       has_item = true;
+                       break;
+               }
+       }
+       return has_item;
+}
+
+
 Bullet & BufferParams::temp_bullet(lyx::size_type const index)
 {
        LASSERT(index < 4, return pimpl_->temp_bullets[0]);
@@ -1051,9 +1069,9 @@ string BufferParams::readToken(Lexer & lex, string const & token,
        } else if (token == "\\spellchecker_ignore") {
                lex.eatLine();
                docstring wl = lex.getDocString();
-               docstring langcode;
-               docstring word = split(wl, langcode, ' ');
-               Language const * lang = languages.getFromCode(to_ascii(langcode));
+               docstring language;
+               docstring word = split(wl, language, ' ');
+               Language const * lang = languages.getLanguage(to_ascii(language));
                if (lang)
                        spellignore().push_back(WordLangTuple(word, lang));
        } else if (token == "\\author") {
@@ -1174,6 +1192,10 @@ string BufferParams::readToken(Lexer & lex, string const & token,
                int temp;
                lex >> temp;
                docbook_table_output = static_cast<TableOutput>(temp);
+       } else if (token == "\\docbook_mathml_prefix") {
+               int temp;
+               lex >> temp;
+               docbook_mathml_prefix = static_cast<MathMLNameSpacePrefix>(temp);
        } else if (token == "\\output_sync") {
                lex >> output_sync;
        } else if (token == "\\output_sync_macro") {
@@ -1433,7 +1455,7 @@ void BufferParams::writeFile(ostream & os, Buffer const * buf) const
        }
 
        for (auto const & si : spellignore()) {
-               os << "\\spellchecker_ignore " << si.lang()->code()
+               os << "\\spellchecker_ignore " << si.lang()->lang()
                   << " " << to_utf8(si.word())
                   << "\n";
        }
@@ -1538,6 +1560,7 @@ void BufferParams::writeFile(ostream & os, Buffer const * buf) const
           << "\\html_be_strict " << convert<string>(html_be_strict) << '\n';
 
        os << "\\docbook_table_output " << docbook_table_output << '\n';
+       os << "\\docbook_mathml_prefix " << docbook_mathml_prefix << '\n';
 
        if (html_math_img_scale != 1.0)
                os << "\\html_math_img_scale " << convert<string>(html_math_img_scale) << '\n';