@@ -33,6 +33,7 @@ along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
3333
3434#include " globals.h"
3535#include " unicode.h"
36+ #include " exec-interface.h"
3637
3738// //////////////////////////////////////////////////////////////////////////////
3839
@@ -620,7 +621,7 @@ void MCField::parsestyledtextappendblock(MCParagraph *p_paragraph, MCArrayRef p_
620621
621622 // Set metadata
622623 if (p_metadata != nil)
623- t_block -> setatts (P_METADATA, ( void *) p_metadata);
624+ t_block -> SetMetadata (ctxt, p_metadata);
624625
625626 if (p_style == nil)
626627 return ;
@@ -667,17 +668,17 @@ void MCField::parsestyledtextappendblock(MCParagraph *p_paragraph, MCArrayRef p_
667668 if (!MCValueIsEmpty (t_valueref))
668669 {
669670 MCAutoStringRef t_string;
670- /* UNCHECKED */ ctxt . ConvertToString (t_valueref, &t_string);
671- MCAutoPointer<char > temp;
672- /* UNCHECKED */ MCStringConvertToCString (*t_string, &temp);
673- t_block -> setatts (P_TEXT_FONT, (void *)*temp);
671+ /* UNCHECKED */ ctxt . ConvertToString (t_valueref, &t_string);
672+ t_block -> SetTextFont (ctxt, *t_string);
674673 }
675674
676675 // Set textsize
677676 {
678677 MCAutoNumberRef t_number;
678+ uinteger_t t_size;
679679 convert_array_value_to_number_if_non_empty (ctxt, p_style, MCNAME (" textSize" ), &t_number);
680- t_block -> setatts (P_TEXT_SIZE, (void *)MCNumberFetchAsInteger (*t_number));
680+ t_size = MCNumberFetchAsUnsignedInteger (*t_number);
681+ t_block -> SetTextSize (ctxt, &t_size);
681682 }
682683
683684 // Set textstyle
@@ -689,23 +690,29 @@ void MCField::parsestyledtextappendblock(MCParagraph *p_paragraph, MCArrayRef p_
689690 MCAutoStringRef fname;
690691 uint2 height;
691692 uint2 size;
692- uint2 style;
693+ uint2 style;
693694
694695 MCF_parsetextatts (P_TEXT_STYLE, *t_string, flags, &fname, height, size, style);
695696
696- t_block -> setatts (P_TEXT_STYLE, (void *)style);
697+ MCInterfaceTextStyle t_style;
698+ t_style . style;
699+ t_block -> SetTextStyle (ctxt, t_style);
697700 }
698701
699702 // Set linktext
700703 if (MCArrayFetchValue (p_style, false , MCNAME (" linkText" ), t_valueref))
701704 {
702- t_block -> setatts (P_LINK_TEXT, (void *)t_valueref);
705+ MCAutoStringRef t_string;
706+ if (ctxt . ConvertToString (t_valueref, &t_string))
707+ t_block -> SetLinktext (ctxt, *t_string);
703708 }
704709
705710 // Set imagesource
706711 if (MCArrayFetchValue (p_style, false , MCNAME (" imageSource" ), t_valueref))
707712 {
708- t_block -> setatts (P_IMAGE_SOURCE, (void *)t_valueref);
713+ MCAutoStringRef t_string;
714+ if (ctxt . ConvertToString (t_valueref, &t_string))
715+ t_block -> SetImageSource (ctxt, *t_string);
709716 }
710717
711718}
0 commit comments