From cda9b57b6cee6ccf0535b84ce9ef06e7b8b12d08 Mon Sep 17 00:00:00 2001 From: jrheinlaender Date: Tue, 14 May 2013 15:45:02 +0430 Subject: [PATCH] miscellaneous fixes --- src/Mod/PartDesign/Gui/Command.cpp | 3 ++- src/Mod/PartDesign/Gui/ViewProvider.cpp | 5 ++++- src/Mod/PartDesign/Gui/ViewProviderDatum.cpp | 5 ++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Mod/PartDesign/Gui/Command.cpp b/src/Mod/PartDesign/Gui/Command.cpp index fe0aa261a..e3b0fb541 100644 --- a/src/Mod/PartDesign/Gui/Command.cpp +++ b/src/Mod/PartDesign/Gui/Command.cpp @@ -186,7 +186,8 @@ void CmdPartDesignMoveTip::activated(int iMsg) } App::DocumentObject* oldTip = pcActiveBody->Tip.getValue(); - doCommand(Gui,"Gui.activeDocument().hide(\"%s\")", oldTip->getNameInDocument()); + if (!oldTip->getTypeId().isDerivedFrom(Part::Datum::getClassTypeId())) + doCommand(Gui,"Gui.activeDocument().hide(\"%s\")", oldTip->getNameInDocument()); App::DocumentObject* prevSolidFeature = pcActiveBody->getPrevSolidFeature(); if (prevSolidFeature != NULL) doCommand(Gui,"Gui.activeDocument().hide(\"%s\")", prevSolidFeature->getNameInDocument()); diff --git a/src/Mod/PartDesign/Gui/ViewProvider.cpp b/src/Mod/PartDesign/Gui/ViewProvider.cpp index a0b9de8a8..83d92ef1a 100644 --- a/src/Mod/PartDesign/Gui/ViewProvider.cpp +++ b/src/Mod/PartDesign/Gui/ViewProvider.cpp @@ -58,7 +58,10 @@ bool ViewProvider::doubleClicked(void) // Drop into insert mode so that the user doesn't see all the geometry that comes later in the tree // Also, this way the user won't be tempted to use future geometry as external references for the sketch oldTip = ActivePartObject->Tip.getValue(); - Gui::Command::doCommand(Gui::Command::Gui,"FreeCADGui.runCommand('PartDesign_MoveTip')"); + if (oldTip != this->pcObject) + Gui::Command::doCommand(Gui::Command::Gui,"FreeCADGui.runCommand('PartDesign_MoveTip')"); + else + oldTip = NULL; } else { oldTip = NULL; } diff --git a/src/Mod/PartDesign/Gui/ViewProviderDatum.cpp b/src/Mod/PartDesign/Gui/ViewProviderDatum.cpp index cbefe3883..af2e8d2f1 100644 --- a/src/Mod/PartDesign/Gui/ViewProviderDatum.cpp +++ b/src/Mod/PartDesign/Gui/ViewProviderDatum.cpp @@ -265,7 +265,10 @@ bool ViewProviderDatum::doubleClicked(void) // Drop into insert mode so that the user doesn't see all the geometry that comes later in the tree // Also, this way the user won't be tempted to use future geometry as external references for the sketch oldTip = ActivePartObject->Tip.getValue(); - Gui::Command::doCommand(Gui::Command::Gui,"FreeCADGui.runCommand('PartDesign_MoveTip')"); + if (oldTip != this->pcObject) + Gui::Command::doCommand(Gui::Command::Gui,"FreeCADGui.runCommand('PartDesign_MoveTip')"); + else + oldTip = NULL; } else { oldTip = NULL; }