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

Commit c89068d

Browse files
committed
Merge branch 'bugfix-10794' into release-6.0.2
2 parents 02bc2ce + 9f46d15 commit c89068d

3 files changed

Lines changed: 19 additions & 13 deletions

File tree

engine/src/fields.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,12 +755,14 @@ void MCField::getlinkdata(MCRectangle &lrect, MCBlock *&sb, MCBlock *&eb)
755755

756756
// MW-2011-02-26: [[ Bug 9416 ]] Make sure the linkrect and block extends to the
757757
// extremities of the link.
758+
// MW-2013-05-21: [[ Bug 10794 ]] Make sure we update sb/eb with the actual blocks
759+
// the indices are within.
758760
uint2 t_index;
759761
t_index = (uint2)si;
760-
sptr -> extendup(sb, t_index);
762+
sb = sptr -> extendup(sb, t_index);
761763
si = t_index;
762764
t_index = (uint2)(ei - 1);
763-
sptr -> extenddown(eb, t_index);
765+
eb = sptr -> extenddown(eb, t_index);
764766
ei = t_index;
765767

766768
linksi += si;

engine/src/paragraf.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3021,7 +3021,9 @@ void MCParagraph::getxextents(int4 &si, int4 &ei, int2 &minx, int2 &maxx)
30213021
ei -= gettextsizecr();
30223022
}
30233023

3024-
Boolean MCParagraph::extendup(MCBlock *bptr, uint2 &si)
3024+
// MW-2013-05-21: [[ Bug 10794 ]] Changed signature to return the block the search
3025+
// ends up in.
3026+
MCBlock *MCParagraph::extendup(MCBlock *bptr, uint2 &si)
30253027
{
30263028
Boolean isgroup = True;
30273029
Boolean found = False;
@@ -3046,10 +3048,12 @@ Boolean MCParagraph::extendup(MCBlock *bptr, uint2 &si)
30463048
bptr = bptr->next();
30473049
uint2 l;
30483050
bptr->getindex(si, l);
3049-
return found;
3051+
return bptr;
30503052
}
30513053

3052-
Boolean MCParagraph::extenddown(MCBlock *bptr, uint2 &ei)
3054+
// MW-2013-05-21: [[ Bug 10794 ]] Changed signature to return the block the search
3055+
// ends up in.
3056+
MCBlock *MCParagraph::extenddown(MCBlock *bptr, uint2 &ei)
30533057
{
30543058
Boolean isgroup = True;
30553059
Boolean found = False;
@@ -3075,7 +3079,7 @@ Boolean MCParagraph::extenddown(MCBlock *bptr, uint2 &ei)
30753079
uint2 l;
30763080
bptr->getindex(ei, l);
30773081
ei += l;
3078-
return found;
3082+
return bptr;
30793083
}
30803084

30813085
void MCParagraph::getclickindex(int2 x, int2 y,

engine/src/paragraf.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -739,13 +739,13 @@ class MCParagraph : public MCDLlist
739739

740740
MCLine *indextoline(uint2 tindex);
741741

742-
// Returns true if the given block is part of a link, in which case si is
743-
// the start index of the link.
744-
Boolean extendup(MCBlock *bptr, uint2 &si);
745-
746-
// Returns true if the given block is part of a link, in which case ei is
747-
// the end index of the link.
748-
Boolean extenddown(MCBlock *bptr, uint2 &ei);
742+
// Searches forward for the end of a link, returning the last index in si
743+
// and returning the block containing it.
744+
MCBlock *extendup(MCBlock *bptr, uint2 &si);
745+
746+
// Searches backward for the start of a link, returning the first index in ei
747+
// and returning the block containing it.
748+
MCBlock *extenddown(MCBlock *bptr, uint2 &ei);
749749

750750
int2 getx(uint2 tindex, MCLine *lptr);
751751

0 commit comments

Comments
 (0)