mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
* lstring.cpp:
- isAscii(): char is signed with MSVC so the comparison was not correct. Add a static_cast to "unsigned char" as per the other methods. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19001 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
9051f93625
commit
46214d708c
@ -248,7 +248,17 @@ bool isAscii(docstring const & str)
|
||||
{
|
||||
int const len = str.length();
|
||||
for (int i = 0; i < len; ++i)
|
||||
if (str[i] >= 0x80)
|
||||
if (static_cast<unsigned char>(str[i]) >= 0x80)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool isAscii(string const & str)
|
||||
{
|
||||
int const len = str.length();
|
||||
for (int i = 0; i < len; ++i)
|
||||
if (static_cast<unsigned char>(str[i]) >= 0x80)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
@ -72,6 +72,9 @@ int hexToInt(lyx::docstring const & str);
|
||||
/// is \p str pure ascii?
|
||||
bool isAscii(docstring const & str);
|
||||
|
||||
/// is \p str pure ascii?
|
||||
bool isAscii(std::string const & str);
|
||||
|
||||
/**
|
||||
* Changes the case of \p c to lowercase.
|
||||
* Don't use this for non-ASCII characters, since it depends on the locale.
|
||||
|
Loading…
Reference in New Issue
Block a user