Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 26, 2024
1 parent d42e7e2 commit 4ef53a2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Mod/Measure/App/Measurement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ double Measurement::length() const
"Measurement - length - Curve type not currently handled");
}
} // end switch
} // end for
} // end for
}
}
return result;
Expand Down
16 changes: 10 additions & 6 deletions src/Mod/Measure/Gui/TaskMeasure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ void TaskMeasure::setMeasureObject(Measure::MeasureBase* obj)

App::DocumentObject* TaskMeasure::createObject(const App::MeasureType* measureType)
{
auto measureClass = measureType->isPython ? "Measure::MeasurePython" : measureType->measureObject;
auto measureClass =
measureType->isPython ? "Measure::MeasurePython" : measureType->measureObject;
auto type = Base::Type::getTypeIfDerivedFrom(measureClass.c_str(),
App::DocumentObject::getClassTypeId(),
true);
Expand All @@ -189,7 +190,8 @@ App::DocumentObject* TaskMeasure::createObject(const App::MeasureType* measureTy
}


Gui::ViewProviderDocumentObject* TaskMeasure::createViewObject(App::DocumentObject* measureObj) {
Gui::ViewProviderDocumentObject* TaskMeasure::createViewObject(App::DocumentObject* measureObj)
{
// Add view object
auto vpName = measureObj->getViewProviderName();
if ((vpName == nullptr) || (vpName[0] == '\0')) {
Expand Down Expand Up @@ -221,7 +223,8 @@ Gui::ViewProviderDocumentObject* TaskMeasure::createViewObject(App::DocumentObje
}


void TaskMeasure::saveObject() {
void TaskMeasure::saveObject()
{
if (_mViewObject && _mGuiDocument) {
_mGuiDocument->addViewProvider(_mViewObject);
_mGuiDocument->takeAnnotationViewProvider(_mViewObject->getTypeId().getName());
Expand All @@ -234,7 +237,8 @@ void TaskMeasure::saveObject() {
}


void TaskMeasure::update() {
void TaskMeasure::update()
{
App::Document* doc = App::GetApplication().getActiveDocument();

// Reset selection if the selected object is not valid
Expand Down Expand Up @@ -298,11 +302,11 @@ void TaskMeasure::update() {
// Update tool mode display
setModeSilent(_mMeasureType);

if (!_mMeasureObject || _mMeasureType->measureObject != _mMeasureObject->getTypeId().getName()) {
if (!_mMeasureObject
|| _mMeasureType->measureObject != _mMeasureObject->getTypeId().getName()) {
// we don't already have a measureobject or it isn't the same type as the new one
removeObject();
createObject(_mMeasureType);

}

// we have a valid measure object so we can enable the annotate button
Expand Down

0 comments on commit 4ef53a2

Please sign in to comment.