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
Anton Kudryavtsev 2016-04-29 15:50:11 +03:00
parent c906d7abb8
commit 7abb90a70a
1 changed files with 1 additions and 1 deletions

View File

@ -847,7 +847,7 @@ int QDateTimeParser::parseSection(const QDateTime &currentValue, 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);