Refactor one QDateTimeParser::sectionText() via the other.
Avoid duplicated code thereby. Change-Id: Icb4e95887e92e8fe8f172329cc383f9e868874a4 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>bb10
parent
fbe7000ba3
commit
ee6463ffd3
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue