diff --git a/src/Mod/PartDesign/App/ShapeBinder.cpp b/src/Mod/PartDesign/App/ShapeBinder.cpp index 6da2368f7..6c0a67f48 100644 --- a/src/Mod/PartDesign/App/ShapeBinder.cpp +++ b/src/Mod/PartDesign/App/ShapeBinder.cpp @@ -89,7 +89,7 @@ void ShapeBinder::getFilteredReferences(App::PropertyLinkSubList* prop, Part::Fe //we only allow one part feature, so get the first one we find size_t index = 0; - while(!objs[index]->isDerivedFrom(Part::Feature::getClassTypeId()) && index < objs.size()) + while(index < objs.size() && !objs[index]->isDerivedFrom(Part::Feature::getClassTypeId())) index++; //do we have any part feature? diff --git a/src/Mod/PartDesign/Gui/TaskShapeBinder.cpp b/src/Mod/PartDesign/Gui/TaskShapeBinder.cpp index f521694bd..5937b0881 100644 --- a/src/Mod/PartDesign/Gui/TaskShapeBinder.cpp +++ b/src/Mod/PartDesign/Gui/TaskShapeBinder.cpp @@ -317,35 +317,13 @@ bool TaskDlgShapeBinder::accept() return true; } -//bool TaskDlgShapeBinder::reject() -//{ -// // get the support and Sketch -// PartDesign::Pipe* pcPipe = static_cast(PipeView->getObject()); -// Sketcher::SketchObject *pcSketch = 0; -// App::DocumentObject *pcSupport = 0; -// if (pcPipe->Sketch.getValue()) { -// pcSketch = static_cast(pcPipe->Sketch.getValue()); -// pcSupport = pcSketch->Support.getValue(); -// } -// -// // roll back the done things -// Gui::Command::abortCommand(); -// Gui::Command::doCommand(Gui::Command::Gui,"Gui.activeDocument().resetEdit()"); -// -// // if abort command deleted the object the support is visible again -// if (!Gui::Application::Instance->getViewProvider(pcPipe)) { -// if (pcSketch && Gui::Application::Instance->getViewProvider(pcSketch)) -// Gui::Application::Instance->getViewProvider(pcSketch)->show(); -// if (pcSupport && Gui::Application::Instance->getViewProvider(pcSupport)) -// Gui::Application::Instance->getViewProvider(pcSupport)->show(); -// } -// -// //Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.recompute()"); -// //Gui::Command::commitCommand(); -// -// return true; -//} - - +bool TaskDlgShapeBinder::reject() +{ + // roll back the done things + Gui::Command::abortCommand(); + Gui::Command::doCommand(Gui::Command::Gui, "Gui.activeDocument().resetEdit()"); + Gui::Command::doCommand(Gui::Command::Doc, "App.ActiveDocument.recompute()"); + return true; +} #include "moc_TaskShapeBinder.cpp" diff --git a/src/Mod/PartDesign/Gui/TaskShapeBinder.h b/src/Mod/PartDesign/Gui/TaskShapeBinder.h index 56856a857..a88696175 100644 --- a/src/Mod/PartDesign/Gui/TaskShapeBinder.h +++ b/src/Mod/PartDesign/Gui/TaskShapeBinder.h @@ -94,7 +94,7 @@ public: /// is called by the framework if the dialog is accepted (Ok) virtual bool accept(); /// is called by the framework if the dialog is rejected (Cancel) - //virtual bool reject(); + virtual bool reject(); protected: TaskShapeBinder *parameter;