Removed extra space from end of country patterns.
This commit is contained in:
parent
900a7d0b2b
commit
54e76c0b71
|
@ -397,9 +397,10 @@ FormatResult CountriesInstance::format(FormatArgs args) {
|
||||||
}
|
}
|
||||||
currentPatternPos++;
|
currentPatternPos++;
|
||||||
}
|
}
|
||||||
if (!args.onlyGroups && (currentPatternPos == pattern.size())) {
|
// Don't add an extra space to the end.
|
||||||
result += ' ';
|
// if (!args.onlyGroups && (currentPatternPos == pattern.size())) {
|
||||||
}
|
// result += ' ';
|
||||||
|
// }
|
||||||
if ((currentPatternPos >= pattern.size())
|
if ((currentPatternPos >= pattern.size())
|
||||||
|| (pattern[currentPatternPos] == 'X')) {
|
|| (pattern[currentPatternPos] == 'X')) {
|
||||||
currentPatternPos++;
|
currentPatternPos++;
|
||||||
|
|
|
@ -158,9 +158,13 @@ void PhonePartInput::correctValue(
|
||||||
if (leftInPart) {
|
if (leftInPart) {
|
||||||
--leftInPart;
|
--leftInPart;
|
||||||
} else {
|
} else {
|
||||||
newText += ' ';
|
|
||||||
++curPart;
|
++curPart;
|
||||||
inPart = curPart < _pattern.size();
|
inPart = curPart < _pattern.size();
|
||||||
|
// Don't add an extra space to the end.
|
||||||
|
if (inPart) {
|
||||||
|
newText += ' ';
|
||||||
|
}
|
||||||
|
|
||||||
leftInPart = inPart ? (_pattern.at(curPart) - 1) : 0;
|
leftInPart = inPart ? (_pattern.at(curPart) - 1) : 0;
|
||||||
|
|
||||||
++oldPos;
|
++oldPos;
|
||||||
|
@ -389,9 +393,12 @@ void PhoneInput::correctValue(
|
||||||
if (leftInPart) {
|
if (leftInPart) {
|
||||||
--leftInPart;
|
--leftInPart;
|
||||||
} else {
|
} else {
|
||||||
newText += ' ';
|
|
||||||
++curPart;
|
++curPart;
|
||||||
inPart = curPart < _pattern.size();
|
inPart = curPart < _pattern.size();
|
||||||
|
// Don't add an extra space to the end.
|
||||||
|
if (inPart) {
|
||||||
|
newText += ' ';
|
||||||
|
}
|
||||||
leftInPart = inPart ? (_pattern.at(curPart) - 1) : 0;
|
leftInPart = inPart ? (_pattern.at(curPart) - 1) : 0;
|
||||||
|
|
||||||
++oldPos;
|
++oldPos;
|
||||||
|
|
Loading…
Reference in New Issue