fcl-res: fix LANGUAGE attribute

Reintegrate fpcres-rc branch by Martok

git-svn-id: trunk@46385 -
This commit is contained in:
svenbarth 2020-08-12 19:06:05 +00:00
parent 81885c7e72
commit 8008f314b1
3 changed files with 10 additions and 2 deletions

View File

@ -266,7 +266,7 @@ begin
yyval := yyv[yysp-1];
end;
63 : begin
aktresource.LangID:= MakeLangID(yyv[yysp-2].yyrcnumtype.v, yyv[yysp-0].yyrcnumtype.v);
change_lang_id(MakeLangID(yyv[yysp-2].yyrcnumtype.v, yyv[yysp-0].yyrcnumtype.v));
end;
64 : begin
aktresource.Characteristics:= yyv[yysp-0].yyrcnumtype.v;

View File

@ -145,7 +145,7 @@ suboptions
;
suboption
: _LANGUAGE numpos ',' numpos { aktresource.LangID:= MakeLangID($2.v, $4.v); }
: _LANGUAGE numpos ',' numpos { change_lang_id(MakeLangID($2.v, $4.v)); }
| _CHARACTERISTICS numpos { aktresource.Characteristics:= $2.v; }
| _VERSION numpos { aktresource.Version:= $2.v; }
| _MOVEABLE { aktresource.MemoryFlags:= aktresource.MemoryFlags or MF_MOVEABLE; }

View File

@ -295,6 +295,14 @@ begin
create_resource(aId, nil, cls);
end;
procedure change_lang_id(newlang: TLangID);
begin
// cannot change a language id while it is contained in a list, so remove and re-add
aktresources.Remove(aktresource);
aktresource.LangID:= newlang;
aktresources.Add(aktresource);
end;
procedure raw_write_string(Stream: TMemoryStream; str: rcstrtype);
var
i: integer;