Refactor one QDateTimeParser::sectionText() via the other.

Avoid duplicated code thereby.

Change-Id: Icb4e95887e92e8fe8f172329cc383f9e868874a4
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
bb10
Edward Welbourne 2016-01-18 17:20:48 +01:00
parent fbe7000ba3
commit ee6463ffd3
1 changed files with 1 additions and 9 deletions

View File

@ -669,15 +669,7 @@ QString QDateTimeParser::sectionText(const QString &text, int sectionIndex, int
QString QDateTimeParser::sectionText(int sectionIndex) const
{
const SectionNode &sn = sectionNode(sectionIndex);
switch (sn.type) {
case NoSectionIndex:
case FirstSectionIndex:
case LastSectionIndex:
return QString();
default: break;
}
return displayText().mid(sn.pos, sectionSize(sectionIndex));
return sectionText(displayText(), sectionIndex, sn.pos);
}