@@ -1355,7 +1355,7 @@ void MCObject::SetId(MCExecContext& ctxt, uint32_t p_new_id)
13551355
13561356 // MW-2011-02-08: Don't allow id change if the parent is nil as this means its a template
13571357 // object which doesn't really have an id.
1358- if (parent == nil )
1358+ if (! parent)
13591359 return ;
13601360
13611361 MCStack *t_stack;
@@ -1394,7 +1394,7 @@ void MCObject::SetId(MCExecContext& ctxt, uint32_t p_new_id)
13941394 t_stack -> visit (VISIT_STYLE_DEPTH_FIRST, 0 , &t_visitor);
13951395 }
13961396 else if (parent -> gettype () == CT_CARD)
1397- static_cast <MCCard *>(parent) -> resetid (obj_id, p_new_id);
1397+ parent. GetAs <MCCard>()-> resetid (obj_id, p_new_id);
13981398
13991399 // MW-2012-10-10: [[ IdCache ]] If the object is in the cache, then remove
14001400 // it since its id is changing.
@@ -1520,7 +1520,7 @@ void MCObject::GetLayer(MCExecContext& ctxt, uint32_t part, MCInterfaceLayer& r_
15201520 // the group being edited in edit group mode.
15211521
15221522 uint2 num = 0 ;
1523- if (parent != nil )
1523+ if (parent)
15241524 {
15251525 MCCard *t_card;
15261526 t_card = getcard (part);
@@ -1543,7 +1543,7 @@ void MCObject::GetLayer(MCExecContext& ctxt, uint32_t part, MCInterfaceLayer& r_
15431543
15441544void MCObject::SetLayer (MCExecContext& ctxt, uint32_t part, const MCInterfaceLayer& p_layer)
15451545{
1546- if (parent == NULL || getcard (part)->relayer ((MCControl *)this , p_layer . layer) != ES_NORMAL)
1546+ if (! parent || getcard (part)->relayer ((MCControl *)this , p_layer . layer) != ES_NORMAL)
15471547 ctxt . LegacyThrow (EE_OBJECT_BADRELAYER);
15481548}
15491549
@@ -2110,7 +2110,7 @@ bool MCObject::GetColor(MCExecContext& ctxt, Properties which, bool effective, M
21102110 bool t_found;
21112111 t_found = false ;
21122112
2113- if (parent != NULL )
2113+ if (parent)
21142114 t_found = parent -> GetColor (ctxt, which, effective, r_color, true );
21152115
21162116 if (!t_found && !recursive)
@@ -2447,7 +2447,7 @@ bool MCObject::GetPattern(MCExecContext& ctxt, Properties which, bool effective,
24472447 {
24482448 if (effective)
24492449 {
2450- if (parent != NULL )
2450+ if (parent)
24512451 return parent->GetPattern (ctxt, which, effective, r_pattern);
24522452 else
24532453 {
@@ -2781,7 +2781,7 @@ bool MCObject::TextPropertyMapFont()
27812781 // *not* to attempt to mapfonts on it!
27822782 // MW-2013-03-28: [[ Bug 10791 ]] Exceptions to every rule - the home stack
27832783 // can be open but with no font...
2784- if ((opened == 0 || m_font == nil) && gettype () == CT_STACK && parent != nil )
2784+ if ((opened == 0 || m_font == nil) && gettype () == CT_STACK && parent)
27852785 {
27862786 mapfont ();
27872787 return true ;
@@ -2895,7 +2895,7 @@ void MCObject::SetTextFont(MCExecContext& ctxt, MCStringRef font)
28952895 // to ensure substacks update properly.
28962896 // MW-2013-03-21: [[ Bug ]] Unless its the templateStack (parent == nil) in which
28972897 // case we don't want to do any font recomputation.
2898- if ((gettype () == CT_STACK && parent != nil ) || opened)
2898+ if ((gettype () == CT_STACK && parent) || opened)
28992899 {
29002900 if (recomputefonts (parent -> getfontref ()))
29012901 {
@@ -2960,7 +2960,7 @@ void MCObject::SetTextSize(MCExecContext& ctxt, uinteger_t* size)
29602960 // to ensure substacks update properly.
29612961 // MW-2013-03-21: [[ Bug ]] Unless its the templateStack (parent == nil) in which
29622962 // case we don't want to do any font recomputation.
2963- if ((gettype () == CT_STACK && parent != nil ) || opened)
2963+ if ((gettype () == CT_STACK && parent) || opened)
29642964 {
29652965 if (recomputefonts (parent -> getfontref ()))
29662966 {
@@ -3015,7 +3015,7 @@ void MCObject::SetTextStyle(MCExecContext& ctxt, const MCInterfaceTextStyle& p_s
30153015 // to ensure substacks update properly.
30163016 // MW-2013-03-21: [[ Bug ]] Unless its the templateStack (parent == nil) in which
30173017 // case we don't want to do any font recomputation.
3018- if ((gettype () == CT_STACK && parent != nil ) || opened)
3018+ if ((gettype () == CT_STACK && parent) || opened)
30193019 {
30203020 if (recomputefonts (parent -> getfontref ()))
30213021 {
@@ -3034,7 +3034,7 @@ void MCObject::GetEffectiveTextStyle(MCExecContext& ctxt, MCInterfaceTextStyle&
30343034{
30353035 if ((m_font_flags & FF_HAS_TEXTSIZE) == 0 )
30363036 {
3037- if (parent != nil )
3037+ if (parent)
30383038 parent -> GetEffectiveTextStyle (ctxt, r_style);
30393039 else
30403040 MCdispatcher -> GetDefaultTextStyle (ctxt, r_style);
@@ -3274,25 +3274,25 @@ void MCObject::SetTraversalOn(MCExecContext& ctxt, bool setting)
32743274
32753275void MCObject::GetOwner (MCExecContext& ctxt, MCStringRef& r_owner)
32763276{
3277- if (parent != nil )
3277+ if (parent)
32783278 parent -> GetName (ctxt, r_owner);
32793279}
32803280
32813281void MCObject::GetShortOwner (MCExecContext& ctxt, MCStringRef& r_owner)
32823282{
3283- if (parent != nil )
3283+ if (parent)
32843284 parent -> GetShortName (ctxt, r_owner);
32853285}
32863286
32873287void MCObject::GetAbbrevOwner (MCExecContext& ctxt, MCStringRef& r_owner)
32883288{
3289- if (parent != nil )
3289+ if (parent)
32903290 parent -> GetAbbrevName (ctxt, r_owner);
32913291}
32923292
32933293void MCObject::GetLongOwner (MCExecContext& ctxt, uint32_t p_part_id, MCStringRef& r_owner)
32943294{
3295- if (parent != nil )
3295+ if (parent)
32963296 parent -> GetLongName (ctxt, p_part_id, r_owner);
32973297}
32983298
@@ -3713,7 +3713,7 @@ void MCObject::SetBlendLevel(MCExecContext& ctxt, uinteger_t level)
37133713 if (gettype () < CT_GROUP || !static_cast <MCControl *>(this ) -> layer_issprite ())
37143714 Redraw ();
37153715 else
3716- static_cast <MCCard *>(parent) -> layer_dirtyrect (static_cast <MCControl *>(this ) -> geteffectiverect ());
3716+ parent. GetAs <MCCard>()-> layer_dirtyrect (static_cast <MCControl *>(this ) -> geteffectiverect ());
37173717 }
37183718}
37193719
0 commit comments