summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@theqtcompany.com>2016-01-18 17:20:48 +0100
committerEdward Welbourne <edward.welbourne@theqtcompany.com>2016-01-29 10:34:57 +0000
commitee6463ffd3d12f9d5b4c90d22ca9fcab30483ebc (patch)
treefb08a58cfa248d05d961116542e172d2a328b24c
parentfbe7000ba3fa1edbeeaacaa529c25510d69f3472 (diff)
Refactor one QDateTimeParser::sectionText() via the other.
Avoid duplicated code thereby. Change-Id: Icb4e95887e92e8fe8f172329cc383f9e868874a4 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
-rw-r--r--src/corelib/tools/qdatetimeparser.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/corelib/tools/qdatetimeparser.cpp b/src/corelib/tools/qdatetimeparser.cpp
index 1ffdf8e9ab..26c17b24ce 100644
--- a/src/corelib/tools/qdatetimeparser.cpp
+++ b/src/corelib/tools/qdatetimeparser.cpp
@@ -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);
}