Skip to content
This repository was archived by the owner on Jul 3, 2025. It is now read-only.

Commit 6d245b8

Browse files
committed
Updates after feedback #1. I get 2 linking errors because of the setintprop() method
1 parent 88d2bb6 commit 6d245b8

9 files changed

Lines changed: 44 additions & 29 deletions

File tree

engine/src/exec-interface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2513,7 +2513,7 @@ void MCInterfaceExecHideGroups(MCExecContext& ctxt)
25132513

25142514
void MCInterfaceExecHideObject(MCExecContext& ctxt, MCObjectPtr p_target)
25152515
{
2516-
p_target . object -> setsprop(P_VISIBLE, MCSTR(MCfalsestring));
2516+
p_target . object -> setboolprop(ctxt, 0, P_VISIBLE, False, false);
25172517
}
25182518

25192519
void MCInterfaceExecHideObjectWithEffect(MCExecContext& ctxt, MCObjectPtr p_target, MCVisualEffect *p_effect)
@@ -2547,7 +2547,7 @@ void MCInterfaceExecHideObjectWithEffect(MCExecContext& ctxt, MCObjectPtr p_targ
25472547

25482548
// MW-2011-11-15: [[ Bug 9846 ]] Make sure we use the same mechanism to
25492549
// set visibility as the non-effect case.
2550-
p_target . object->setsprop(P_VISIBLE, MCSTR(MCfalsestring));
2550+
p_target . object -> setboolprop(ctxt, 0, P_VISIBLE, False, false);
25512551

25522552
MCRedrawUnlockScreen();
25532553

engine/src/exec-multimedia.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ void MCMultimediaExecLoadVideoClip(MCExecContext& ctxt, MCStack *p_target, int p
414414
tmpfile = True;
415415
}
416416
tptr = (MCPlayer *)MCtemplateplayer->clone(False, OP_NONE, false);
417-
tptr->setsprop(P_SHOW_BORDER, MCSTR(MCfalsestring));
417+
tptr -> setboolprop(ctxt, 0, P_SHOW_BORDER, False, false);
418418
tptr->setfilename(*t_video_name, *t_temp, tmpfile);
419419
tptr->open();
420420
if (p_prepare)

engine/src/idraw.cpp

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
2020
#include "filedefs.h"
2121
#include "objdefs.h"
2222
#include "parsedef.h"
23-
23+
#include "execpt.h"
24+
#include "exec.h"
2425
#include "stacklst.h"
2526
#include "undolst.h"
2627
#include "image.h"
@@ -166,20 +167,30 @@ void MCImage::startmag(int2 x, int2 y)
166167
MCmagimage = this;
167168
state |= CS_MAGNIFY;
168169

169-
MCAutoStringRef buffer;
170-
MCStringFormat(&buffer, "%d", rect.width * MCmagnification);
171-
sptr->setsprop(P_MAX_WIDTH, *buffer);
170+
//MCAutoStringRef buffer;
171+
//MCStringFormat(&buffer, "%d", rect.width * MCmagnification);
172+
//sptr->setsprop(P_MAX_WIDTH, *buffer);
173+
MCExecPoint ep(this, NULL, NULL);
174+
MCExecContext ctxt(ep);
175+
176+
sptr->setintprop(ctxt, 0, P_MAX_WIDTH, False, rect.width * MCmagnification);
177+
178+
//MCStringFormat(&buffer, "%d", rect.width * MCmagnification);
179+
//sptr->setsprop(P_MAX_HEIGHT, *buffer);
180+
sptr->setintprop(ctxt, 0, P_MAX_HEIGHT, False, rect.width * MCmagnification);
172181

173-
MCStringFormat(&buffer, "%d", rect.width * MCmagnification);
174-
sptr->setsprop(P_MAX_HEIGHT, *buffer);
175182

176183
uint2 ssize = MCU_min(32, rect.width);
177-
MCStringFormat(&buffer, "%d", ssize * MCmagnification);
178-
sptr->setsprop(P_WIDTH, *buffer);
184+
//MCStringFormat(&buffer, "%d", ssize * MCmagnification);
185+
//sptr->setsprop(P_WIDTH, *buffer);
186+
sptr->setintprop(ctxt, 0, P_WIDTH, False, ssize * MCmagnification);
187+
179188

180189
ssize = MCU_min(32, rect.height);
181-
MCStringFormat(&buffer, "%d", ssize * MCmagnification);
182-
sptr->setsprop(P_HEIGHT, *buffer);
190+
// MCStringFormat(&buffer, "%d", ssize * MCmagnification);
191+
// sptr->setsprop(P_HEIGHT, *buffer);
192+
sptr->setintprop(ctxt, 0, P_HEIGHT, False, ssize * MCmagnification);
193+
183194

184195
MCRectangle drect = sptr->getrect();
185196
magrect.width = drect.width / MCmagnification;

engine/src/mcssl.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ unsigned long SSLError(MCStringRef errbuf)
134134
{
135135
if (!InitSSLCrypt())
136136
{
137-
MCStringCopy(MCSTR("ssl library not found"), errbuf);
137+
errbuf = MCSTR("ssl library not found");
138138
return 0;
139139
}
140140
#ifdef MCSSL
@@ -143,10 +143,10 @@ unsigned long SSLError(MCStringRef errbuf)
143143
{
144144
if (ecode)
145145
{
146-
char *t_errbuf;
146+
MCAutoPointer<char> t_errbuf;
147147
t_errbuf = new char[256];
148-
ERR_error_string_n(ecode,t_errbuf,255);
149-
/* UNCHECKED */ MCStringCreateWithCString(t_errbuf, errbuf);
148+
ERR_error_string_n(ecode,&t_errbuf,255);
149+
/* UNCHECKED */ MCStringCreateWithCString(*t_errbuf, errbuf);
150150
}
151151
else
152152
errbuf = MCValueRetain(kMCEmptyString);

engine/src/object.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1226,7 +1226,7 @@ void MCObject::setstate(Boolean on, uint4 newstate)
12261226
Exec_stat MCObject::setsprop(Properties which, MCStringRef s)
12271227
{
12281228
MCExecPoint ep(this, NULL, NULL);
1229-
ep.setsvalue(MCStringGetOldString(s));
1229+
ep.setvalueref(s);
12301230
return setprop(0, which, ep, False);
12311231
}
12321232

engine/src/objectprops.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,9 @@ Exec_stat MCObject::getarrayprop_legacy(uint4 parid, Properties which, MCExecPoi
812812
// Check the textstyle string is within the object's textstyle set.
813813
MCAutoStringRef t_value;
814814
ep . copyasstringref(&t_value);
815-
ep . setboolean(string_contains_item(*t_value, MCSTR(MCF_unparsetextstyle(t_style))));
815+
MCAutoStringRef t_textstyle;
816+
/* UNCHECKED */ MCStringCreateWithCString(MCF_unparsetextstyle(t_style), &t_textstyle);
817+
ep . setboolean(string_contains_item(*t_value, *t_textstyle));
816818
}
817819
break;
818820
case P_CUSTOM_KEYS:

engine/src/rtf.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -824,8 +824,8 @@ RTFStatus RTFReader::ParseDocument(RTFToken p_token, int4 p_value)
824824
{ -1, kMCTextEncodingUndefined }
825825
};
826826

827-
MCAutoStringRef t_new_font;
828-
/* UNCHECKED */ MCStringCreateWithCString(m_fonts . GetName(p_value), &t_new_font);
827+
const char *t_new_font;
828+
t_new_font = m_fonts . GetName(p_value);
829829

830830
uint4 t_new_charset;
831831
t_new_charset = m_fonts . GetCharset(p_value);
@@ -843,7 +843,7 @@ RTFStatus RTFReader::ParseDocument(RTFToken p_token, int4 p_value)
843843
}
844844

845845
m_state . SetTextEncoding(t_new_encoding);
846-
m_state . SetFontName(*t_new_font);
846+
m_state . SetFontName(t_new_font);
847847
m_attributes_changed = true;
848848
}
849849
break;

