mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Store spellchecker_esc_chars as a docstring
This is a minor optimization to avoid calling from_utf8() repeatedly on a hot path.
This commit is contained in:
parent
2f7d759108
commit
23379bb1d5
@ -2419,7 +2419,7 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
|
|||||||
case RC_ESC_CHARS:
|
case RC_ESC_CHARS:
|
||||||
if (ignore_system_lyxrc ||
|
if (ignore_system_lyxrc ||
|
||||||
spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
|
spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
|
||||||
os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
|
os << "\\escape_chars \"" << to_utf8(spellchecker_esc_chars) << "\"\n";
|
||||||
}
|
}
|
||||||
if (tag != RC_LAST)
|
if (tag != RC_LAST)
|
||||||
break;
|
break;
|
||||||
|
@ -372,7 +372,7 @@ public:
|
|||||||
/// Alternate language for spellchecker
|
/// Alternate language for spellchecker
|
||||||
std::string spellchecker_alt_lang;
|
std::string spellchecker_alt_lang;
|
||||||
/// Escape characters
|
/// Escape characters
|
||||||
std::string spellchecker_esc_chars;
|
docstring spellchecker_esc_chars;
|
||||||
/// Accept compound words in spellchecker?
|
/// Accept compound words in spellchecker?
|
||||||
bool spellchecker_accept_compound = false;
|
bool spellchecker_accept_compound = false;
|
||||||
/// spellcheck continuously?
|
/// spellcheck continuously?
|
||||||
|
@ -4275,8 +4275,8 @@ bool Paragraph::isWordSeparator(pos_type pos, bool const ignore_deleted) const
|
|||||||
return false;
|
return false;
|
||||||
char_type const c = d->text_[pos];
|
char_type const c = d->text_[pos];
|
||||||
// We want to pass the escape chars to the spellchecker
|
// We want to pass the escape chars to the spellchecker
|
||||||
docstring const escape_chars = from_utf8(lyxrc.spellchecker_esc_chars);
|
return !isLetterChar(c) && !isDigitASCII(c)
|
||||||
return !isLetterChar(c) && !isDigitASCII(c) && !contains(escape_chars, c);
|
&& !contains(lyxrc.spellchecker_esc_chars, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1515,7 +1515,7 @@ void PrefSpellchecker::applyRC(LyXRC & rc) const
|
|||||||
if (!speller.empty())
|
if (!speller.empty())
|
||||||
rc.spellchecker = speller;
|
rc.spellchecker = speller;
|
||||||
rc.spellchecker_alt_lang = fromqstr(altLanguageED->text());
|
rc.spellchecker_alt_lang = fromqstr(altLanguageED->text());
|
||||||
rc.spellchecker_esc_chars = fromqstr(escapeCharactersED->text());
|
rc.spellchecker_esc_chars = qstring_to_ucs4(escapeCharactersED->text());
|
||||||
rc.spellchecker_accept_compound = compoundWordCB->isChecked();
|
rc.spellchecker_accept_compound = compoundWordCB->isChecked();
|
||||||
rc.spellcheck_continuously = spellcheckContinuouslyCB->isChecked();
|
rc.spellcheck_continuously = spellcheckContinuouslyCB->isChecked();
|
||||||
rc.spellcheck_notes = spellcheckNotesCB->isChecked();
|
rc.spellcheck_notes = spellcheckNotesCB->isChecked();
|
||||||
|
Loading…
Reference in New Issue
Block a user