mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-06 10:07:54 +02:00
* fix by Inoussa OUEDRAOGO to improve UnicodeString property handling, resolves #12224
git-svn-id: trunk@11832 -
This commit is contained in:
parent
f64dbd70cf
commit
50012c2357
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -8561,6 +8561,7 @@ tests/webtbs/tw12186.pp svneol=native#text/plain
|
||||
tests/webtbs/tw12202.pp svneol=native#text/plain
|
||||
tests/webtbs/tw12214.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1222.pp svneol=native#text/plain
|
||||
tests/webtbs/tw12224.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1223.pp svneol=native#text/plain
|
||||
tests/webtbs/tw12233.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1228.pp svneol=native#text/plain
|
||||
|
@ -1216,6 +1216,8 @@ begin
|
||||
case Propinfo^.PropType^.Kind of
|
||||
tkWString:
|
||||
Result:=GetWideStrProp(Instance,PropInfo);
|
||||
tkUString :
|
||||
Result := GetUnicodeStrProp(Instance,PropInfo);
|
||||
tkSString:
|
||||
begin
|
||||
case (PropInfo^.PropProcs) and 3 of
|
||||
@ -1272,6 +1274,8 @@ begin
|
||||
case Propinfo^.PropType^.Kind of
|
||||
tkWString:
|
||||
SetWideStrProp(Instance,PropInfo,Value);
|
||||
tkUString:
|
||||
SetUnicodeStrProp(Instance,PropInfo,Value);
|
||||
tkSString:
|
||||
begin
|
||||
case (PropInfo^.PropProcs shr 2) and 3 of
|
||||
@ -1351,6 +1355,8 @@ begin
|
||||
case Propinfo^.PropType^.Kind of
|
||||
tkSString,tkAString:
|
||||
Result:=GetStrProp(Instance,PropInfo);
|
||||
tkUString :
|
||||
Result := GetUnicodeStrProp(Instance,PropInfo);
|
||||
tkWString:
|
||||
begin
|
||||
case (PropInfo^.PropProcs) and 3 of
|
||||
@ -1385,6 +1391,8 @@ begin
|
||||
case Propinfo^.PropType^.Kind of
|
||||
tkSString,tkAString:
|
||||
SetStrProp(Instance,PropInfo,Value);
|
||||
tkUString:
|
||||
SetUnicodeStrProp(Instance,PropInfo,Value);
|
||||
tkWString:
|
||||
begin
|
||||
case (PropInfo^.PropProcs shr 2) and 3 of
|
||||
|
47
tests/webtbs/tw12224.pp
Normal file
47
tests/webtbs/tw12224.pp
Normal file
@ -0,0 +1,47 @@
|
||||
program test_widestrprop_p2;
|
||||
{$mode objfpc}{$H+}
|
||||
uses
|
||||
Classes, SysUtils, TypInfo;
|
||||
|
||||
type
|
||||
TClass_A = class(TPersistent)
|
||||
private
|
||||
Fwsp: UnicodeString;
|
||||
published
|
||||
property wsp : UnicodeString read Fwsp write Fwsp;
|
||||
end;
|
||||
|
||||
var
|
||||
x : TClass_A;
|
||||
begin
|
||||
x := TClass_A.Create();
|
||||
WriteLn('Reading :');
|
||||
x.wsp := 'azerty';
|
||||
WriteLn(' Using GetUnicodeStrProp() : ',GetUnicodeStrProp(x,'wsp'));
|
||||
if GetUnicodeStrProp(x,'wsp')<>'azerty' then
|
||||
halt(1);
|
||||
WriteLn(' Using GetStrProp() : ',GetStrProp(x,'wsp'));
|
||||
if GetStrProp(x,'wsp')<>'azerty' then
|
||||
halt(1);
|
||||
WriteLn(' Using GetWideStrProp() : ',GetWideStrProp(x,'wsp'));
|
||||
if GetWideStrProp(x,'wsp')<>'azerty' then
|
||||
halt(1);
|
||||
|
||||
WriteLn('Writing :');
|
||||
x.wsp := '';
|
||||
SetUnicodeStrProp(x,'wsp','azerty');
|
||||
WriteLn(' Using SetUnicodeStrPr() : ',x.wsp);
|
||||
if x.wsp<>'azerty' then
|
||||
halt(1);
|
||||
x.wsp := '';
|
||||
SetStrProp(x,'wsp','azerty');
|
||||
WriteLn(' Using SetStrPr() : ',x.wsp);
|
||||
if x.wsp<>'azerty' then
|
||||
halt(1);
|
||||
x.wsp := '';
|
||||
SetWideStrProp(x,'wsp','azerty');
|
||||
WriteLn(' Using SetWideStrPr() : ',x.wsp);
|
||||
if x.wsp<>'azerty' then
|
||||
halt(1);
|
||||
writeln('ok');
|
||||
end.
|
Loading…
Reference in New Issue
Block a user