aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@crimson.no>2017-01-12 15:01:33 +0100
committerRobin Burchell <robin.burchell@crimson.no>2017-01-16 17:10:07 +0000
commit930385acd8d30a6e0d818806ab893fdce975385f (patch)
treec7a9d4bcee6b658c25fcd49e0baf35eaf0759f47 /src/imports
parentb54690c690b4e457c8c225db1822aa97ae48f021 (diff)
QQuickGridLayout: Remove dead code in layout
The attached isRowSet and isColumnSet check for values >= 0, and row/column getters also enforce a minimum return value of 0, so it is impossible for us to get a negative value for row/column if either of these is set -- and we can simply call the getter and rely on it to return 0 in the unset case. Change-Id: Iec80e7d7cf3738cf0a81e90b027ffe41e0f57369 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/layouts/qquicklinearlayout.cpp19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/imports/layouts/qquicklinearlayout.cpp b/src/imports/layouts/qquicklinearlayout.cpp
index 50b3eed87e..40aa8818a6 100644
--- a/src/imports/layouts/qquicklinearlayout.cpp
+++ b/src/imports/layouts/qquicklinearlayout.cpp
@@ -664,25 +664,14 @@ void QQuickGridLayout::insertLayoutItems()
int &columnSpan = span[0];
int &rowSpan = span[1];
- bool invalidRowColumn = false;
if (info) {
if (info->isRowSet() || info->isColumnSet()) {
// If row is specified and column is not specified (or vice versa),
// the unspecified component of the cell position should default to 0
- row = column = 0;
- if (info->isRowSet()) {
- row = info->row();
- invalidRowColumn = row < 0;
- }
- if (info->isColumnSet()) {
- column = info->column();
- invalidRowColumn = column < 0;
- }
- }
- if (invalidRowColumn) {
- qWarning("QQuickGridLayoutBase::insertLayoutItems: invalid row/column: %d",
- row < 0 ? row : column);
- return;
+ // The getters do this for us, as they will return 0 for an
+ // unset (or negative) value.
+ row = info->row();
+ column = info->column();
}
rowSpan = info->rowSpan();
columnSpan = info->columnSpan();