From 857397e2269af31bd2709e2d0810a3c9c6fe0bce Mon Sep 17 00:00:00 2001 From: jvelilla Date: Thu, 28 May 2015 09:39:14 -0300 Subject: [PATCH] Updated code inherit from SHARED_HTML_ENCODER instead of creating new objects. --- .../form/wsf_form_field_with_numeric_attribute.e | 11 ++++++++--- .../server/wsf_html/form/wsf_form_input_with_html5.e | 8 ++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/library/server/wsf_html/form/wsf_form_field_with_numeric_attribute.e b/library/server/wsf_html/form/wsf_form_field_with_numeric_attribute.e index f51cc6c3..1bf122b5 100644 --- a/library/server/wsf_html/form/wsf_form_field_with_numeric_attribute.e +++ b/library/server/wsf_html/form/wsf_form_field_with_numeric_attribute.e @@ -10,6 +10,11 @@ note class WSF_FORM_FIELD_WITH_NUMERIC_ATTRIBUTE +inherit + + SHARED_HTML_ENCODER + + feature -- Access min: detachable READABLE_STRING_32 @@ -80,21 +85,21 @@ feature {NONE} -- Conversion --min if attached min as l_min then a_target.append (" min=%"") - a_target.append ((create {HTML_ENCODER}).encoded_string (l_min)) + a_target.append (html_encoder.encoded_string (l_min)) a_target.append_character ('%"') end --max if attached max as l_max then a_target.append (" max=%"") - a_target.append ((create {HTML_ENCODER}).encoded_string (l_max)) + a_target.append (html_encoder.encoded_string (l_max)) a_target.append_character ('%"') end --step if attached step as l_step then a_target.append (" step=%"") - a_target.append ((create {HTML_ENCODER}).encoded_string (l_step)) + a_target.append (html_encoder.encoded_string (l_step)) a_target.append_character ('%"') end end diff --git a/library/server/wsf_html/form/wsf_form_input_with_html5.e b/library/server/wsf_html/form/wsf_form_input_with_html5.e index d36f4e94..94e11fa2 100644 --- a/library/server/wsf_html/form/wsf_form_input_with_html5.e +++ b/library/server/wsf_html/form/wsf_form_input_with_html5.e @@ -7,6 +7,10 @@ deferred class WSF_FORM_INPUT_WITH_HTML5 +inherit + + SHARED_HTML_ENCODER + feature -- Access placeholder: detachable READABLE_STRING_32 @@ -147,7 +151,7 @@ feature -- Conversion do if attached placeholder as l_placeholder then a_target.append (" placeholder=%"") - a_target.append ((create {HTML_ENCODER}).encoded_string (l_placeholder)) + a_target.append (html_encoder.encoded_string (l_placeholder)) a_target.append_character ('%"') end --TODO check how we can add xhtml5 support @@ -166,7 +170,7 @@ feature -- Conversion end if attached pattern as l_pattern then a_target.append (" pattern=%"") - a_target.append ((create {HTML_ENCODER}).encoded_string (l_pattern)) + a_target.append ( html_encoder.encoded_string (l_pattern)) a_target.append_character ('%"') end end