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

Commit cb6b09a

Browse files
committed
Merge pull request #1 from peter-b/modular
Merge from main 'develop' branch.
2 parents 57212b0 + 8a1083e commit cb6b09a

25 files changed

+2959
-308
lines changed

docs/notes/bugfix-13988.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# put data after or before variable should result in data if variable is empty

engine/Test-Info.plist

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>English</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(PRODUCT_NAME)</string>
9+
<key>CFBundleGetInfoString</key>
10+
<string>$(BUILD_LONG_VERSION), Copyright 2000-2013 Runtime Revolution Ltd.</string>
11+
<key>CFBundleIconFile</key>
12+
<string>installer.icns</string>
13+
<key>CFBundleIdentifier</key>
14+
<string>com.runrev.livecode.test</string>
15+
<key>CFBundleInfoDictionaryVersion</key>
16+
<string>6.0</string>
17+
<key>CFBundleLongVersionString</key>
18+
<string>$(BUILD_LONG_VERSION), Copyright 2000-2013 Runtime Revolution Ltd.</string>
19+
<key>CFBundleName</key>
20+
<string>Installer</string>
21+
<key>CFBundlePackageType</key>
22+
<string>APPL</string>
23+
<key>CFBundleShortVersionString</key>
24+
<string>$(BUILD_LONG_VERSION)</string>
25+
<key>CFBundleSignature</key>
26+
<string>Revo</string>
27+
<key>CFBundleVersion</key>
28+
<string>$(BUILD_LONG_VERSION)</string>
29+
<key>CSResourcesFileMapped</key>
30+
<false/>
31+
<key>LFPrefersCarbon</key>
32+
<true/>
33+
<key>LSGetAppDiedEvents</key>
34+
<true/>
35+
<key>NSAppleScriptEnabled</key>
36+
<string>YES</string>
37+
<key>NSHighResolutionCapable</key>
38+
<true/>
39+
<key>NSHumanReadableCopyright</key>
40+
<string>Copyright 2000-2013, Runtime Revolution Ltd., All Rights Reserved.</string>
41+
<key>NSPrincipalClass</key>
42+
<string>com_runrev_livecode_MCApplication</string>
43+
</dict>
44+
</plist>

engine/engine.xcodeproj/project.pbxproj

Lines changed: 997 additions & 0 deletions
Large diffs are not rendered by default.

engine/src/button.cpp

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ Boolean MCButton::mfocus(int2 x, int2 y)
960960
return True;
961961
}
962962
if (!(flags & F_VISIBLE || MCshowinvisibles)
963-
|| flags & F_DISABLED && getstack()->gettool(this) == T_BROWSE)
963+
|| (flags & F_DISABLED && getstack()->gettool(this) == T_BROWSE))
964964
return False;
965965
Tool tool = getstack()->gettool(this);
966966

