summaryrefslogtreecommitdiff
path: root/ui/qt/qcustomplot.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ui/qt/qcustomplot.cpp')
-rw-r--r--ui/qt/qcustomplot.cpp8
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