mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-01 07:05:13 +00:00
Removed extra space from end of country patterns.
This commit is contained in:
@@ -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;
|
||||||
|
Reference in New Issue
Block a user