PD: Fix several coverity issues:

* CID 350558: Uninitialized pointer field
* CID 350554: Uninitialized pointer field
* CID 350589: Uninitialized pointer field
* CID 350608: Uninitialized pointer field
* CID 350544: Uncaught exception
* CID 350568: Uncaught exception
* CID 350603: Uncaught exception
* CID 350562: Unchecked dynamic_cast
* CID 350591: Unchecked dynamic_cast
* CID 350583: Unchecked dynamic_cast
* CID 350598: Unchecked dynamic_cast
This commit is contained in:
wmayer
2022-03-13 16:32:19 +01:00
parent 15ee1fdd4e
commit 7acdcbd031
4 changed files with 31 additions and 11 deletions

View File

@@ -68,6 +68,7 @@ using namespace Gui;
TaskPipeParameters::TaskPipeParameters(ViewProviderPipe *PipeView, bool /*newObj*/, QWidget *parent)
: TaskSketchBasedParameters(PipeView, parent, "PartDesign_AdditivePipe", tr("Pipe parameters"))
, ui(new Ui_TaskPipeParameters)
, stateHandler(nullptr)
{
// we need a separate container widget to add all controls to
proxy = new QWidget(this);
@@ -151,6 +152,8 @@ TaskPipeParameters::~TaskPipeParameters()
static_cast<ViewProviderPipe*>(vp)->highlightReferences(ViewProviderPipe::Profile, false);
}
}
catch (const Standard_OutOfRange&) {
}
catch (const Base::Exception& e) {
// getDocument() may raise an exception
e.ReportException();
@@ -535,8 +538,9 @@ bool TaskPipeParameters::accept()
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
TaskPipeOrientation::TaskPipeOrientation(ViewProviderPipe* PipeView, bool /*newObj*/, QWidget* parent)
: TaskSketchBasedParameters(PipeView, parent, "PartDesign_AdditivePipe", tr("Section orientation")),
ui(new Ui_TaskPipeOrientation)
: TaskSketchBasedParameters(PipeView, parent, "PartDesign_AdditivePipe", tr("Section orientation"))
, ui(new Ui_TaskPipeOrientation)
, stateHandler(nullptr)
{
// we need a separate container widget to add all controls to
proxy = new QWidget(this);
@@ -599,8 +603,12 @@ TaskPipeOrientation::TaskPipeOrientation(ViewProviderPipe* PipeView, bool /*newO
TaskPipeOrientation::~TaskPipeOrientation()
{
if (vp) {
static_cast<ViewProviderPipe*>(vp)->highlightReferences(ViewProviderPipe::AuxiliarySpine, false);
try {
if (vp) {
static_cast<ViewProviderPipe*>(vp)->highlightReferences(ViewProviderPipe::AuxiliarySpine, false);
}
}
catch (const Standard_OutOfRange&) {
}
}
@@ -798,8 +806,9 @@ void TaskPipeOrientation::updateUI(int idx)
// Task Scaling
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
TaskPipeScaling::TaskPipeScaling(ViewProviderPipe* PipeView, bool /*newObj*/, QWidget* parent)
: TaskSketchBasedParameters(PipeView, parent, "PartDesign_AdditivePipe", tr("Section transformation")),
ui(new Ui_TaskPipeScaling)
: TaskSketchBasedParameters(PipeView, parent, "PartDesign_AdditivePipe", tr("Section transformation"))
, ui(new Ui_TaskPipeScaling)
, stateHandler(nullptr)
{
// we need a separate container widget to add all controls to
proxy = new QWidget(this);
@@ -849,8 +858,12 @@ TaskPipeScaling::TaskPipeScaling(ViewProviderPipe* PipeView, bool /*newObj*/, QW
TaskPipeScaling::~TaskPipeScaling()
{
if (vp) {
static_cast<ViewProviderPipe*>(vp)->highlightReferences(ViewProviderPipe::Section, false);
try {
if (vp) {
static_cast<ViewProviderPipe*>(vp)->highlightReferences(ViewProviderPipe::Section, false);
}
}
catch (const Standard_OutOfRange&) {
}
}