Remove unnecessary type conversion
Change-Id: I09e3e4596a8c79b3ece08c694010c76e05d8a22b Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This commit is contained in:
parent
bc71496a34
commit
87098106d0
@ -1208,44 +1208,44 @@ QString QWidgetLineControl::maskString(int pos, const QString &str, bool clear)
|
||||
if (strIndex < str.length()) {
|
||||
if (m_maskData[i].separator) {
|
||||
s += m_maskData[i].maskChar;
|
||||
if (str[(int)strIndex] == m_maskData[i].maskChar)
|
||||
if (str[strIndex] == m_maskData[i].maskChar)
|
||||
strIndex++;
|
||||
++i;
|
||||
} else {
|
||||
if (isValidInput(str[(int)strIndex], m_maskData[i].maskChar)) {
|
||||
if (isValidInput(str[strIndex], m_maskData[i].maskChar)) {
|
||||
switch (m_maskData[i].caseMode) {
|
||||
case MaskInputData::Upper:
|
||||
s += str[(int)strIndex].toUpper();
|
||||
s += str[strIndex].toUpper();
|
||||
break;
|
||||
case MaskInputData::Lower:
|
||||
s += str[(int)strIndex].toLower();
|
||||
s += str[strIndex].toLower();
|
||||
break;
|
||||
default:
|
||||
s += str[(int)strIndex];
|
||||
s += str[strIndex];
|
||||
}
|
||||
++i;
|
||||
} else {
|
||||
// search for separator first
|
||||
int n = findInMask(i, true, true, str[(int)strIndex]);
|
||||
int n = findInMask(i, true, true, str[strIndex]);
|
||||
if (n != -1) {
|
||||
if (str.length() != 1 || i == 0 || (i > 0 && (!m_maskData[i-1].separator || m_maskData[i-1].maskChar != str[(int)strIndex]))) {
|
||||
if (str.length() != 1 || i == 0 || (i > 0 && (!m_maskData[i-1].separator || m_maskData[i-1].maskChar != str[strIndex]))) {
|
||||
s += QStringView{fill}.mid(i, n - i + 1);
|
||||
i = n + 1; // update i to find + 1
|
||||
}
|
||||
} else {
|
||||
// search for valid m_blank if not
|
||||
n = findInMask(i, true, false, str[(int)strIndex]);
|
||||
n = findInMask(i, true, false, str[strIndex]);
|
||||
if (n != -1) {
|
||||
s += QStringView{fill}.mid(i, n - i);
|
||||
switch (m_maskData[n].caseMode) {
|
||||
case MaskInputData::Upper:
|
||||
s += str[(int)strIndex].toUpper();
|
||||
s += str[strIndex].toUpper();
|
||||
break;
|
||||
case MaskInputData::Lower:
|
||||
s += str[(int)strIndex].toLower();
|
||||
s += str[strIndex].toLower();
|
||||
break;
|
||||
default:
|
||||
s += str[(int)strIndex];
|
||||
s += str[strIndex];
|
||||
}
|
||||
i = n + 1; // updates i to find + 1
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user