@@ -55,6 +55,27 @@ along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
5555
5656// //////////////////////////////////////////////////////////////////////////////
5757
58+ static bool MCChunkTermIsNestable (Chunk_term p_chunk_term)
59+ {
60+ switch (p_chunk_term)
61+ {
62+ case CT_STACK :
63+ case CT_GROUP :
64+ case CT_LAYER :
65+ case CT_ELEMENT :
66+ return true ;
67+ default :
68+ return false ;
69+ }
70+ }
71+
72+ static bool MCChunkTermHasRange (Chunk_term p_chunk_term)
73+ {
74+ return p_chunk_term >= CT_LINE && p_chunk_term < CT_ELEMENT ;
75+ }
76+
77+ // //////////////////////////////////////////////////////////////////////////////
78+
5879#ifdef COLLECTING_CHUNKS
5980#include " newchunk.h"
6081class MCSyntaxCollector
@@ -991,30 +1012,10 @@ void MCChunk::getoptionalobj(MCExecContext& ctxt, MCObjectPtr &r_object, Boolean
9911012 ctxt . LegacyThrow (EE_CHUNK_NOTARGET );
9921013 return ;
9931014 }
994- // SN-2015-01-13: [[ Bug 14376 ]] Remove this if statement added during the refactoring process
995- // (commit 15a49a27e387f3e49e5bcce8f8316348578bf810)
996- // which leads to a part_id of 0 instead of the card part id.
997- // if (background == nil && card == nil && group == nil && object == nil)
998- // {
999- // r_object . object = t_object . object;
1000- // r_object . part_id = t_object . part_id;
1001- // return;
1002- // }
1003- switch (t_object . object -> gettype ())
1004- {
1005- case CT_AUDIO_CLIP :
1006- case CT_VIDEO_CLIP :
1007- case CT_LAYER :
1008- case CT_MENU :
1009- case CT_BUTTON :
1010- case CT_IMAGE :
1011- case CT_FIELD :
1012- case CT_GRAPHIC :
1013- case CT_EPS :
1014- case CT_SCROLLBAR :
1015- case CT_PLAYER :
1016- case CT_MAGNIFY :
1017- case CT_COLOR_PALETTE :
1015+
1016+ Chunk_term t_type = t_object . object -> gettype ();
1017+ if (MCChunkTermIsControl (t_type) && t_type != CT_GROUP )
1018+ {
10181019 MCCard *t_card;
10191020 t_card = t_object . object -> getcard (t_object . part_id);
10201021 if (t_card == nil)
@@ -1028,9 +1029,7 @@ void MCChunk::getoptionalobj(MCExecContext& ctxt, MCObjectPtr &r_object, Boolean
10281029 r_object . object = t_object . object;
10291030 r_object . part_id = t_object . part_id;
10301031 return ;
1031- default :
1032- break ;
1033- }
1032+ }
10341033 }
10351034 else if (noobjectchunks ())
10361035 {
@@ -3453,22 +3452,3 @@ MCChunkType MCChunkTypeFromChunkTerm(Chunk_term p_chunk_term)
34533452 MCUnreachableReturn (kMCChunkTypeLine );
34543453 }
34553454}
3456-
3457- bool MCChunkTermIsNestable (Chunk_term p_chunk_term)
3458- {
3459- switch (p_chunk_term)
3460- {
3461- case CT_STACK :
3462- case CT_GROUP :
3463- case CT_LAYER :
3464- case CT_ELEMENT :
3465- return true ;
3466- default :
3467- return false ;
3468- }
3469- }
3470-
3471- bool MCChunkTermHasRange (Chunk_term p_chunk_term)
3472- {
3473- return p_chunk_term >= CT_LINE && p_chunk_term < CT_ELEMENT ;
3474- }
0 commit comments