@@ -874,11 +874,13 @@ MCParagraph* PrepareLayoutSettings(bool all, MCField *p_field, uint32_t p_part_i
874874
875875// SN-2014-11-04: [[ Bug 13934 ]] Update the area of the field to redraw,
876876// depending on the paragraph settings.
877- void LayoutParagraph (MCParagraph* p_paragraph, MCFieldLayoutSettings &x_layout_settings)
877+ // SN-2014-12-18: [[ Bug 14161 ]] Add a parameter to force the re-layout of a paragraph
878+ void LayoutParagraph (MCParagraph* p_paragraph, MCFieldLayoutSettings &x_layout_settings, bool p_force)
878879{
879880 // AL-2014-07-14: [[ Bug 12789 ]] Defragging can cause paragraph to need layout, do make sure we relayout
880881 // if it did. Otherwise setting properties that avoid relayout can cause crashes.
881- if (p_paragraph -> getneedslayout () && !x_layout_settings . all && p_paragraph->getopened ())
882+ // SN-2014-12-18: [[ Bug 14161 ]] The relayout can be forced
883+ if (p_force || (p_paragraph -> getneedslayout () && !x_layout_settings . all && p_paragraph->getopened ()))
882884 {
883885 // MW-2012-01-25: [[ ParaStyles ]] Ask the paragraph to reflow itself.
884886 // AL-2014-09-22: [[ Bug 11817 ]] If we changed the amount of lines of this paragraph
@@ -938,7 +940,8 @@ template<typename T> void SetParagraphPropOfCharChunk(MCExecContext& ctxt, MCFie
938940 sptr -> cleanattrs ();
939941
940942 // SN-2014-11-04: [[ Bug 13934 ]] Laying out a field refactored.
941- LayoutParagraph (sptr, t_layout_settings);
943+ // SN-2014-12-18: [[ Bug 14161 ]] Forces the re-layout of this paragraph which has been changed
944+ LayoutParagraph (sptr, t_layout_settings, true );
942945
943946 ei -= sptr->gettextlengthcr ();
944947 sptr = sptr->next ();
@@ -1108,7 +1111,8 @@ template<typename T> void SetCharPropOfCharChunk(MCExecContext& ctxt, MCField *p
11081111 // end of MCParagraph scope
11091112
11101113 // SN-2014-11-04: [[ Bug 13934 ]] Laying out a field refactored.
1111- LayoutParagraph (pgptr, t_layout_settings);
1114+ // SN-2014-12-18: [[ Bug 14161 ]] Add a parameter to force the re-layout of a paragraph
1115+ LayoutParagraph (pgptr, t_layout_settings, false );
11121116 }
11131117
11141118 si = MCU_max (0 , si - t_pg_length);
@@ -1218,7 +1222,8 @@ template<typename T> void SetArrayCharPropOfCharChunk(MCExecContext& ctxt, MCFie
12181222 // end of MCParagraph scope
12191223
12201224 // SN-2014-11-04: [[ Bug 13934 ]] Laying out a field refactored.
1221- LayoutParagraph (pgptr, t_layout_settings);
1225+ // SN-2014-12-18: [[ Bug 14161 ]] Add a parameter to force the re-layout of a paragraph
1226+ LayoutParagraph (pgptr, t_layout_settings, false );
12221227 }
12231228
12241229 si = MCU_max (0 , si - t_pg_length);
0 commit comments