From 930385acd8d30a6e0d818806ab893fdce975385f Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Thu, 12 Jan 2017 15:01:33 +0100 Subject: QQuickGridLayout: Remove dead code in layout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/imports/layouts/qquicklinearlayout.cpp | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'src/imports') 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(); -- cgit v1.2.3