IDE: project resource file version: do not set modified if value is the same and initialize it after read

git-svn-id: trunk@40730 -
This commit is contained in:
mattias 2013-04-07 07:59:12 +00:00
parent 9c4f826f10
commit 2363e2143c

View File

@ -84,6 +84,7 @@ type
function GetLanguages: TStringList;
function GetVersion(AIndex: integer): integer;
procedure SetAutoIncrementBuild(const AValue: boolean);
procedure SetFileVersionFromVersion;
procedure SetHexCharSet(const AValue: string);
procedure SetHexLang(const AValue: string);
procedure SetUseVersionInfo(const AValue: boolean);
@ -376,8 +377,7 @@ begin
if charset = '' then
charset := DefaultCharSet;
// set FileVersion from version numbers
FStringTable['FileVersion'] := BuildFileVersionString;
SetFileVersionFromVersion;
st := TVersionStringTable.Create(lang + charset);
for i := 0 to FStringTable.Count - 1 do Begin
@ -471,6 +471,8 @@ begin
StringTable['ProductName'] := GetValue(Path + 'VersionInfo/ProductName/Value', '');
StringTable['ProductVersion'] := GetValue(Path + 'VersionInfo/ProjectVersion/Value', BuildFileVersionString);
end;
SetFileVersionFromVersion;
end;
end;
@ -511,6 +513,11 @@ begin
Modified := True;
end;
procedure TProjectVersionInfo.SetFileVersionFromVersion;
begin
FStringTable['FileVersion'] := BuildFileVersionString;
end;
procedure TProjectVersionInfo.SetHexCharSet(const AValue: string);
begin
if FHexCharSet = AValue then
@ -618,6 +625,8 @@ begin
idx := KeyToIndex(Key);
if idx = -1 then
Add(Key, AValue)
else if ValuesByIndex[idx] = AValue then
exit
else
ValuesByIndex[idx] := AValue;
DoModified;