From c24ad1896a7e877383505daccdc9db56d32709ff Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Thu, 15 Dec 2016 10:55:54 +0100 Subject: Eliminate in/out arguments from QDateTimeParser::parse() Its first two arguments were non-const references that it modified. A copy of the first was already being passed back in the returned struct; and the one caller that wanted the modified value was in fact copying this copy back over the QString it had passed in (that was thus equal already). So passing by value is fine. The second's only change was increment by a field I've just added to StateNode in refactoring parse(); so we can let the caller do that adding, instead. Change-Id: I05abb644f3e5a60f94b03292302dd1bbe996cce9 Reviewed-by: Thiago Macieira --- src/widgets/widgets/qdatetimeedit.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/widgets') diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp index 2e0a8a3cd7..7303e7d25c 100644 --- a/src/widgets/widgets/qdatetimeedit.cpp +++ b/src/widgets/widgets/qdatetimeedit.cpp @@ -1923,6 +1923,7 @@ QDateTime QDateTimeEditPrivate::validateAndInterpret(QString &input, int &positi } StateNode tmp = parse(input, position, value.toDateTime(), fixup); input = tmp.input; + position += tmp.padded; state = QValidator::State(int(tmp.state)); if (state == QValidator::Acceptable) { if (tmp.conflicts && conflictGuard != tmp.value) { -- cgit v1.2.3