From c4ddcdffe8a73b0e9434431318f36db438ee9d9f Mon Sep 17 00:00:00 2001 From: dismine Date: Tue, 17 Jun 2014 15:56:14 +0300 Subject: [PATCH] Coverity Scan. --HG-- branch : develop --- src/app/mainwindow.cpp | 27 +++++++++++++++++++++------ src/app/tools/vtooldetail.cpp | 2 +- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index a843b8caa..17c1915bc 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -1594,13 +1594,28 @@ void MainWindow::FullParseFile() ui->actionPattern_properties->setEnabled(true); qint32 index = comboBoxDraws->findText(patternPiece); - if ( index != -1 ) - { // -1 for not found - currentDrawChanged(index); - } - else + try { - currentDrawChanged(0); + if ( index != -1 ) + { // -1 for not found + currentDrawChanged(index); + } + else + { + currentDrawChanged(0); + } + } + catch (VExceptionBadId &e) + { + e.CriticalMessageBox(tr("Bad id."), this); + Clear(); + return; + } + catch (const VExceptionEmptyParameter &e) + { + e.CriticalMessageBox(tr("Error empty parameter."), this); + Clear(); + return; } if (comboBoxDraws->count() > 0) diff --git a/src/app/tools/vtooldetail.cpp b/src/app/tools/vtooldetail.cpp index 1d09f48d4..733db56e3 100644 --- a/src/app/tools/vtooldetail.cpp +++ b/src/app/tools/vtooldetail.cpp @@ -458,7 +458,7 @@ void VToolDetail::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) } if (selectedAction == actionRemove) { - DeleteTool(this); + DeleteTool(); } }