LGTM: [skip ci] fix: Empty branch of conditional

An empty block after a conditional can be a sign of an omission and can decrease maintainability of the code.
Such blocks should contain an explanatory comment to aid future maintainers.
This commit is contained in:
wmayer
2020-07-26 15:49:14 +02:00
parent 8dac7e4666
commit dc65b055e5
11 changed files with 36 additions and 18 deletions

View File

@@ -686,9 +686,7 @@ void MeshFillHole::fileHoleCallback(void * ud, SoEventCallback * n)
else if (ev->getTypeId() == SoMouseButtonEvent::getClassTypeId()) {
n->setHandled();
const SoMouseButtonEvent * mbe = static_cast<const SoMouseButtonEvent *>(ev);
if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::DOWN) {
}
else if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::UP) {
if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::UP) {
if (self->myNumPoints > 1)
return;
SoRayPickAction rp(view->getSoRenderManager()->getViewportRegion());

View File

@@ -978,6 +978,7 @@ bool ViewProviderPartExt::setEdit(int ModNum)
void ViewProviderPartExt::unsetEdit(int ModNum)
{
if (ModNum == ViewProvider::Color) {
// Do nothing here
}
else {
Gui::ViewProviderGeometryObject::unsetEdit(ModNum);

View File

@@ -953,6 +953,7 @@ bool ProfileBased::isEqualGeometry(const TopoDS_Shape& s1, const TopoDS_Shape& s
}
}
else if (s1.ShapeType() == TopAbs_EDGE && s2.ShapeType() == TopAbs_EDGE) {
// Do nothing here
}
else if (s1.ShapeType() == TopAbs_VERTEX && s2.ShapeType() == TopAbs_VERTEX) {
gp_Pnt p1 = BRep_Tool::Pnt(TopoDS::Vertex(s1));

View File

@@ -114,6 +114,7 @@ bool ViewProviderLux::setEdit(int ModNum)
void ViewProviderLux::unsetEdit(int ModNum)
{
if (ModNum == ViewProvider::Default) {
// Do nothing here
}
else {
ViewProviderDocumentObjectGroup::unsetEdit(ModNum);
@@ -192,6 +193,7 @@ bool ViewProviderPovray::setEdit(int ModNum)
void ViewProviderPovray::unsetEdit(int ModNum)
{
if (ModNum == ViewProvider::Default) {
// Do nothing here
}
else {
ViewProviderDocumentObjectGroup::unsetEdit(ModNum);

View File

@@ -2572,15 +2572,18 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point)
solve();
return 0;
} else
} else {
return -1;
}
} else if (theta1 < 0.001*arcLength) { // drop the second intersection point
std::swap(GeoId1,GeoId2);
std::swap(point1,point2);
} else if (theta2 > 0.999*arcLength) {
// Do nothing here
}
else
else {
return -1;
}
}
if (GeoId1 >= 0) {
@@ -2749,14 +2752,17 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point)
solve();
return 0;
} else
} else {
return -1;
}
} else if (theta1 < 0.001*arcLength) { // drop the second intersection point
std::swap(GeoId1,GeoId2);
std::swap(point1,point2);
} else if (theta2 > 0.999*arcLength) {
} else
// Do nothing here
} else {
return -1;
}
}
if (GeoId1 >= 0) {
@@ -2927,14 +2933,17 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point)
delete newConstr;
return 0;
} else
} else {
return -1;
}
} else if (theta1 < 0.001*arcLength) { // drop the second intersection point
std::swap(GeoId1,GeoId2);
std::swap(point1,point2);
} else if (theta2 > 0.999*arcLength) {
} else
// Do nothing here
} else {
return -1;
}
}
if (GeoId1 >= 0) {

View File

@@ -67,9 +67,9 @@ TaskSketcherCreateCommands::~TaskSketcherCreateCommands()
void TaskSketcherCreateCommands::changeEvent(QEvent *e)
{
TaskBox::changeEvent(e);
if (e->type() == QEvent::LanguageChange) {
//ui->retranslateUi(proxy);
}
//if (e->type() == QEvent::LanguageChange) {
// ui->retranslateUi(proxy);
//}
}
/// @cond DOXERR