* src/insets/insetquotes.[Ch]
(InsetQuotes::InsetQuotes): char -> lyx::char_type
* src/support/lstrings.h
(contains): new variant for docstrings
* src/frontends/controllers/ControlSpellchecker.C
(isLetter): Add missing conversion to utf8
(nextWord): ditto
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14867
a592a061-630c-0410-9148-
cb99ea01b6c8
&& dit.pos() != dit.lastpos()
&& (dit.paragraph().isLetter(dit.pos())
// We want to pass the ' and escape chars to ispell
- || contains(lyxrc.isp_esc_chars + '\'',
+ || contains(lyx::from_utf8(lyxrc.isp_esc_chars + '\''),
dit.paragraph().getChar(dit.pos())))
&& !isDeletedText(dit.paragraph(), dit.pos());
}
bool inword = false;
bool ignoreword = false;
cur.resetAnchor();
- string word, lang_code;
+ docstring word;
+ string lang_code;
while (cur.depth()) {
if (isLetter(cur)) {
if (inword)
if (!word.empty() && !ignoreword) {
cur.setSelection();
- return WordLangTuple(word, lang_code);
+ return WordLangTuple(lyx::to_utf8(word), lang_code);
} else
inword = false;
}
{}
-InsetQuotes::InsetQuotes(char c, BufferParams const & params)
+InsetQuotes::InsetQuotes(lyx::char_type c, BufferParams const & params)
: language_(params.quotes_language), times_(params.quotes_times)
{
getPosition(c);
}
-InsetQuotes::InsetQuotes(char c, quote_language l, quote_times t)
+InsetQuotes::InsetQuotes(lyx::char_type c, quote_language l, quote_times t)
: language_(l), times_(t)
{
getPosition(c);
}
-void InsetQuotes::getPosition(char c)
+void InsetQuotes::getPosition(lyx::char_type c)
{
// Decide whether left or right
switch (c) {
#include "inset.h"
+#include "support/types.h"
+
class BufferParams;
class Language;
explicit
InsetQuotes(std::string const & str = "eld");
/// Create the right quote inset after character c
- InsetQuotes(char c, BufferParams const & params);
+ InsetQuotes(lyx::char_type c, BufferParams const & params);
/// Direct access to inner/outer quotation marks
- InsetQuotes(char c, quote_language l, quote_times t);
+ InsetQuotes(lyx::char_type c, quote_language l, quote_times t);
///
void metrics(MetricsInfo &, Dimension &) const;
///
*/
InsetQuotes(quote_language l, quote_side s, quote_times t);
/// Decide whether we need left or right quotation marks
- void getPosition(char c);
+ void getPosition(lyx::char_type c);
///
void parseString(std::string const &);
///
#include "support/types.h"
#include <vector>
-#include <string>
namespace lyx {
return a.find(b) != std::string::npos;
}
+template <typename B>
+bool contains(lyx::docstring const & a, B b)
+{
+ return a.find(b) != lyx::docstring::npos;
+}
+
///
bool containsOnly(std::string const &, std::string const &);