diff options
author | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2015-05-07 14:12:43 +0200 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2015-05-07 12:16:27 +0000 |
commit | 0310c72377ccc8f452e6e94a3b1e55aa2d710fb6 (patch) | |
tree | 8978d491e9fac1e7f60820ea8de9647c00dca085 /ui/qt/qcustomplot.cpp | |
parent | d8ccd27181e37c9846ec8ac6ffd4eccb33840016 (diff) | |
download | wireshark-0310c72377ccc8f452e6e94a3b1e55aa2d710fb6.tar.gz |
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 <alexis.lagoutte@gmail.com>
Diffstat (limited to 'ui/qt/qcustomplot.cpp')
-rw-r--r-- | ui/qt/qcustomplot.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
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 |