diff layer/TimeValueLayer.cpp @ 1414:fa986b91d77f

Merge from branch fix-static-analysis
author Chris Cannam
date Wed, 09 Jan 2019 15:24:51 +0000
parents c8a6fd3f9dff
children 62e908518c71
line wrap: on
line diff
--- a/layer/TimeValueLayer.cpp	Wed Jan 09 14:41:52 2019 +0000
+++ b/layer/TimeValueLayer.cpp	Wed Jan 09 15:24:51 2019 +0000
@@ -54,11 +54,11 @@
 
 TimeValueLayer::TimeValueLayer() :
     SingleColourLayer(),
-    m_model(0),
+    m_model(nullptr),
     m_editing(false),
     m_originalPoint(0, 0.0, tr("New Point")),
     m_editingPoint(0, 0.0, tr("New Point")),
-    m_editingCommand(0),
+    m_editingCommand(nullptr),
     m_colourMap(0),
     m_colourInverted(false),
     m_plotStyle(PlotConnectedPoints),
@@ -511,7 +511,7 @@
 RangeMapper *
 TimeValueLayer::getNewVerticalZoomRangeMapper() const
 {
-    if (!m_model) return 0;
+    if (!m_model) return nullptr;
     
     RangeMapper *mapper;
 
@@ -520,7 +520,7 @@
     QString unit;
     getValueExtents(min, max, logarithmic, unit);
 
-    if (min == max) return 0;
+    if (min == max) return nullptr;
     
     if (logarithmic) {
         mapper = new LogRangeMapper(0, 100, min, max, unit);
@@ -1430,7 +1430,7 @@
 #endif
     if (!m_model || !m_editing) return;
     finish(m_editingCommand);
-    m_editingCommand = 0;
+    m_editingCommand = nullptr;
     m_editing = false;
 }
 
@@ -1446,7 +1446,7 @@
 
     if (m_editingCommand) {
         finish(m_editingCommand);
-        m_editingCommand = 0;
+        m_editingCommand = nullptr;
     }
 
     m_editing = true;
@@ -1475,7 +1475,7 @@
     m_editingCommand->deletePoint(m_editingPoint);
 
     finish(m_editingCommand);
-    m_editingCommand = 0;
+    m_editingCommand = nullptr;
     m_editing = false;
 }
 
@@ -1496,7 +1496,7 @@
 
     if (m_editingCommand) {
         finish(m_editingCommand);
-        m_editingCommand = 0;
+        m_editingCommand = nullptr;
     }
 
     m_editing = true;
@@ -1554,7 +1554,7 @@
         finish(m_editingCommand);
     }
 
-    m_editingCommand = 0;
+    m_editingCommand = nullptr;
     m_editing = false;
 }
 
@@ -1803,7 +1803,7 @@
 
             bool ok = false;
             QString selected = ListInputDialog::getItem
-                (0, tr("Choose value calculation"),
+                (nullptr, tr("Choose value calculation"),
                  text, options, prevSelection, &ok);
 
             if (!ok) {
@@ -1827,7 +1827,7 @@
             if (generation == Labeller::ValueFromCyclicalCounter ||
                 generation == Labeller::ValueFromTwoLevelCounter) {
                 int cycleSize = QInputDialog::getInt
-                    (0, tr("Select cycle size"),
+                    (nullptr, tr("Select cycle size"),
                      tr("Cycle size:"), 4, 2, 16, 1);
                 labeller.setCounterCycleSize(cycleSize);
             }
@@ -1882,7 +1882,7 @@
             }
 #endif
             labeller.setValue<SparseTimeValueModel::Point>
-                (newPoint, (i == points.begin()) ? 0 : &prevPoint);
+                (newPoint, (i == points.begin()) ? nullptr : &prevPoint);
 #ifdef DEBUG_TIME_VALUE_LAYER
             cerr << "New point value = " << newPoint.value << endl;
 #endif