Skip to content
This repository was archived by the owner on Sep 7, 2021. It is now read-only.

Commit fe04c5b

Browse files
committed
Merge branch 'bugfix/iss8884' of https://github.com/montegoulding/livecode into feature-revised_properties_prop
2 parents b46640f + 226dad4 commit fe04c5b

3 files changed

Lines changed: 27 additions & 11 deletions

File tree

engine/src/image.cpp

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -896,13 +896,13 @@ Exec_stat MCImage::setprop(uint4 parid, Properties p, MCExecPoint &ep, Boolean e
896896
if (data != MCnullmcstring)
897897
/* UNCHECKED */ t_filename = data.clone();
898898

899-
setfilename(t_filename);
900-
899+
bool t_success = setfilename(t_filename);
900+
901901
MCCStringFree(t_filename);
902902

903903
resetimage();
904904

905-
if (m_rep != nil)
905+
if (t_success)
906906
MCresult->clear(False);
907907
else
908908
MCresult->sets("could not open image");
@@ -1008,9 +1008,12 @@ Exec_stat MCImage::setprop(uint4 parid, Properties p, MCExecPoint &ep, Boolean e
10081008

10091009
if (data.getlength() == 0)
10101010
{
1011-
// empty text - unset flags & set rep to nil;
1012-
flags &= ~(F_COMPRESSION | F_TRUE_COLOR | F_HAS_FILENAME);
1013-
setrep(nil);
1011+
if (flags & F_HAS_FILENAME)
1012+
{
1013+
// empty text - unset flags & set rep to nil;
1014+
flags &= ~(F_COMPRESSION | F_TRUE_COLOR | F_HAS_FILENAME);
1015+
setrep(nil);
1016+
}
10141017
}
10151018
else
10161019
{
@@ -2055,10 +2058,15 @@ bool MCImage::setfilename(const char *p_filename)
20552058

20562059
if (p_filename == nil)
20572060
{
2058-
setrep(nil);
2059-
flags &= ~(F_COMPRESSION | F_TRUE_COLOR | F_NEED_FIXING);
2060-
flags &= ~F_HAS_FILENAME;
2061-
return true;
2061+
if (flags & F_HAS_FILENAME)
2062+
{
2063+
setrep(nil);
2064+
flags &= ~(F_COMPRESSION | F_TRUE_COLOR | F_NEED_FIXING);
2065+
flags &= ~F_HAS_FILENAME;
2066+
return true;
2067+
}
2068+
else
2069+
return false;
20622070
}
20632071

20642072
char *t_filename = nil;

engine/src/props.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ static PropList groupprops[] =
170170
{"opaque", P_OPAQUE},
171171
{"radioBehavior", P_RADIO_BEHAVIOR},
172172
{"rect", P_RECTANGLE},
173+
{"selectGroupedControls", P_SELECT_GROUPED_CONTROLS},
173174
{"scrollbarWidth", P_SCROLLBAR_WIDTH},
174175
{"shadowColor", P_SHADOW_COLOR},
175176
{"shadowPattern", P_SHADOW_PATTERN},
@@ -776,6 +777,12 @@ Exec_stat MCObject::getproparray(MCExecPoint &ep, uint4 parid, bool effective)
776777
// MERG-2013-05-07: [[ RevisedPropsProp ]] Special-case the props that could
777778
// be either Unicode or native (ensure minimal encoding is used).
778779
switch ((Properties)table[tablesize].value) {
780+
case P_SHORT_NAME:
781+
if (isunnamed())
782+
ep.clear();
783+
else
784+
getprop(parid, P_SHORT_NAME, ep, effective);
785+
break;
779786
case P_LABEL:
780787
getprop(parid, P_UNICODE_LABEL, ep, effective);
781788
if (!ep.trytoconvertutf16tonative())

engine/src/variablearray.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1378,6 +1378,7 @@ static struct { Properties prop; const char *tag; } s_preprocess_props[] =
13781378
{ P_HEIGHT, "height" }, // incase top,bottom are in the array
13791379
{ P_STYLE, "style" }, // changes numerous properties including text alignment
13801380
{ P_TEXT_SIZE, "textSize" }, // changes textHeight
1381+
{ P_FILE_NAME, "fileName" }, // setting image filenames to empty after setting the text will clear them
13811382
{ P_FORE_PATTERN, "forePattern" },
13821383
{ P_FORE_PATTERN, "foregroundPattern" },
13831384
{ P_FORE_PATTERN, "textPattern" },
@@ -1410,7 +1411,7 @@ Exec_stat MCVariableArray::setprops(uint4 parid, MCObject *optr)
14101411
uindex_t t_preprocess_size = sizeof(s_preprocess_props) / sizeof(s_preprocess_props[0]);
14111412
for (j=0; j<t_preprocess_size; j++)
14121413
{
1413-
e = lookuphash(s_preprocess_props[j].tag,true,false);
1414+
e = lookuphash(s_preprocess_props[j].tag,false,false);
14141415
if (e)
14151416
{
14161417
e -> value . fetch(ep);

0 commit comments

Comments
 (0)