mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +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++;
|
||||
}
|
||||
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;
|
||||
|
Reference in New Issue
Block a user