TD: PR6497 move return statement to new line

This commit is contained in:
Chris Hennes
2022-03-29 13:26:01 -05:00
parent cb21ac7bf8
commit c44ccc0ff2
10 changed files with 34 additions and 17 deletions

View File

@@ -220,7 +220,8 @@ short DrawProjGroup::mustExecute() const
spacingX.isTouched() ||
spacingY.isTouched();
}
if (result) return result;
if (result)
return result;
return TechDraw::DrawViewCollection::mustExecute();
}

View File

@@ -200,7 +200,8 @@ void QGTracker::sleep(bool b)
QPointF QGTracker::snapToAngle(QPointF dumbPt)
{
// If no point selected yet, snapping has no sense
if (m_points.size() < 1) return dumbPt;
if (m_points.size() < 1)
return dumbPt;
QPointF result(dumbPt);
double angleIncr = M_PI / 8.0; //15*

View File

@@ -318,7 +318,8 @@ void TaskCosVertex::enableTaskButtons(bool b)
bool TaskCosVertex::accept()
{
Gui::Document* doc = Gui::Application::Instance->getDocument(m_basePage->getDocument());
if (!doc) return false;
if (!doc)
return false;
removeTracker();
double x = ui->dsbX->value().getValue();
@@ -338,7 +339,8 @@ bool TaskCosVertex::accept()
bool TaskCosVertex::reject()
{
Gui::Document* doc = Gui::Application::Instance->getDocument(m_basePage->getDocument());
if (!doc) return false;
if (!doc)
return false;
removeTracker();
m_trackerMode = QGTracker::TrackerMode::None;

View File

@@ -620,7 +620,8 @@ bool TaskDetail::accept()
// Base::Console().Message("TD::accept()\n");
Gui::Document* doc = Gui::Application::Instance->getDocument(m_basePage->getDocument());
if (!doc) return false;
if (!doc)
return false;
m_ghost->hide();
getDetailFeat()->requestPaint();
@@ -634,7 +635,8 @@ bool TaskDetail::reject()
{
// Base::Console().Message("TD::reject()\n");
Gui::Document* doc = Gui::Application::Instance->getDocument(m_basePage->getDocument());
if (!doc) return false;
if (!doc)
return false;
m_ghost->hide();
if (m_mode == CREATEMODE) {

View File

@@ -807,7 +807,8 @@ bool TaskLeaderLine::accept()
}
Gui::Document* doc = Gui::Application::Instance->getDocument(m_basePage->getDocument());
if (!doc) return false;
if (!doc)
return false;
if (!getCreateMode()) {
// removeTracker();
@@ -838,7 +839,8 @@ bool TaskLeaderLine::reject()
}
Gui::Document* doc = Gui::Application::Instance->getDocument(m_basePage->getDocument());
if (!doc) return false;
if (!doc)
return false;
if (getCreateMode() &&
(m_lineFeat != nullptr) ) {

View File

@@ -230,7 +230,8 @@ bool TaskLineDecor::accept()
{
// Base::Console().Message("TLD::accept()\n");
Gui::Document* doc = Gui::Application::Instance->getDocument(m_partFeat->getDocument());
if (!doc) return false;
if (!doc)
return false;
if (apply()) {
applyDecorations();
@@ -248,7 +249,8 @@ bool TaskLineDecor::reject()
{
// Base::Console().Message("TLD::reject()\n");
Gui::Document* doc = Gui::Application::Instance->getDocument(m_partFeat->getDocument());
if (!doc) return false;
if (!doc)
return false;
Gui::Command::doCommand(Gui::Command::Gui,"Gui.ActiveDocument.resetEdit()");
return false;

View File

@@ -526,7 +526,8 @@ bool TaskProjGroup::accept()
{
// Base::Console().Message("TPG::accept()\n");
Gui::Document* doc = Gui::Application::Instance->getDocument(multiView->getDocument());
if (!doc) return false;
if (!doc)
return false;
multiView->recomputeChildren();
multiView->recomputeFeature();
@@ -539,7 +540,8 @@ bool TaskProjGroup::accept()
bool TaskProjGroup::reject()
{
Gui::Document* doc = Gui::Application::Instance->getDocument(multiView->getDocument());
if (!doc) return false;
if (!doc)
return false;
if (getCreateMode()) {
//remove the object completely from the document

View File

@@ -530,7 +530,8 @@ bool TaskRichAnno::accept()
}
Gui::Document* doc = Gui::Application::Instance->getDocument(m_basePage->getDocument());
if (!doc) return false;
if (!doc)
return false;
if (!getCreateMode()) {
updateAnnoFeature();

View File

@@ -194,8 +194,10 @@ TechDraw::DrawGeomHatch* ViewProviderGeomHatch::getViewObject() const
Gui::MDIView *ViewProviderGeomHatch::getMDIView() const
{
auto obj = getViewObject();
if(!obj) return nullptr;
if(!obj)
return nullptr;
auto vp = Gui::Application::Instance->getViewProvider(obj->getSourceView());
if(!vp) return nullptr;
if(!vp)
return nullptr;
return vp->getMDIView();
}

View File

@@ -163,8 +163,10 @@ bool ViewProviderHatch::canDelete(App::DocumentObject *obj) const
Gui::MDIView *ViewProviderHatch::getMDIView() const
{
auto obj = getViewObject();
if(!obj) return nullptr;
if(!obj)
return nullptr;
auto vp = Gui::Application::Instance->getViewProvider(obj->getSourceView());
if(!vp) return nullptr;
if(!vp)
return nullptr;
return vp->getMDIView();
}