Fix transform feature crash on apply
-Redundant "reset edit" and command commit removed -Redundant apply call removed
This commit is contained in:
parent
16433939e1
commit
99ef8e756d
|
@ -82,6 +82,9 @@ bool TaskDlgFeatureParameters::accept() {
|
||||||
// Iterate over parameter dialogs and apply all parameters from them
|
// Iterate over parameter dialogs and apply all parameters from them
|
||||||
for ( QWidget *wgt : Content ) {
|
for ( QWidget *wgt : Content ) {
|
||||||
TaskFeatureParameters *param = qobject_cast<TaskFeatureParameters *> (wgt);
|
TaskFeatureParameters *param = qobject_cast<TaskFeatureParameters *> (wgt);
|
||||||
|
if(!param)
|
||||||
|
continue;
|
||||||
|
|
||||||
param->saveHistory ();
|
param->saveHistory ();
|
||||||
param->apply ();
|
param->apply ();
|
||||||
}
|
}
|
||||||
|
|
|
@ -396,12 +396,6 @@ void TaskLinearPatternParameters::apply()
|
||||||
|
|
||||||
ui->spinLength->apply();
|
ui->spinLength->apply();
|
||||||
ui->spinOccurrences->apply();
|
ui->spinOccurrences->apply();
|
||||||
|
|
||||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.recompute()");
|
|
||||||
if (!TransformedView->getObject()->isValid())
|
|
||||||
throw Base::Exception(TransformedView->getObject()->getStatusString());
|
|
||||||
Gui::Command::doCommand(Gui::Command::Gui,"Gui.activeDocument().resetEdit()");
|
|
||||||
Gui::Command::commitCommand();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
|
@ -417,14 +411,4 @@ TaskDlgLinearPatternParameters::TaskDlgLinearPatternParameters(ViewProviderLinea
|
||||||
Content.push_back(parameter);
|
Content.push_back(parameter);
|
||||||
}
|
}
|
||||||
|
|
||||||
//==== calls from the TaskView ===============================================================
|
|
||||||
|
|
||||||
bool TaskDlgLinearPatternParameters::accept()
|
|
||||||
{
|
|
||||||
|
|
||||||
parameter->apply();
|
|
||||||
|
|
||||||
return TaskDlgTransformedParameters::accept();
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "moc_TaskLinearPatternParameters.cpp"
|
#include "moc_TaskLinearPatternParameters.cpp"
|
||||||
|
|
|
@ -98,10 +98,6 @@ class TaskDlgLinearPatternParameters : public TaskDlgTransformedParameters
|
||||||
public:
|
public:
|
||||||
TaskDlgLinearPatternParameters(ViewProviderLinearPattern *LinearPatternView);
|
TaskDlgLinearPatternParameters(ViewProviderLinearPattern *LinearPatternView);
|
||||||
virtual ~TaskDlgLinearPatternParameters() {}
|
virtual ~TaskDlgLinearPatternParameters() {}
|
||||||
|
|
||||||
public:
|
|
||||||
/// is called by the framework if the dialog is accepted (Ok)
|
|
||||||
virtual bool accept();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} //namespace PartDesignGui
|
} //namespace PartDesignGui
|
||||||
|
|
|
@ -391,11 +391,6 @@ void TaskPolarPatternParameters::apply()
|
||||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Reversed = %u",name.c_str(),getReverse());
|
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Reversed = %u",name.c_str(),getReverse());
|
||||||
ui->polarAngle->apply();
|
ui->polarAngle->apply();
|
||||||
ui->spinOccurrences->apply();
|
ui->spinOccurrences->apply();
|
||||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.recompute()");
|
|
||||||
if (!TransformedView->getObject()->isValid())
|
|
||||||
throw Base::Exception(TransformedView->getObject()->getStatusString());
|
|
||||||
Gui::Command::doCommand(Gui::Command::Gui,"Gui.activeDocument().resetEdit()");
|
|
||||||
Gui::Command::commitCommand();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
|
@ -410,14 +405,5 @@ TaskDlgPolarPatternParameters::TaskDlgPolarPatternParameters(ViewProviderPolarPa
|
||||||
|
|
||||||
Content.push_back(parameter);
|
Content.push_back(parameter);
|
||||||
}
|
}
|
||||||
//==== calls from the TaskView ===============================================================
|
|
||||||
|
|
||||||
bool TaskDlgPolarPatternParameters::accept()
|
|
||||||
{
|
|
||||||
|
|
||||||
parameter->apply();
|
|
||||||
|
|
||||||
return TaskDlgTransformedParameters::accept();
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "moc_TaskPolarPatternParameters.cpp"
|
#include "moc_TaskPolarPatternParameters.cpp"
|
||||||
|
|
|
@ -99,10 +99,6 @@ class TaskDlgPolarPatternParameters : public TaskDlgTransformedParameters
|
||||||
public:
|
public:
|
||||||
TaskDlgPolarPatternParameters(ViewProviderPolarPattern *PolarPatternView);
|
TaskDlgPolarPatternParameters(ViewProviderPolarPattern *PolarPatternView);
|
||||||
virtual ~TaskDlgPolarPatternParameters() {}
|
virtual ~TaskDlgPolarPatternParameters() {}
|
||||||
|
|
||||||
public:
|
|
||||||
/// is called by the framework if the dialog is accepted (Ok)
|
|
||||||
virtual bool accept();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} //namespace PartDesignGui
|
} //namespace PartDesignGui
|
||||||
|
|
|
@ -233,11 +233,6 @@ void TaskScaledParameters::apply()
|
||||||
|
|
||||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Factor = %f",name.c_str(), getFactor());
|
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Factor = %f",name.c_str(), getFactor());
|
||||||
ui->spinOccurrences->apply();
|
ui->spinOccurrences->apply();
|
||||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.recompute()");
|
|
||||||
if (!TransformedView->getObject()->isValid())
|
|
||||||
throw Base::Exception(TransformedView->getObject()->getStatusString());
|
|
||||||
Gui::Command::doCommand(Gui::Command::Gui,"Gui.activeDocument().resetEdit()");
|
|
||||||
Gui::Command::commitCommand();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
|
|
Loading…
Reference in New Issue
Block a user