Skip to content

Commit a15e87c

Browse files
committed
Updates on some methods (of Tab 'Extras')
1 parent 9eae5ea commit a15e87c

27 files changed

Lines changed: 43 additions & 60 deletions

engine/src/block.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,7 @@ void MCBlock::draw(MCDC *dc, int2 x, int2 cx, int2 y, uint2 si, uint2 ei, const
12851285
{
12861286
MCRectangle t_box;
12871287
MCU_set_rect(t_box, x - 1, y - t_ascent, getwidth(dc, cx) + 3, t_ascent + t_descent);
1288-
dc -> drawlink(MCStringGetCString(getlinktext()), t_box);
1288+
dc -> drawlink(getlinktext(), t_box);
12891289
}
12901290
}
12911291

engine/src/cmds.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,11 +708,11 @@ Scroll To Selection, Replace..., Replace Again, Comment, Uncomment,
708708
Set Checkpoint, Step, Step Into, Trace, Go, Trace Delay..., Abort,
709709
Variable Watcher, Message Watcher
710710
*/
711-
const char *MCDoMenu::lookup(const MCString &s)
711+
const char *MCDoMenu::lookup(MCStringRef s)
712712
{
713713
uint2 size = ELEMENTS(domenu_table);
714714
while(size--)
715-
if (s == domenu_table[size].token)
715+
if (MCStringIsEqualToCString(s, domenu_table[size].token, kMCCompareExact));
716716
return domenu_table[size].command;
717717
return NULL;
718718
}

engine/src/cmds.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class MCDoMenu : public MCStatement
119119
{
120120
source = NULL;
121121
}
122-
const char *lookup(const MCString &s);
122+
const char *lookup(MCStringRef s);
123123
virtual ~MCDoMenu();
124124
virtual Parse_stat parse(MCScriptPoint &);
125125
virtual Exec_stat exec(MCExecPoint &);
@@ -1441,7 +1441,7 @@ class MCKill : public MCStatement
14411441
sig = NULL;
14421442
pname = NULL;
14431443
}
1444-
int4 lookup(const MCString &s);
1444+
int4 lookup(MCStringRef s);
14451445
virtual ~MCKill();
14461446
virtual Parse_stat parse(MCScriptPoint &);
14471447
virtual Exec_stat exec(MCExecPoint &);

engine/src/cmdsf.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2643,11 +2643,11 @@ static ST signal_table[] = {
26432643
#endif
26442644
};
26452645

2646-
int4 MCKill::lookup(const MCString &s)
2646+
int4 MCKill::lookup(MCStringRef s)
26472647
{
26482648
uint2 size = ELEMENTS(signal_table);
26492649
while(size--)
2650-
if (s == signal_table[size].token)
2650+
if (MCStringIsEqualToCString(s, signal_table[size].token, kMCCompareExact));
26512651
return signal_table[size].which;
26522652
return SIGTERM;
26532653
}

engine/src/context.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ class MCContext
173173

174174
virtual void drawimage(const MCImageDescriptor& p_image, int2 sx, int2 sy, uint2 sw, uint2 sh, int2 dx, int2 dy) = 0;
175175

176-
virtual void drawlink(const char *link, const MCRectangle& region) = 0;
176+
virtual void drawlink(MCStringRef link, const MCRectangle& region) = 0;
177177

178178
virtual int4 textwidth(MCFontStruct *f, const char *s, uint2 l, bool p_unicode_override = false) = 0;
179179

engine/src/contextscalewrapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ void MCContextScaleWrapper::drawimage(const MCImageDescriptor& p_image, int2 sx,
454454
MCImageFreeBitmap(t_scaled);
455455
}
456456

457-
void MCContextScaleWrapper::drawlink(const char *link, const MCRectangle& region)
457+
void MCContextScaleWrapper::drawlink(MCStringRef link, const MCRectangle& region)
458458
{
459459
// This is a no-op as links are irrelevant to rasterized portions. The print
460460
// system will iterate through any links and render them directly.

engine/src/contextscalewrapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class MCContextScaleWrapper: public MCContext
100100
const char *fontname, uint2 fontsize, uint2 fontstyle, MCFontStruct *font, const MCRectangle& trect);
101101
void drawimage(const MCImageDescriptor& p_image, int2 sx, int2 sy, uint2 sw, uint2 sh, int2 dx, int2 dy);
102102

103-
void drawlink(const char *link, const MCRectangle& region);
103+
void drawlink(MCStringRef link, const MCRectangle& region);
104104

105105
int4 textwidth(MCFontStruct *f, const char *s, uint2 l, bool p_unicode_override = false);
106106

engine/src/exec.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -170,25 +170,6 @@ bool FormatUnsignedInteger(uinteger_t p_integer, MCStringRef& r_output)
170170
return MCStringFormat(r_output, "%d", p_integer);
171171
}
172172

173-
////////////////////////////////////////////////////////////////////////////////
174-
175-
bool MCExecContext::EncodeStringAsUTF8(MCStringRef self, char*& r_utf8_string)
176-
{
177-
MCExecPoint ep;
178-
ep . setsvalue(MCStringGetOldString(self));
179-
ep . nativetoutf8();
180-
r_utf8_string = ep . getsvalue() . clone();
181-
return true;
182-
}
183-
184-
bool MCExecContext::EncodeUnicodeStringAsUTF8(MCStringRef self, char*& r_utf8_string)
185-
{
186-
MCExecPoint ep;
187-
ep . setsvalue(MCStringGetOldString(self));
188-
ep . utf16toutf8();
189-
r_utf8_string = ep . getsvalue() . clone();
190-
return true;
191-
}
192173

193174
////////////////////////////////////////////////////////////////////////////////
194175

engine/src/exec.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -638,11 +638,7 @@ class MCExecContext
638638
bool FormatLegacyRectangle(MCRectangle value, MCStringRef& r_value);
639639
bool FormatLegacyColor(MCColor value, MCStringRef& r_value);
640640

641-
//////////
642641

643-
bool EncodeStringAsUTF8(MCStringRef string, char*& r_cstring);
644-
bool EncodeUnicodeStringAsUTF8(MCStringRef string, char*& r_cstring);
645-
646642
//////////
647643

648644
// This method evaluates the given expression returning the result in 'result'.

engine/src/express.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ void MCExpression::compile_out(MCSyntaxFactoryRef ctxt)
605605

606606
#ifdef _MOBILE
607607
extern bool MCIsPlatformMessage(MCNameRef handler_name);
608-
extern Exec_stat MCHandlePlatformMessage(const MCString& p_message, MCParameter *p_parameters);
608+
extern Exec_stat MCHandlePlatformMessage(MCStringRef p_message, MCParameter *p_parameters);
609609
#endif
610610

611611
MCFuncref::MCFuncref(MCNameRef inname)
@@ -712,7 +712,7 @@ Exec_stat MCFuncref::eval(MCExecPoint &ep)
712712
#ifdef _MOBILE
713713
if (platform_message)
714714
{
715-
return MCHandlePlatformMessage(MCNameGetOldString(name), params);
715+
return MCHandlePlatformMessage(MCNameGetString(name), params);
716716
}
717717
#endif
718718
// MW-2008-12-17: [[ Bug 7463 ]] Make sure we use the object from the execpoint, rather

0 commit comments

Comments
 (0)