Updated code regarding to string 32 vs string 8.
This commit is contained in:
@@ -38,11 +38,11 @@ feature -- Element change
|
||||
v: READABLE_STRING_8
|
||||
do
|
||||
if a_text /= Void then
|
||||
v := html_encoded_string (a_text.to_string_32)
|
||||
v := html_encoded_string (a_text)
|
||||
across
|
||||
options as o
|
||||
loop
|
||||
if o.item.is_same_value (v.to_string_32) then
|
||||
if o.item.is_same_value (v) then
|
||||
l_found := True
|
||||
o.item.set_is_selected (True)
|
||||
else
|
||||
@@ -50,7 +50,7 @@ feature -- Element change
|
||||
end
|
||||
end
|
||||
if not l_found then
|
||||
create opt.make (v.to_string_32, Void)
|
||||
create opt.make (v, Void)
|
||||
opt.set_is_selected (True)
|
||||
add_option (opt)
|
||||
end
|
||||
@@ -69,7 +69,7 @@ feature -- Element change
|
||||
v: READABLE_STRING_8
|
||||
do
|
||||
if a_text /= Void then
|
||||
v := html_encoded_string (a_text.to_string_32)
|
||||
v := html_encoded_string (a_text)
|
||||
across
|
||||
options as o
|
||||
loop
|
||||
|
||||
@@ -10,17 +10,19 @@ class
|
||||
inherit
|
||||
WSF_FORM_SELECTABLE_ITEM
|
||||
|
||||
SHARED_HTML_ENCODER
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make (a_value: like value; a_text: detachable like text)
|
||||
make (a_value: READABLE_STRING_GENERAL; a_text: detachable like text)
|
||||
-- Initialize `Current'.
|
||||
do
|
||||
value := a_value
|
||||
value := a_value.as_string_32
|
||||
if a_text = Void then
|
||||
text := a_value.to_string_8
|
||||
text := html_encoder.general_encoded_string (a_value)
|
||||
else
|
||||
text := a_text
|
||||
end
|
||||
@@ -30,9 +32,9 @@ feature -- Status
|
||||
|
||||
is_selected: BOOLEAN
|
||||
|
||||
is_same_value (v: READABLE_STRING_32): BOOLEAN
|
||||
is_same_value (v: READABLE_STRING_GENERAL): BOOLEAN
|
||||
do
|
||||
Result := value.same_string (v)
|
||||
Result := value.same_string_general (v)
|
||||
end
|
||||
|
||||
is_same_text (v: like text): BOOLEAN
|
||||
|
||||
@@ -12,7 +12,7 @@ feature -- Status report
|
||||
deferred
|
||||
end
|
||||
|
||||
is_same_value (v: READABLE_STRING_32): BOOLEAN
|
||||
is_same_value (v: READABLE_STRING_GENERAL): BOOLEAN
|
||||
deferred
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user