File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ bool TonalUtils::Supported()
38
38
return false ;
39
39
}
40
40
41
- #define RE_TONAL_DIGIT " [\\ d\\ xe8e9 -\\ xe8ef\\ xe9d9 -\\ xe9df]"
41
+ #define RE_TONAL_DIGIT " [\\ d\\ xe8e0 -\\ xe8ef\\ xe9d0 -\\ xe9df]"
42
42
static QRegExpValidator tv (QRegExp(" -?(?:" RE_TONAL_DIGIT " +\\ .?|" RE_TONAL_DIGIT " *\\ ." RE_TONAL_DIGIT " *)" ), nullptr);
43
43
44
44
QValidator::State TonalUtils::validate (QString&input, int &pos)
@@ -67,15 +67,15 @@ void TonalUtils::ConvertToHex(QString&str)
67
67
for (int i = 0 ; i < str.size (); ++i)
68
68
{
69
69
ushort c = str[i].unicode ();
70
- if (c == 0xe9d9 || c == 0xe8e9 ) {
71
- str[i] = ' 9' ;
72
- }
73
- else
74
70
if (c == ' 9' )
75
71
str[i] = ' a' ;
76
72
else
77
- if (c >= 0xe8ea && c <= 0xe8ef ) {
73
+ if (c >= 0xe8e0 && c <= 0xe8e9 ) { // UCSUR 0-9
74
+ str[i] = c - (0xe8e0 - ' 0' );
75
+ } else if (c >= 0xe8ea && c <= 0xe8ef ) { // UCSUR a-f
78
76
str[i] = c - (0xe8ea - ' a' );
77
+ } else if (c >= 0xe9d0 && c <= 0xe9d9 ) {
78
+ str[i] = c - (0xe9d0 - ' 0' );
79
79
} else
80
80
if (c >= 0xe9da && c <= 0xe9df )
81
81
str[i] = c - 0xe999 ;
You can’t perform that action at this time.
0 commit comments