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

Commit 13e0f96

Browse files
Merge remote-tracking branch 'origin/develop-7.0' into develop
Changes on libgraphics/src/mblandroidtext.cpp applied to libgraphics/src/harfbuzztext.cpp Changes on docs/dictionary/function/revOpenDatabase.xml applied to docs/dictionary/function/revOpenDatabase.lcdoc
2 parents bb257d1 + 46ec142 commit 13e0f96

File tree

14 files changed

+100
-43
lines changed

14 files changed

+100
-43
lines changed

docs/dictionary/function/revOpenDatabase.lcdoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,6 @@ The SQLite revOpenDatabase() call no longer requires 5 arguments and only requir
8989
Changes:
9090
LiveCode 6.6
9191

92-
References: revSetDatabaseDriverPath (command), revExecuteSQL (command), revLicenseType (function), revDatabaseID (function), revDatabaseConnectResult (function), revDatabaseTableNames (function), revQueryIsAtStart (function)
92+
References: revSetDatabaseDriverPath (command), Database library (library), revExecuteSQL (command), revLicenseType (function), revDatabaseID (function), revDatabaseConnectResult (function), revDatabaseTableNames (function), revQueryIsAtStart (function)
9393

9494
Tags: database

docs/notes/bugfix-14786.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Android fontsize change cause crashes

docs/notes/bugfix-15929.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# reading huge portion of text from Unicode files is extremely slow in LC 7

docs/notes/bugfix-16017.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Message box doesn't remember where it was placed

docs/notes/bugfix-16050.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# revZipOpenArchive stops working on LC 7.1 and xcode 6.4

docs/notes/bugfix-16066.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# revOpenDatabase missing from Dictionary

docs/notes/bugfix-16069.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Crash when closing button menu by clicking outside of it

engine/src/desktop-menu.cpp

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,17 @@ void MCButton::macopenmenu(void)
418418
// SN-2014-08-25: [[ Bug 13240 ]] We need to keep the actual popup_menustring,
419419
// in case some menus are nested
420420
MCStringRef t_menupick;
421-
t_menupick = s_popup_menupick;
422-
s_popup_menupick = nil;
421+
if (s_popup_menupick != NULL)
422+
{
423+
t_menupick = s_popup_menupick;
424+
s_popup_menupick = nil;
425+
}
426+
else
427+
{
428+
// SN-2015-10-05: [[ Bug 16069 ]] s_popup_menupick remains
429+
// NULL if a menu is closed by clicking outside of it
430+
t_menupick = MCValueRetain(kMCEmptyString);
431+
}
423432

424433
Exec_stat es = handlemenupick(t_menupick, nil);
425434

@@ -444,8 +453,17 @@ void MCButton::macopenmenu(void)
444453
// SN-2014-08-25: [[ Bug 13240 ]] We need to keep the actual popup_menustring,
445454
// in case some menus are nested
446455
MCStringRef t_menupick;
447-
t_menupick = s_popup_menupick;
448-
s_popup_menupick = nil;
456+
if (s_popup_menupick != NULL)
457+
{
458+
t_menupick = s_popup_menupick;
459+
s_popup_menupick = nil;
460+
}
461+
else
462+
{
463+
// SN-2015-10-05: [[ Bug 16069 ]] s_popup_menupick remains
464+
// NULL if a menu is closed by clicking outside of it
465+
t_menupick = MCValueRetain(kMCEmptyString);
466+
}
449467

450468
Exec_stat es = handlemenupick(t_menupick, nil);
451469

