avm1: Remove `TextFormatObject::set_text_format`
Use `text_format_mut` instead.
This commit is contained in:
parent
bb3ef68499
commit
b79144c122
|
@ -471,7 +471,7 @@ pub fn constructor<'gc>(
|
|||
args: &[Value<'gc>],
|
||||
) -> Result<Value<'gc>, Error<'gc>> {
|
||||
if let Some(this) = this.as_text_format_object() {
|
||||
let mut text_format = TextFormat::default();
|
||||
let mut text_format = this.text_format_mut(activation.context.gc_context);
|
||||
set_font(
|
||||
activation,
|
||||
&mut text_format,
|
||||
|
@ -537,7 +537,6 @@ pub fn constructor<'gc>(
|
|||
&mut text_format,
|
||||
args.get(12).unwrap_or(&Value::Undefined),
|
||||
)?;
|
||||
this.set_text_format(activation.context.gc_context, text_format);
|
||||
}
|
||||
|
||||
Ok(this.into())
|
||||
|
|
|
@ -58,10 +58,6 @@ impl<'gc> TextFormatObject<'gc> {
|
|||
pub fn text_format_mut(&self, gc_context: MutationContext<'gc, '_>) -> RefMut<TextFormat> {
|
||||
RefMut::map(self.0.write(gc_context), |o| &mut o.text_format)
|
||||
}
|
||||
|
||||
pub fn set_text_format(&self, gc_context: MutationContext<'gc, '_>, text_format: TextFormat) {
|
||||
self.0.write(gc_context).text_format = text_format
|
||||
}
|
||||
}
|
||||
|
||||
impl<'gc> TObject<'gc> for TextFormatObject<'gc> {
|
||||
|
|
Loading…
Reference in New Issue