From 7b9544187455467e86dc5758c3be8788661868d4 Mon Sep 17 00:00:00 2001 From: relrelb Date: Sat, 6 Nov 2021 13:19:03 +0200 Subject: [PATCH] core: Re-use `EditText::html_text` in `EditText::propagate_text_binding` --- core/src/display_object/edit_text.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/core/src/display_object/edit_text.rs b/core/src/display_object/edit_text.rs index 62be6b588..aa74b7e95 100644 --- a/core/src/display_object/edit_text.rs +++ b/core/src/display_object/edit_text.rs @@ -1130,13 +1130,7 @@ impl<'gc> EditText<'gc> { if let Ok(Some((object, property))) = activation.resolve_variable_path(self.avm1_parent().unwrap(), &variable_path) { - let text = if self.0.read().is_html { - let html_tree = self.html_tree(&mut activation.context).as_node(); - let html_string_result = html_tree.into_string(&mut |_node| true); - html_string_result.unwrap_or_default() - } else { - self.text() - }; + let html_text = self.html_text(&mut activation.context); // Note that this can call virtual setters, even though the opposite direction won't work // (virtual property changes do not affect the text field) @@ -1148,7 +1142,7 @@ impl<'gc> EditText<'gc> { let property = AvmString::new(activation.context.gc_context, property); let _ = object.set( property, - AvmString::new(activation.context.gc_context, text).into(), + AvmString::new(activation.context.gc_context, html_text).into(), activation, ); },