engine/src/exec-files.cpp

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,11 +1542,24 @@ bool MCFilesExecPerformReadChunk(MCExecContext &ctxt, int4 p_index, intenum_t p_
15421542

15431543
break;
15441544
case FU_CHARACTER:
1545-
// This loop accumulates codeunits into the buffer and then returns when it crosses a char boundary
1546-
// It does this by monitoring the length of the range [index, length(buffer)) for its length in characters
1545+
{
1546+
// In order to make the reading of 1 char faster, we use a temporary,
1547+
// small buffer.
1548+
// We copy the codeunit(s) we read over the last character boundary at
1549+
// the previous reading, and put it into our reading buffer.
1550+
MCAutoStringRef t_read_buffer;
1551+
uindex_t t_initial_length;
1552+
1553+
if (!MCStringMutableCopySubstring(x_buffer, MCRangeMake(p_last_boundary, UINDEX_MAX), &t_read_buffer))
1554+
return false;
1555+
1556+
// We keep track of the number of codeunit that we have copied for the
1557+
// main buffer.
1558+
t_initial_length = MCStringGetLength(*t_read_buffer);
1559+
15471560
while(true)
15481561
{
1549-
uint4 t_codeunit_read = MCFilesExecPerformReadCodeUnit(ctxt, p_index, p_encoding, p_empty_allowed, x_duration, x_stream, x_buffer, r_stat);
1562+
uint4 t_codeunit_read = MCFilesExecPerformReadCodeUnit(ctxt, p_index, p_encoding, p_empty_allowed, x_duration, x_stream, *t_read_buffer, r_stat);
15501563

15511564
if (!t_codeunit_read)
15521565
{
@@ -1565,16 +1578,24 @@ bool MCFilesExecPerformReadChunk(MCExecContext &ctxt, int4 p_index, intenum_t p_
15651578
}
15661579

15671580
MCRange t_cu_range, t_char_range;
1568-
t_cu_range = MCRangeMake(p_last_boundary, MCStringGetLength(x_buffer) - p_last_boundary);
1569-
MCStringUnmapIndices(x_buffer, kMCCharChunkTypeGrapheme, t_cu_range, t_char_range);
1581+
t_cu_range = MCRangeMake(0, MCStringGetLength(*t_read_buffer));
1582+
MCStringUnmapIndices(*t_read_buffer, kMCCharChunkTypeGrapheme, t_cu_range, t_char_range);
15701583

15711584
if (t_char_range . length > 1)
15721585
{
1573-
// The codeunit loaded is now on part of a second character: must end now the loop and mark the position
1586+
// We append the reading buffer MINUS the initial codeunits
1587+
MCAutoStringRef t_new_codeunits;
1588+
if (!MCStringCopySubstring(*t_read_buffer, MCRangeMake(t_initial_length, UINDEX_MAX), &t_new_codeunits)
1589+
|| !MCStringAppend(x_buffer, *t_new_codeunits))
1590+
return false;
1591+
1592+
// The last codeunit is now on part of a new character:
1593+
// we can end here the loop, and appendmust end now the loop and mark the position
15741594
r_new_boundary = MCStringGetLength(x_buffer) - t_codeunit_read;
15751595
break;
15761596
}
15771597
}
1598+
}
15781599
break;
15791600

15801601
default:

engine/src/stackview.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -453,11 +453,15 @@ void MCStack::view_update_transform(void)
453453
}
454454

455455
// PM-2015-07-17: [[ Bug 13754 ]] Make sure stack does not disappear off screen when changing the scalefactor
456-
MCRectangle t_bounded_rect;
457-
t_bounded_rect = MCU_bound_rect(t_view_rect, 0, 0, MCscreen -> getwidth(), MCscreen -> getheight());
456+
MCRectangle t_bounded_rect, t_screen_rect;
458457

459-
// IM-2014-01-16: [[ StackScale ]] Update view rect if needed
460-
view_setrect(t_bounded_rect);
458+
// AL-2015-10-01: [[ Bug 16017 ]] Remember location of stacks on a second monitor
459+
t_screen_rect = MCscreen -> getnearestdisplay(t_view_rect) -> viewport;
460+
461+
t_bounded_rect = MCU_bound_rect(t_view_rect, t_screen_rect . x, t_screen_rect . y, t_screen_rect . width, t_screen_rect . height);
462+
463+
// IM-2014-01-16: [[ StackScale ]] Update view rect if needed
464+
view_setrect(t_bounded_rect);
461465
}
462466

463467
MCRectangle MCStack::view_setstackviewport(const MCRectangle &p_rect)

0 commit comments

Comments
 (0)