engine/src/rtf.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ class RTFState
212212
void SetUnicodeSkip(uint4 p_skip);
213213
uint4 GetUnicodeSkip(void) const;
214214

215-
void SetFontName(MCStringRef p_name);
215+
void SetFontName(const char *p_name);
216216
const char *GetFontName(void) const;
217217

218218
void SetFontStyle(RTFFontStyle p_style);
@@ -355,12 +355,12 @@ inline uint4 RTFState::GetUnicodeSkip(void) const
355355
return m_entries -> unicode_skip;
356356
}
357357

358-
inline void RTFState::SetFontName(MCStringRef p_name)
358+
inline void RTFState::SetFontName(const char *p_name)
359359
{
360360
if (m_entries == NULL)
361361
return;
362362

363-
m_entries -> font_name = MCStringGetCString(p_name);
363+
m_entries -> font_name = p_name;
364364
}
365365

366366
inline const char *RTFState::GetFontName(void) const

engine/src/w32theme.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -744,20 +744,22 @@ void MCNativeTheme::getthemecolor(const MCWidgetInfo &winfo, Widget_Color ctype,
744744
switch (ctype)
745745
{
746746
case WCOLOR_TEXT:
747-
MCStringFormat(r_colorbuf, menucolors[0] != NULL? menucolors[0]: "0,0,0");
747+
/* UNCHECKED */ MCStringCreateWithCString(menucolors[0] != NULL? menucolors[0]: "0,0,0", r_colorbuf);
748748
break;
749749
case WCOLOR_HILIGHT:
750-
MCStringFormat(r_colorbuf, menucolors[1] != NULL? menucolors[1]: "255,0,0");
750+
/* UNCHECKED */ MCStringCreateWithCString(menucolors[1] != NULL? menucolors[1]: "255,0,0", r_colorbuf);
751751
break;
752752
case WCOLOR_BACK:
753-
MCStringFormat((r_colorbuf, menucolors[2] != NULL? menucolors[2]: "255,255,255");
753+
/* UNCHECKED */ MCStringCreateWithCString(menucolors[2] != NULL? menucolors[2]: "255,255,255", r_colorbuf);
754754
break;
755755
case WCOLOR_BORDER:
756-
MCStringFormat(r_colorbuf, menucolors[3] != NULL? menucolors[3]: "155,155,155");
756+
/* UNCHECKED */ MCStringCreateWithCString(menucolors[3] != NULL? menucolors[3]: "155,155,155", r_colorbuf);
757757
break;
758758
}
759759

760760
}
761+
else
762+
r_colorbuf = MCValueRetain(kMCEmptyString);
761763
}
762764

763765

0 commit comments

Comments
 (0)