TD: modernize C++11

* use nullptr
This commit is contained in:
wmayer
2022-03-23 19:07:44 +01:00
parent d1d4b996e7
commit e8f9c8a1d3
146 changed files with 320 additions and 320 deletions

View File

@@ -71,7 +71,7 @@ PROPERTY_SOURCE(TechDraw::DrawPage, App::DocumentObject)
const char* DrawPage::ProjectionTypeEnums[] = { "First Angle",
"Third Angle",
NULL };
nullptr };
DrawPage::DrawPage(void)
{
@@ -81,9 +81,9 @@ DrawPage::DrawPage(void)
ADD_PROPERTY_TYPE(KeepUpdated, (Preferences::keepPagesUpToDate()),
group, (App::PropertyType)(App::Prop_Output), "Keep page in sync with model");
ADD_PROPERTY_TYPE(Template, (0), group, (App::PropertyType)(App::Prop_None), "Attached Template");
ADD_PROPERTY_TYPE(Template, (nullptr), group, (App::PropertyType)(App::Prop_None), "Attached Template");
Template.setScope(App::LinkScope::Global);
ADD_PROPERTY_TYPE(Views, (0), group, (App::PropertyType)(App::Prop_None), "Attached Views");
ADD_PROPERTY_TYPE(Views, (nullptr), group, (App::PropertyType)(App::Prop_None), "Attached Views");
Views.setScope(App::LinkScope::Global);
// Projection Properties
@@ -136,7 +136,7 @@ void DrawPage::onChanged(const App::Property* prop)
const std::vector<App::DocumentObject*> &vals = Views.getValues();
for(std::vector<App::DocumentObject *>::const_iterator it = vals.begin(); it < vals.end(); ++it) {
TechDraw::DrawView *view = dynamic_cast<TechDraw::DrawView *>(*it);
if (view != NULL && view->ScaleType.isValue("Page")) {
if (view != nullptr && view->ScaleType.isValue("Page")) {
if(std::abs(view->Scale.getValue() - Scale.getValue()) > FLT_EPSILON) {
view->Scale.setValue(Scale.getValue());
}
@@ -148,7 +148,7 @@ void DrawPage::onChanged(const App::Property* prop)
const std::vector<App::DocumentObject*> &vals = Views.getValues();
for(std::vector<App::DocumentObject *>::const_iterator it = vals.begin(); it < vals.end(); ++it) {
TechDraw::DrawProjGroup *view = dynamic_cast<TechDraw::DrawProjGroup *>(*it);
if (view != NULL && view->ProjectionType.isValue("Default")) {
if (view != nullptr && view->ProjectionType.isValue("Default")) {
view->ProjectionType.touch();
}
}
@@ -193,7 +193,7 @@ PyObject *DrawPage::getPyObject(void)
bool DrawPage::hasValidTemplate() const
{
App::DocumentObject *obj = 0;
App::DocumentObject *obj = nullptr;
obj = Template.getValue();
if(obj && obj->isDerivedFrom(TechDraw::DrawTemplate::getClassTypeId())) {
@@ -209,7 +209,7 @@ bool DrawPage::hasValidTemplate() const
double DrawPage::getPageWidth() const
{
App::DocumentObject *obj = 0;
App::DocumentObject *obj = nullptr;
obj = Template.getValue();
if( obj && obj->isDerivedFrom(TechDraw::DrawTemplate::getClassTypeId()) ) {
@@ -222,7 +222,7 @@ double DrawPage::getPageWidth() const
double DrawPage::getPageHeight() const
{
App::DocumentObject *obj = 0;
App::DocumentObject *obj = nullptr;
obj = Template.getValue();
if(obj) {