-
Notifications
You must be signed in to change notification settings - Fork 222
[22103] Ensure effective textFont of chunk reports correct value #7192
base: develop
Are you sure you want to change the base?
Conversation
@@ -2438,6 +2438,10 @@ void MCField::GetEffectiveTextFontOfCharChunk(MCExecContext& ctxt, uint32_t p_pa | |||
|
|||
if (r_mixed) | |||
return; | |||
|
|||
if(!MCStringIsEmpty(*t_value)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the check for the non-empty string necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the effective textFont of a chunk cannot be empty. It *t_value
is nil or kMCEmptyString
then the effective textFont of a chunk should be the effective textFont of the field (i.e. GetEffectiveTextFont(ctxt, r_value);
from above)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay so - I don't think t_value can be nil :)
The problem here is an incorrect use of the GetCharPropCharChunk method I think... It is being called in 'effective'; mode - so the method should be:
MCAutoStringRef t_default;
GetEffectiveTextFont(ctxt, &t_default);
GetCharPropOfCharChunk< PodFieldPropType<MCStringRef> >(ctxt, this, p_part_id, si, ei, &MCBlock::GetTextFont, true, *t_default, r_mixed, r_value);
Here we are calling them method in question in 'effective' mode, which means it uses t_default as the value to use when a style run has the property unset. Of course, appropriate tests will determine whether this is correct :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.