X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fsupport%2Fdocstring.cpp;h=c937ba3721a1157bd2acff7d0bc754b74b0e614e;hb=0a9735c5f7bbbaa24ac2e3e4fa745c6dfbc95a18;hp=86deda1d869de654064c2a38c661d47c08c93a48;hpb=c68d754a749f2b5d162868544c07c21d6168b84b;p=lyx.git diff --git a/src/support/docstring.cpp b/src/support/docstring.cpp index 86deda1d86..c937ba3721 100644 --- a/src/support/docstring.cpp +++ b/src/support/docstring.cpp @@ -25,6 +25,7 @@ using namespace std; +using lyx::support::isHexChar; namespace lyx { @@ -132,7 +133,7 @@ string const to_local8bit(docstring const & s) if (s.empty()) return string(); QByteArray const local = toqstr(s).toLocal8Bit(); - if (local.size() == 0) + if (local.isEmpty()) throw to_local8bit_failure(); return string(local.begin(), local.end()); } @@ -753,9 +754,9 @@ private: bool isNumpunct(lyx::char_type const c) const { /// Only account for the standard numpunct "C" locale facet. - return c < 0x80 && (c == '-' || c == '+' || isdigit(c) - || ('a' <= c && c <= 'f') || ('A' <= c && c <= 'F') - || c == 'x' || c == 'X'); + return c == '-' || c == '+' + || c == 'x' || c == 'X' + || isHexChar(c); } template