diff --git a/src/Mod/Part/App/FeatureRevolution.cpp b/src/Mod/Part/App/FeatureRevolution.cpp index bf335e936d..5b887169b6 100644 --- a/src/Mod/Part/App/FeatureRevolution.cpp +++ b/src/Mod/Part/App/FeatureRevolution.cpp @@ -71,8 +71,8 @@ void Revolution::onChanged(const App::Property* prop) { if(! this->isRestoring()){ if(prop == &AxisLink){ - Base.setReadOnly(AxisLink.getValue()); - Axis.setReadOnly(AxisLink.getValue()); + Base.setReadOnly(AxisLink.getValue() != nullptr); + Axis.setReadOnly(AxisLink.getValue() != nullptr); } } Part::Feature::onChanged(prop); diff --git a/src/Mod/Part/Gui/DlgPrimitives.cpp b/src/Mod/Part/Gui/DlgPrimitives.cpp index 7e80dafa39..adfc5e2749 100644 --- a/src/Mod/Part/Gui/DlgPrimitives.cpp +++ b/src/Mod/Part/Gui/DlgPrimitives.cpp @@ -334,7 +334,7 @@ DlgPrimitives::DlgPrimitives(QWidget* parent, Part::Primitive* feature) ui->widgetStack2->setCurrentIndex(index); // if existing, the primitive type can not be changed by the user - ui->PrimitiveTypeCB->setDisabled(feature); + ui->PrimitiveTypeCB->setDisabled(feature != nullptr); // ToDo: connect signal if there is a preview of primitives available // read values from the properties diff --git a/src/Mod/Part/Gui/TaskCheckGeometry.cpp b/src/Mod/Part/Gui/TaskCheckGeometry.cpp index b914dc2c9d..b78c296f44 100644 --- a/src/Mod/Part/Gui/TaskCheckGeometry.cpp +++ b/src/Mod/Part/Gui/TaskCheckGeometry.cpp @@ -207,13 +207,12 @@ ResultEntry::~ResultEntry() void ResultEntry::buildEntryName() { ResultEntry *parentEntry = this; - while(parentEntry->parent) - { - ResultEntry *temp = parentEntry->parent; - if (!temp->parent) - break; - parentEntry = parentEntry->parent; - } + while (parentEntry->parent != nullptr) { + ResultEntry *temp = parentEntry->parent; + if (!temp->parent) + break; + parentEntry = parentEntry->parent; + } QString stringOut; QTextStream stream(&stringOut); diff --git a/src/Mod/Part/Gui/TaskDimension.cpp b/src/Mod/Part/Gui/TaskDimension.cpp index 4660708d65..8ca37dd9a8 100644 --- a/src/Mod/Part/Gui/TaskDimension.cpp +++ b/src/Mod/Part/Gui/TaskDimension.cpp @@ -1454,7 +1454,7 @@ void PartGui::SteppedSelection::buildPixmaps() void PartGui::SteppedSelection::selectionSlot(bool checked) { QPushButton *sender = qobject_cast(QObject::sender()); - assert(sender); + assert(sender != nullptr); std::vector::iterator it; for (it = buttons.begin(); it != buttons.end(); ++it) if (it->first == sender) diff --git a/src/Mod/PartDesign/App/FeatureSketchBased.cpp b/src/Mod/PartDesign/App/FeatureSketchBased.cpp index 0fe2753957..17eb6e23ac 100644 --- a/src/Mod/PartDesign/App/FeatureSketchBased.cpp +++ b/src/Mod/PartDesign/App/FeatureSketchBased.cpp @@ -410,7 +410,7 @@ void ProfileBased::onChanged(const App::Property* prop) { if (prop == &Profile) { // if attached to a sketch then mark it as read-only - this->Placement.setStatus(App::Property::ReadOnly, Profile.getValue()); + this->Placement.setStatus(App::Property::ReadOnly, Profile.getValue() != nullptr); } FeatureAddSub::onChanged(prop); diff --git a/src/Mod/PartDesign/Gui/Workbench.cpp b/src/Mod/PartDesign/Gui/Workbench.cpp index e548438bf6..5dc1392e94 100644 --- a/src/Mod/PartDesign/Gui/Workbench.cpp +++ b/src/Mod/PartDesign/Gui/Workbench.cpp @@ -200,7 +200,7 @@ void Workbench::setupContextMenu(const char* recipient, Gui::MenuItem* item) con if ( docHaveBodies ) { bool addMoveFeature = true; - bool addMoveFeatureInTree = body; + bool addMoveFeatureInTree = (body != nullptr); for (auto sel: selection) { // if at least one selected feature cannot be moved to a body // disable the entry diff --git a/src/Mod/Spreadsheet/App/PropertySheet.cpp b/src/Mod/Spreadsheet/App/PropertySheet.cpp index 56d291549b..cb49206e6d 100644 --- a/src/Mod/Spreadsheet/App/PropertySheet.cpp +++ b/src/Mod/Spreadsheet/App/PropertySheet.cpp @@ -578,14 +578,14 @@ Cell * PropertySheet::nonNullCellAt(CellAddress address) void PropertySheet::setContent(CellAddress address, const char *value) { Cell * cell = nonNullCellAt(address); - assert(cell); + assert(cell != nullptr); cell->setContent(value); } void PropertySheet::setAlignment(CellAddress address, int _alignment) { Cell * cell = nonNullCellAt(address); - assert(cell); + assert(cell != nullptr); if (cell->address != address) //Reject alignment change for merged cell except top-left one return; cell->setAlignment(_alignment); @@ -594,28 +594,28 @@ void PropertySheet::setAlignment(CellAddress address, int _alignment) void PropertySheet::setStyle(CellAddress address, const std::set &_style) { Cell * cell = nonNullCellAt(address); - assert(cell); + assert(cell != nullptr); cell->setStyle(_style); } void PropertySheet::setForeground(CellAddress address, const App::Color &color) { Cell * cell = nonNullCellAt(address); - assert(cell); + assert(cell != nullptr); cell->setForeground(color); } void PropertySheet::setBackground(CellAddress address, const App::Color &color) { Cell * cell = nonNullCellAt(address); - assert(cell); + assert(cell != nullptr); cell->setBackground(color); } void PropertySheet::setDisplayUnit(CellAddress address, const std::string &unit) { Cell * cell = nonNullCellAt(address); - assert(cell); + assert(cell != nullptr); cell->setDisplayUnit(unit); } @@ -627,7 +627,7 @@ void PropertySheet::setAlias(CellAddress address, const std::string &alias) const Cell * aliasedCell = getValueFromAlias(alias); Cell * cell = nonNullCellAt(address); - assert(cell); + assert(cell != nullptr); if(aliasedCell == cell) return; @@ -671,14 +671,14 @@ void PropertySheet::setAlias(CellAddress address, const std::string &alias) void PropertySheet::setComputedUnit(CellAddress address, const Base::Unit &unit) { Cell * cell = nonNullCellAt(address); - assert(cell); + assert(cell != nullptr); cell->setComputedUnit(unit); } void PropertySheet::setSpans(CellAddress address, int rows, int columns) { Cell * cell = nonNullCellAt(address); - assert(cell); + assert(cell != nullptr); cell->setSpans(rows, columns); } diff --git a/src/Mod/Spreadsheet/App/Sheet.cpp b/src/Mod/Spreadsheet/App/Sheet.cpp index 4824e03300..b7d0f7f780 100644 --- a/src/Mod/Spreadsheet/App/Sheet.cpp +++ b/src/Mod/Spreadsheet/App/Sheet.cpp @@ -384,7 +384,7 @@ Cell *Sheet::getNewCell(CellAddress address) void Sheet::setCell(const char * address, const char * contents) { - assert(address && contents); + assert(address != nullptr && contents != nullptr); setCell(CellAddress(address), contents); } @@ -400,7 +400,7 @@ void Sheet::setCell(const char * address, const char * contents) void Sheet::setCell(CellAddress address, const char * value) { - assert(value); + assert(value != nullptr); if (*value == '\0') {