[TD] App: remove some superfluous nullptr checks

This commit is contained in:
Uwe
2022-07-19 02:03:50 +02:00
parent 32ab100ed5
commit 36add10c86
27 changed files with 131 additions and 143 deletions

View File

@@ -132,7 +132,7 @@ void DrawView::onChanged(const App::Property* prop)
auto page = findParentPage();
if (ScaleType.isValue("Page")) {
Scale.setStatus(App::Property::ReadOnly,true);
if (page != nullptr) {
if (page) {
if(std::abs(page->Scale.getValue() - getScale()) > FLT_EPSILON) {
Scale.setValue(page->Scale.getValue());
}
@@ -481,7 +481,7 @@ void DrawView::handleChangedPropertyType(
if (strcmp(glink.getTypeId().getName(), TypeName) == 0) { //property in file is plg
glink.setContainer(this);
glink.Restore(reader);
if (glink.getValue() != nullptr) {
if (glink.getValue()) {
static_cast<App::PropertyLinkList*>(prop)->setScope(App::LinkScope::Global);
static_cast<App::PropertyLinkList*>(prop)->setValue(glink.getValue());
}
@@ -489,7 +489,7 @@ void DrawView::handleChangedPropertyType(
else if (strcmp(link.getTypeId().getName(), TypeName) == 0) { //property in file is pl
link.setContainer(this);
link.Restore(reader);
if (link.getValue() != nullptr) {
if (link.getValue()) {
static_cast<App::PropertyLinkList*>(prop)->setScope(App::LinkScope::Global);
static_cast<App::PropertyLinkList*>(prop)->setValue(link.getValue());
}