From 4ba53881b5afe5d3dea46f25db2f3f5f8905c232 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 22 Aug 2016 15:33:54 +0200 Subject: [PATCH 1/2] fix Coverity issues --- src/Mod/Part/App/Attacher.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/Mod/Part/App/Attacher.cpp b/src/Mod/Part/App/Attacher.cpp index 9ce107f5cb..c809bde64d 100644 --- a/src/Mod/Part/App/Attacher.cpp +++ b/src/Mod/Part/App/Attacher.cpp @@ -1577,22 +1577,22 @@ AttachEngineLine *AttachEngineLine::copy() const Base::Placement AttachEngineLine::calculateAttachedPlacement(Base::Placement origPlacement) const { eMapMode mmode = this->mapMode; - if (mmode == mmDeactivated) - throw ExceptionCancel();//to be handled in positionBySupport, to not do anything if disabled //modes that are mirrors of attacher3D: bool bReUsed = true; Base::Placement presuperPlacement; switch(mmode){ + case mmDeactivated: + throw ExceptionCancel();//to be handled in positionBySupport, to not do anything if disabled case mm1AxisX: mmode = mmObjectYZ; - break; + break; case mm1AxisY: mmode = mmObjectXZ; - break; + break; case mm1AxisZ: mmode = mmObjectXY; - break; + break; case mm1AxisCurv: mmode = mmRevolutionSection; //the line should go along Y, not Z @@ -1600,18 +1600,19 @@ Base::Placement AttachEngineLine::calculateAttachedPlacement(Base::Placement ori Base::Rotation( Base::Vector3d(0.0,0.0,1.0), Base::Vector3d(0.0,1.0,0.0) ) ); - break; + break; case mm1Binormal: mmode = mmFrenetTN; - break; + break; case mm1Normal: mmode = mmFrenetTB; - break; + break; case mm1Tangent: mmode = mmNormalToPath; - break; + break; default: bReUsed = false; + break; } Base::Placement plm; @@ -1640,7 +1641,7 @@ Base::Placement AttachEngineLine::calculateAttachedPlacement(Base::Placement ori switch (mmode) { case mmDeactivated: //should have been filtered out already! - break; + break; case mm1AxisInertia1: case mm1AxisInertia2: case mm1AxisInertia3:{ @@ -1845,12 +1846,12 @@ AttachEnginePoint *AttachEnginePoint::copy() const Base::Placement AttachEnginePoint::calculateAttachedPlacement(Base::Placement origPlacement) const { eMapMode mmode = this->mapMode; - if (mmode == mmDeactivated) - throw ExceptionCancel();//to be handled in positionBySupport, to not do anything if disabled //modes that are mirrors of attacher3D: bool bReUsed = true; switch(mmode){ + case mmDeactivated: + throw ExceptionCancel();//to be handled in positionBySupport, to not do anything if disabled case mm0Origin: mmode = mmObjectXY; break; From 52b98f9cf208ee9f9655815ee20b4b358f9db13d Mon Sep 17 00:00:00 2001 From: Sergo Date: Sun, 21 Aug 2016 22:39:27 -0400 Subject: [PATCH 2/2] PD ui: Fix Primitive combobuttons icons remember last choice --- src/Mod/PartDesign/Gui/CommandPrimitive.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Mod/PartDesign/Gui/CommandPrimitive.cpp b/src/Mod/PartDesign/Gui/CommandPrimitive.cpp index 0b2be32fdd..19361c4335 100644 --- a/src/Mod/PartDesign/Gui/CommandPrimitive.cpp +++ b/src/Mod/PartDesign/Gui/CommandPrimitive.cpp @@ -63,6 +63,9 @@ void CmdPrimtiveCompAdditive::activated(int iMsg) PartDesign::Body *pcActiveBody = PartDesignGui::getBody(/*messageIfNot = */true); if (!pcActiveBody) return; + Gui::ActionGroup* pcAction = qobject_cast(_pcAction); + pcAction->setIcon(pcAction->actions().at(iMsg)->icon()); + std::string FeatName; std::string CSName = getUniqueObjectName("CoordinateSystem");; if(iMsg == 0) { @@ -249,6 +252,9 @@ void CmdPrimtiveCompSubtractive::activated(int iMsg) PartDesign::Body *pcActiveBody = PartDesignGui::getBody(/*messageIfNot = */true); if (!pcActiveBody) return; + Gui::ActionGroup* pcAction = qobject_cast(_pcAction); + pcAction->setIcon(pcAction->actions().at(iMsg)->icon()); + //check if we already have a feature as subtractive ones work only if we have //something to subtract from. App::DocumentObject *prevSolid = pcActiveBody->Tip.getValue();