]> granicus.if.org Git - graphviz/commitdiff
gvedit: standardize on more modern 'nullptr'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 9 Apr 2022 17:22:45 +0000 (10:22 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 28 Apr 2022 01:54:13 +0000 (18:54 -0700)
cmd/gvedit/csettings.cpp
cmd/gvedit/imageviewer.cpp
cmd/gvedit/main.cpp
cmd/gvedit/mainwindow.cpp
cmd/gvedit/mainwindow.h

index e1f8746ab36e89f5b0b67ec85bf37e6c05d42250..7bfcc39d538ea5186ec87358eeb2ab27b1e4b277 100644 (file)
@@ -113,8 +113,8 @@ CFrmSettings::CFrmSettings()
     this->gvc = gvContext();
     Ui_Dialog tempDia;
     tempDia.setupUi(this);
-    graph = NULL;
-    activeWindow = NULL;
+    graph = nullptr;
+    activeWindow = nullptr;
     QString path;
 #ifndef _WIN32
     char *s = getenv("GVEDIT_PATH");
@@ -301,7 +301,7 @@ bool CFrmSettings::loadGraph(MdiChild * m)
 {
     if (graph) {
        agclose(graph);
-       graph = NULL;
+       graph = nullptr;
     }
     graphData.clear();
     graphData.append(m->toPlainText());
@@ -332,7 +332,7 @@ bool CFrmSettings::createLayout()
        return false;
     if (agerrors()) {
        agclose(graph);
-       graph = NULL;
+       graph = nullptr;
        return false;
     }
     Agraph_t *G = this->graph;
@@ -360,7 +360,7 @@ void CFrmSettings::doPreview(QString fileName)
     if (getActiveWindow()->previewFrm != nullptr) {
        getActiveWindow()->parentFrm->mdiArea->
            removeSubWindow(getActiveWindow()->previewFrm->subWindowRef);
-       getActiveWindow()->previewFrm = NULL;
+       getActiveWindow()->previewFrm = nullptr;
     }
 
     if ((fileName.isNull()) || !(getActiveWindow()->loadPreview(fileName))) {  //create preview
index 43482689219ca46e1ca9eab1ea4718a19b73c808..e8ef3a60f9ef1cf61aeb3e00b28d37047e70408a 100644 (file)
@@ -198,7 +198,7 @@ void ImageViewer::adjustScrollBar(QScrollBar * scrollBar, double factor)
 
 void ImageViewer::closeEvent(QCloseEvent * event)
 {
-    this->graphWindow->previewFrm = NULL;
+    this->graphWindow->previewFrm = nullptr;
     event->accept();
 
 }
index 5bd608fb9c67bb4e8f61de7fe89aeb334c2332aa..bcb6498ff6228e057ae7b93e6a8853f158778e1c 100644 (file)
@@ -77,7 +77,7 @@ static char **parseArgs(int argc, char *argv[])
     if (argc)
        return argv;
     else
-       return NULL;
+       return nullptr;
 }
 
 int main(int argc, char *argv[])
index 9a4ce981db5fda209703d84e653f0a1429e3e6ab..b36656dab6efaa191af24561b46746e3a0a6bb2b 100644 (file)
@@ -36,7 +36,7 @@ static int LoadPlugins(QComboBox * cb, GVC_t * gvc, const char *kind,
                       const char *more[], const char *prefer)
 {
     int count;
-    char **lp = gvPluginList(gvc, kind, &count, NULL);
+    char **lp = gvPluginList(gvc, kind, &count, nullptr);
     int idx = -1;
 
     cb->clear();
@@ -66,7 +66,7 @@ static int LoadPlugins(QComboBox * cb, GVC_t * gvc, const char *kind,
 
 void CMainWindow::createConsole()
 {
-    QDockWidget *dock = new QDockWidget(tr("Output Console"), NULL);
+    QDockWidget *dock = new QDockWidget(tr("Output Console"), nullptr);
     QTextEdit *textEdit = new QTextEdit(dock);
 
     dock->
@@ -111,7 +111,7 @@ void CMainWindow::createConsole()
 
 static const char *xtra[] = {
     "NONE",
-    (const char *) NULL
+    nullptr
 };
 
 CMainWindow::CMainWindow(char*** Files)
@@ -131,7 +131,7 @@ CMainWindow::CMainWindow(char*** Files)
     verticalLayout_2->addLayout(verticalLayout);
     setCentralWidget(centralwidget);
     centralwidget->layout()->setContentsMargins(1, 1, 1, 1);
-    prevChild = NULL;
+    prevChild = nullptr;
 
     createConsole();
 
@@ -157,7 +157,7 @@ CMainWindow::CMainWindow(char*** Files)
     setUnifiedTitleAndToolBarOnMac(true);
     QComboBox *cb =
        (QComboBox *) frmSettings->findChild < QComboBox * >("cbLayout");
-    dfltLayoutIdx = LoadPlugins(cb, frmSettings->gvc, "layout", NULL, "dot");
+    dfltLayoutIdx = LoadPlugins(cb, frmSettings->gvc, "layout", nullptr, "dot");
     cb = (QComboBox *) frmSettings->findChild <
        QComboBox * >("cbExtension");
     dfltRenderIdx =
index af47c0d152e9e646caff8508e40ab23fae238c87..fc32025167a39ebb8297c1783f3148752452c617 100644 (file)
@@ -37,13 +37,13 @@ class CMainWindow : public QMainWindow
     Q_OBJECT
 
 public:
-    CMainWindow(char*** Files=NULL);
+    CMainWindow(char*** Files = nullptr);
     QMdiArea *mdiArea;
     void addFile (QString fileName);
     std::vector <QString> initFiles;
 private slots:
     void slotSettings();
-    void slotRun(MdiChild * m=NULL);
+    void slotRun(MdiChild* m = nullptr);
     void slotNew();
     void slotOpen();
     void slotSave();