IDE: Use local variable FStringTable instead of global property in ProjectVersionInfo.

git-svn-id: trunk@55978 -
This commit is contained in:
juha 2017-10-05 16:37:05 +00:00
parent 7c6ce88d18
commit 323352579d

View File

@ -446,10 +446,10 @@ begin
// write string info // write string info
DeletePath(Path + 'VersionInfo/StringTable'); DeletePath(Path + 'VersionInfo/StringTable');
for i := 0 to StringTable.Count - 1 do begin for i := 0 to FStringTable.Count - 1 do begin
Key:=StringTable.Keys[i]; Key:=FStringTable.Keys[i];
if Key='FileVersion' then continue; // FileVersion is created automatically if Key='FileVersion' then continue; // FileVersion is created automatically
SetDeleteValue(Path + 'VersionInfo/StringTable/' + Key, StringTable.ValuesByIndex[i], ''); SetDeleteValue(Path + 'VersionInfo/StringTable/' + Key, FStringTable.ValuesByIndex[i], '');
end; end;
end; end;
end; end;
@ -492,24 +492,24 @@ begin
Node := FindNode(Path + 'VersionInfo/StringTable', False); Node := FindNode(Path + 'VersionInfo/StringTable', False);
if Assigned(Node) then if Assigned(Node) then
begin begin
StringTable.Clear; FStringTable.Clear;
for i := 0 to Node.Attributes.Length - 1 do for i := 0 to Node.Attributes.Length - 1 do
StringTable[Node.Attributes[i].NodeName] := Node.Attributes[i].NodeValue; FStringTable[Node.Attributes[i].NodeName] := Node.Attributes[i].NodeValue;
StringTable.AddRequired; FStringTable.AddRequired;
end end
else else
begin begin
// read old info // read old info
StringTable['Comments'] := GetValue(Path + 'VersionInfo/Comments/Value', ''); FStringTable['Comments'] := GetValue(Path + 'VersionInfo/Comments/Value', '');
StringTable['CompanyName'] := GetValue(Path + 'VersionInfo/CompanyName/Value', ''); FStringTable['CompanyName'] := GetValue(Path + 'VersionInfo/CompanyName/Value', '');
StringTable['FileDescription'] := GetValue(Path + 'VersionInfo/FileDescription/Value', ''); FStringTable['FileDescription'] := GetValue(Path + 'VersionInfo/FileDescription/Value', '');
// StringTable['FileVersion'] := BuildFileVersionString; // not needed due to SetFileVersionFromVersion // FStringTable['FileVersion'] := BuildFileVersionString; // not needed due to SetFileVersionFromVersion
StringTable['InternalName'] := GetValue(Path + 'VersionInfo/InternalName/Value', ''); FStringTable['InternalName'] := GetValue(Path + 'VersionInfo/InternalName/Value', '');
StringTable['LegalCopyright'] := GetValue(Path + 'VersionInfo/LegalCopyright/Value', ''); FStringTable['LegalCopyright'] := GetValue(Path + 'VersionInfo/LegalCopyright/Value', '');
StringTable['LegalTrademarks'] := GetValue(Path + 'VersionInfo/LegalTrademarks/Value', ''); FStringTable['LegalTrademarks'] := GetValue(Path + 'VersionInfo/LegalTrademarks/Value', '');
StringTable['OriginalFilename'] := GetValue(Path + 'VersionInfo/OriginalFilename/Value', ''); FStringTable['OriginalFilename'] := GetValue(Path + 'VersionInfo/OriginalFilename/Value', '');
StringTable['ProductName'] := GetValue(Path + 'VersionInfo/ProductName/Value', ''); FStringTable['ProductName'] := GetValue(Path + 'VersionInfo/ProductName/Value', '');
StringTable['ProductVersion'] := GetValue(Path + 'VersionInfo/ProductVersion/Value', ''); FStringTable['ProductVersion'] := GetValue(Path + 'VersionInfo/ProductVersion/Value', '');
end; end;
SetFileVersionFromVersion; SetFileVersionFromVersion;
@ -603,7 +603,7 @@ var
S, Part: string; S, Part: string;
i, p: integer; i, p: integer;
begin begin
S := StringTable['ProductVersion']; S := FStringTable['ProductVersion'];
for i := 0 to 3 do for i := 0 to 3 do
begin begin
p := Pos('.', S); p := Pos('.', S);