mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 21:57:10 +02:00
Removed extra space from end of country patterns.
This commit is contained in:
parent
900a7d0b2b
commit
54e76c0b71
2 changed files with 13 additions and 5 deletions
|
@ -397,9 +397,10 @@ FormatResult CountriesInstance::format(FormatArgs args) {
|
|||
}
|
||||
currentPatternPos++;
|
||||
}
|
||||
if (!args.onlyGroups && (currentPatternPos == pattern.size())) {
|
||||
result += ' ';
|
||||
}
|
||||
// Don't add an extra space to the end.
|
||||
// if (!args.onlyGroups && (currentPatternPos == pattern.size())) {
|
||||
// result += ' ';
|
||||
// }
|
||||
if ((currentPatternPos >= pattern.size())
|
||||
|| (pattern[currentPatternPos] == 'X')) {
|
||||
currentPatternPos++;
|
||||
|
|
|
@ -158,9 +158,13 @@ void PhonePartInput::correctValue(
|
|||
if (leftInPart) {
|
||||
--leftInPart;
|
||||
} else {
|
||||
newText += ' ';
|
||||
++curPart;
|
||||
inPart = curPart < _pattern.size();
|
||||
// Don't add an extra space to the end.
|
||||
if (inPart) {
|
||||
newText += ' ';
|
||||
}
|
||||
|
||||
leftInPart = inPart ? (_pattern.at(curPart) - 1) : 0;
|
||||
|
||||
++oldPos;
|
||||
|
@ -389,9 +393,12 @@ void PhoneInput::correctValue(
|
|||
if (leftInPart) {
|
||||
--leftInPart;
|
||||
} else {
|
||||
newText += ' ';
|
||||
++curPart;
|
||||
inPart = curPart < _pattern.size();
|
||||
// Don't add an extra space to the end.
|
||||
if (inPart) {
|
||||
newText += ' ';
|
||||
}
|
||||
leftInPart = inPart ? (_pattern.at(curPart) - 1) : 0;
|
||||
|
||||
++oldPos;
|
||||
|
|
Loading…
Add table
Reference in a new issue