]> git.lyx.org Git - lyx.git/blobdiff - src/support/lstrings.cpp
Maintain plain layout for separating paragraphs when switching layouts (#11936)
[lyx.git] / src / support / lstrings.cpp
index 55e66ce077f717ab3ba71a343a1ff15e54e0848b..df356ba9937fa1fcbd93394f482b98d39fbaf356 100644 (file)
@@ -146,7 +146,7 @@ bool isSpace(char_type c)
 {
        if (!is_utf16(c)) {
                // assume that no non-utf16 character is a space
-               // c outside the UCS4 range is catched as well
+               // c outside the UCS4 range is caught as well
                return false;
        }
        QChar const qc = ucs4_to_qchar(c);
@@ -158,19 +158,19 @@ bool isNumber(char_type c)
 {
        if (!is_utf16(c))
                // assume that no non-utf16 character is a numeral
-               // c outside the UCS4 range is catched as well
+               // c outside the UCS4 range is caught as well
                return false;
        return ucs4_to_qchar(c).isNumber();
 }
 
 
-bool isEuropeanNumberSeparator(char_type c)
+bool isCommonNumberSeparator(char_type c)
 {
        if (!is_utf16(c))
                // assume that no non-utf16 character is a numeral
-               // c outside the UCS4 range is catched as well
+               // c outside the UCS4 range is caught as well
                return false;
-       return ucs4_to_qchar(c).direction() == QChar::DirES;
+       return ucs4_to_qchar(c).direction() == QChar::DirCS;
 }
 
 
@@ -178,7 +178,7 @@ bool isEuropeanNumberTerminator(char_type c)
 {
        if (!is_utf16(c))
                // assume that no non-utf16 character is a numeral
-               // c outside the UCS4 range is catched as well
+               // c outside the UCS4 range is caught as well
                return false;
        return ucs4_to_qchar(c).direction() == QChar::DirET;
 }
@@ -206,7 +206,7 @@ bool isOpenPunctuation(char_type c)
 {
        if (!is_utf16(c)) {
                // assume that no non-utf16 character is an op
-               // c outside the UCS4 range is catched as well
+               // c outside the UCS4 range is caught as well
                return false;
        }
        QChar const qc = ucs4_to_qchar(c);
@@ -406,13 +406,13 @@ bool isHexChar(char_type c)
 
 bool isHex(docstring const & str)
 {
-       int index = 0;
+       size_t index = 0;
 
        if (str.length() > 2 && str[0] == '0' &&
            (str[1] == 'x' || str[1] == 'X'))
                index = 2;
 
-       int const len = str.length();
+       size_t const len = str.length();
 
        for (; index < len; ++index) {
                if (!isHexChar(str[index]))
@@ -433,8 +433,8 @@ unsigned int hexToInt(docstring const & str)
 
 bool isAscii(docstring const & str)
 {
-       int const len = str.length();
-       for (int i = 0; i < len; ++i)
+       size_t const len = str.length();
+       for (size_t i = 0; i < len; ++i)
                if (str[i] >= 0x80)
                        return false;
        return true;
@@ -443,8 +443,8 @@ bool isAscii(docstring const & str)
 
 bool isAscii(string const & str)
 {
-       int const len = str.length();
-       for (int i = 0; i < len; ++i)
+       size_t const len = str.length();
+       for (size_t i = 0; i < len; ++i)
                if (static_cast<unsigned char>(str[i]) >= 0x80)
                        return false;
        return true;
@@ -890,7 +890,7 @@ String const subst_string(String const & a,
        size_t const olen = oldstr.length();
        while ((i = lstr.find(oldstr, i)) != string::npos) {
                lstr.replace(i, olen, newstr);
-               i += newstr.length(); // We need to be sure that we dont
+               i += newstr.length(); // We need to be sure that we don't
                // use the same i over and over again.
        }
        return lstr;
@@ -906,7 +906,7 @@ docstring const subst_string(docstring const & a,
        size_t const olen = oldstr.length();
        while ((i = lstr.find(oldstr, i)) != string::npos) {
                lstr.replace(i, olen, newstr);
-               i += newstr.length(); // We need to be sure that we dont
+               i += newstr.length(); // We need to be sure that we don't
                // use the same i over and over again.
        }
        return lstr;