QDateTimeParser: proper construction of QString
... with known size and known char by corresponding ctor. Don't use fill() for this case. Change-Id: I475a0655132ecbb40b1eac919309597b2560e71b Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>bb10
parent
c906d7abb8
commit
7abb90a70a
|
|
@ -847,7 +847,7 @@ int QDateTimeParser::parseSection(const QDateTime ¤tValue, int sectionInde
|
|||
if (skipToNextSection(sectionIndex, currentValue, digitsStr)) {
|
||||
state = Acceptable;
|
||||
const int missingZeroes = sectionmaxsize - digitsStr.size();
|
||||
text.insert(index, QString().fill(QLatin1Char('0'), missingZeroes));
|
||||
text.insert(index, QString(missingZeroes, QLatin1Char('0')));
|
||||
used = sectionmaxsize;
|
||||
cursorPosition += missingZeroes;
|
||||
++(const_cast<QDateTimeParser*>(this)->sectionNodes[sectionIndex].zeroesAdded);
|
||||
|
|
|
|||
Loading…
Reference in New Issue