From 0310c72377ccc8f452e6e94a3b1e55aa2d710fb6 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Thu, 7 May 2015 14:12:43 +0200 Subject: Revert "QCustomPlot: fix division(or modulo) by zero found by Clang and Coverity (CID 1159170 & 1159171)" This reverts commit b394aa5f1e4ad030ab23d18b439e8f5c9eca9792. The patch don't fix this issue... Change-Id: I654933ec4ebebdef840f24ba20162f1f1a5321cc Reviewed-on: https://code.wireshark.org/review/8332 Reviewed-by: Alexis La Goutte --- ui/qt/qcustomplot.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'ui/qt/qcustomplot.cpp') diff --git a/ui/qt/qcustomplot.cpp b/ui/qt/qcustomplot.cpp index 9d85644317..1573f02920 100644 --- a/ui/qt/qcustomplot.cpp +++ b/ui/qt/qcustomplot.cpp @@ -2845,7 +2845,7 @@ int QCPLayoutGrid::elementCount() const /* inherits documentation from base class */ QCPLayoutElement *QCPLayoutGrid::elementAt(int index) const { - if (index >= 0 && columnCount() && index < elementCount()) + if (index >= 0 && index < elementCount()) return mElements.at(index / columnCount()).at(index % columnCount()); else return 0; @@ -2854,13 +2854,9 @@ QCPLayoutElement *QCPLayoutGrid::elementAt(int index) const /* inherits documentation from base class */ QCPLayoutElement *QCPLayoutGrid::takeAt(int index) { - if (QCPLayoutElement *el = elementAt(index) ) + if (QCPLayoutElement *el = elementAt(index)) { releaseElement(el); - - if(columnCount() == 0) - return 0; - mElements[index / columnCount()][index % columnCount()] = 0; return el; } else -- cgit v1.2.1