@@ -1019,9 +1019,9 @@ Boolean MCButton::mfocus(int2 x, int2 y)
10191019
&& (menumode != WM_TOP_LEVEL || getstyleint(flags) != F_MENU)
10201020
&& state & CS_MFOCUSED && !(state & CS_SELECTED))
10211021
{
1022-
if (MClook == LF_MOTIF || flags & F_SHOW_ICON
1023-
|| getstyleint(flags) != F_RADIO
1024-
&& getstyleint(flags) != F_CHECK)
1022+
if (MClook == LF_MOTIF || flags & F_SHOW_ICON ||
1023+
(getstyleint(flags) != F_RADIO &&
1024+
getstyleint(flags) != F_CHECK))
10251025
{
10261026
if (MCU_point_in_rect(rect, x, y))
10271027
{
@@ -1231,10 +1231,12 @@ Boolean MCButton::mdown(uint2 which)
12311231
entry->mdown(which);
12321232
}
12331233
else
1234+
{
12341235
if (flags & F_AUTO_HILITE || family != 0)
1235-
if (MClook == LF_MOTIF || flags & F_SHOW_ICON
1236-
|| getstyleint(flags) != F_RADIO
1237-
&& getstyleint(flags) != F_CHECK)
1236+
{
1237+
if (MClook == LF_MOTIF || flags & F_SHOW_ICON ||
1238+
(getstyleint(flags) != F_RADIO &&
1239+
getstyleint(flags) != F_CHECK))
12381240
{
12391241
if (getstyleint(flags) != F_RADIO || !(state & CS_HILITED))
12401242
{
@@ -1257,6 +1259,8 @@ Boolean MCButton::mdown(uint2 which)
12571259
// MW-2011-08-18: [[ Layers ]] Invalidate the whole object.
12581260
layer_redrawall();
12591261
}
1262+
}
1263+
}
12601264
if ((!IsMacLF() || entry != NULL)
12611265
&& flags & F_TRAVERSAL_ON && !(state & CS_KFOCUSED))
12621266
getstack()->kfocusset(this);
@@ -1425,10 +1429,12 @@ Boolean MCButton::mup(uint2 which, bool p_release)
14251429
if (state & CS_GRAB)
14261430
{
14271431
if (flags && F_AUTO_HILITE)
1432+
{
14281433
if (starthilite)
14291434
state &= ~CS_HILITED;
14301435
else
14311436
state |= CS_HILITED;
1437+
}
14321438
ungrab(which);
14331439
return True;
14341440
}
@@ -1472,16 +1478,18 @@ Boolean MCButton::mup(uint2 which, bool p_release)
14721478
|| getstyleint(flags) == F_CHECK))
14731479
{
14741480
if (MCU_point_in_rect(rect, mx, my))
1481+
{
14751482
if (getstyleint(flags) == F_CHECK)
14761483
state ^= CS_HILITED;
14771484
else
14781485
state |= CS_HILITED;
1486+
}
14791487
// MW-2011-08-18: [[ Layers ]] Invalidate the whole object.
14801488
layer_redrawall();
14811489
}
14821490
else
1483-
if (state & CS_HILITED && (flags & F_AUTO_HILITE || family != 0)
1484-
|| state & CS_ARMED && flags & F_AUTO_ARM)
1491+
if ((state & CS_HILITED && (flags & F_AUTO_HILITE || family != 0)) ||
1492+
(state & CS_ARMED && flags & F_AUTO_ARM))
14851493
{
14861494
if (getstyleint(flags) == F_CHECK)
14871495
{
@@ -1493,10 +1501,12 @@ Boolean MCButton::mup(uint2 which, bool p_release)
14931501
if (getstyleint(flags) == F_RADIO)
14941502
{
14951503
if (flags & F_AUTO_ARM && flags & F_AUTO_HILITE)
1504+
{
14961505
if (state & CS_ARMED)
14971506
state |= CS_HILITED;
14981507
else
14991508
state &= ~CS_HILITED;
1509+
}
15001510
}
15011511
else
15021512
state &= ~CS_HILITED;
@@ -3505,7 +3515,7 @@ Boolean MCButton::findmenu(bool p_just_for_accel)
35053515
{
35063516
uint2 fheight;
35073517
fheight = gettextheight();
3508-
if ((!IsMacLFAM() || MCModeMakeLocalWindows()) && menumode == WM_COMBO || menumode == WM_OPTION && MClook == LF_WIN95)
3518+
if (((!IsMacLFAM() || MCModeMakeLocalWindows()) && menumode == WM_COMBO) || (menumode == WM_OPTION && MClook == LF_WIN95))
35093519
{
35103520
uindex_t nlines = 1;
35113521
//major menustring
@@ -3561,9 +3571,9 @@ Boolean MCButton::findmenu(bool p_just_for_accel)
35613571
/* UNCHECKED */ MCArrayFetchValueAtIndex(tabs, i + 1, t_tabval);
35623572
MCStringRef t_tab;
35633573
t_tab = (MCStringRef)t_tabval;
3564-
if (MCStringGetCharAtIndex(t_tab, 0) == '!'
3565-
|| MCStringGetCharAtIndex(t_tab, 0) == '('
3566-
&& MCStringGetCharAtIndex(t_tab, 1) == '!')
3574+
if (MCStringGetCharAtIndex(t_tab, 0) == '!' ||
3575+
(MCStringGetCharAtIndex(t_tab, 0) == '(' &&
3576+
MCStringGetCharAtIndex(t_tab, 1) == '!'))
35673577
{
35683578
menuflags &= ~F_STYLE;
35693579
menuflags |= F_CHECK;
@@ -3740,13 +3750,15 @@ void MCButton::freemenu(Boolean force)
37403750
macfreemenu();
37413751
#endif
37423752
if (menu != NULL && !(state & CS_SUBMENU))
3753+
{
37433754
if (!MCNameIsEmpty(menuname))
37443755
{
37453756
menu->removeaccels(getstack());
37463757
menu->removeneed(this);
37473758
menu = NULL;
37483759
}
37493760
else
3761+
{
37503762
if (!MCStringIsEmpty(menustring) || force)
37513763
{
37523764
closemenu(False, True);
@@ -3756,6 +3768,8 @@ void MCButton::freemenu(Boolean force)
37563768
delete menu;
37573769
menu = NULL;
37583770
}
3771+
}
3772+
}
37593773
}
37603774

37613775
void MCButton::docascade(MCStringRef p_pick)
@@ -4719,7 +4733,7 @@ IO_stat MCButton::load(IO_handle stream, uint32_t version)
47194733
{
47204734
if (menumode != WM_CASCADE)
47214735
flags &= ~F_AUTO_ARM;
4722-
flags = flags & ~F_STYLE | F_MENU | F_OPAQUE;
4736+
flags = (flags & ~F_STYLE) | F_MENU | F_OPAQUE;
47234737
}
47244738
if (flags & F_AUTO_ARM)
47254739
flags |= F_OPAQUE | F_TRAVERSAL_ON;

engine/src/combiners.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,8 +655,8 @@ template<int x_combiner, bool x_dst_alpha, bool x_src_alpha> INLINE uint32_t adv
655655
uint16_t t_dst_alpha_src_red, t_dst_alpha_src_green, t_dst_alpha_src_blue, t_dst_alpha_src_alpha, t_dst_alpha_dst_alpha;
656656
uint16_t t_dst_alpha_dst_red, t_dst_alpha_dst_green, t_dst_alpha_dst_blue;
657657
uint16_t t_src_alpha_dst_red, t_src_alpha_dst_green, t_src_alpha_dst_blue, t_src_alpha_dst_alpha;
658-
uint16_t t_inv_dst_alpha_src_red, t_inv_dst_alpha_src_green, t_inv_dst_alpha_src_blue, t_inv_dst_alpha_src_alpha;
659-
uint16_t t_inv_src_alpha_dst_red, t_inv_src_alpha_dst_green, t_inv_src_alpha_dst_blue, t_inv_src_alpha_dst_alpha;
658+
uint16_t t_inv_dst_alpha_src_red, t_inv_dst_alpha_src_green, t_inv_dst_alpha_src_blue, t_inv_dst_alpha_src_alpha ATTRIBUTE_UNUSED;
659+
uint16_t t_inv_src_alpha_dst_red, t_inv_src_alpha_dst_green, t_inv_src_alpha_dst_blue, t_inv_src_alpha_dst_alpha ATTRIBUTE_UNUSED;
660660
uint32_t t_dst_alpha_dst_alpha_src_alpha;
661661
uint8_t t_red, t_green, t_blue, t_alpha;
662662

engine/src/dispatch.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,17 @@ class MCDispatch : public MCObject
6363
MCDispatch();
6464
// virtual functions from MCObject
6565
virtual ~MCDispatch();
66+
#ifdef MODE_TEST
67+
virtual void timer(MCNameRef mptr, MCParameter *params);
68+
#endif
6669

6770
virtual const MCObjectPropertyTable *getpropertytable(void) const { return &kPropertyTable; }
6871

6972
#ifdef LEGACY_EXEC
7073
virtual Exec_stat getprop_legacy(uint4 parid, Properties which, MCExecPoint &, Boolean effective);
7174
virtual Exec_stat setprop_legacy(uint4 parid, Properties which, MCExecPoint &, Boolean effective);
7275
#endif
76+
7377
// dummy cut function for checking licensing
7478
virtual Boolean cut(Boolean home);
7579
virtual Exec_stat handle(Handler_type, MCNameRef, MCParameter *params, MCObject *pass_from);

engine/src/exec-engine.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,13 @@ void MCEngineExecPutIntoVariable(MCExecContext& ctxt, MCExecValue p_value, int p
805805
if (MCValueGetTypeCode(p_var . mark . text) == kMCValueTypeCodeData &&
806806
p_value . type == kMCExecValueTypeDataRef)
807807
{
808-
MCEngineExecPutIntoVariable(ctxt, p_value . dataref_value, p_where, p_var);
808+
// AL-2014-11-20: Make sure the incoming exec value is released.
809+
MCAutoDataRef t_value_data;
810+
MCExecTypeConvertAndReleaseAlways(ctxt, p_value . type, &p_value, kMCExecValueTypeDataRef, &(&t_value_data));
811+
if (ctxt . HasError())
812+
return;
813+
814+
MCEngineExecPutIntoVariable(ctxt, *t_value_data, p_where, p_var);
809815
return;
810816
}
811817

engine/src/funcs.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7470,3 +7470,15 @@ void MCMeasureText::eval_ctxt(MCExecContext &ctxt, MCExecValue &r_value)
74707470
r_value . type = kMCExecValueTypeStringRef;
74717471
}
74727472
}
7473+
7474+
#ifdef _TEST
7475+
#include "test.h"
7476+
7477+
static void TestIsOperator(void)
7478+
{
7479+
MCTestAssertTrue("something is correct", true);
7480+
}
7481+
7482+
TEST_DEFINE(IsOperator, TestIsOperator)
7483+
7484+
#endif

engine/src/internal_development.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ class MCInternalBreak: public MCStatement
206206
{
207207
#if defined(WIN32) && defined(_DEBUG)
208208
_CrtDbgBreak();
209-
#endif;
209+
#endif
210210
}
211211
};
212212

engine/src/lextable.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ static LT ask_table[] =
276276

277277
LT command_table[] =
278278
{
279-
#if defined(MODE_DEVELOPMENT) || defined(MODE_INSTALLER)
279+
#if defined(MODE_DEVELOPMENT) || defined(MODE_INSTALLER) || defined(_TEST)
280280
{"_internal", TT_STATEMENT, S_INTERNAL},
281281
#endif
282282
{"accept", TT_STATEMENT, S_ACCEPT},

0 commit comments

Comments
 (0)