Hi again.
 
This patch fixes forced setting of ProductVersion if it's not set, but FileVersion is.
This also makes code style slightly more consistent: now we access FStringTable everywhere instead of StringTable.
This also removes double assignment of FStringTable['FileVersion'] somewhere.
 
Based on the Lazarus trunk.
_____
 
Dmitry D. Chernov
Index: ide/w32versioninfo.pas
===================================================================
--- ide/w32versioninfo.pas	(revision 55971)
+++ ide/w32versioninfo.pas	(working copy)
@@ -446,10 +446,10 @@
 
     // write string info
     DeletePath(Path + 'VersionInfo/StringTable');
-    for i := 0 to StringTable.Count - 1 do begin
-      Key:=StringTable.Keys[i];
+    for i := 0 to FStringTable.Count - 1 do begin
+      Key:=FStringTable.Keys[i];
       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;
@@ -492,26 +492,23 @@
     Node := FindNode(Path + 'VersionInfo/StringTable', False);
     if Assigned(Node) then
     begin
-      StringTable.Clear;
+      FStringTable.Clear;
       for i := 0 to Node.Attributes.Length - 1 do
-        StringTable[Node.Attributes[i].NodeName] := Node.Attributes[i].NodeValue;
-      StringTable.AddRequired;
-      if StringTable['ProductVersion'] = '' then
-        StringTable['ProductVersion'] := BuildFileVersionString;
+        FStringTable[Node.Attributes[i].NodeName] := Node.Attributes[i].NodeValue;
+      FStringTable.AddRequired;
     end
     else
     begin
       // read old info
-      StringTable['Comments'] := GetValue(Path + 'VersionInfo/Comments/Value', '');
-      StringTable['CompanyName'] := GetValue(Path + 'VersionInfo/CompanyName/Value', '');
-      StringTable['FileDescription'] := GetValue(Path + 'VersionInfo/FileDescription/Value', '');
-      StringTable['FileVersion'] := BuildFileVersionString;
-      StringTable['InternalName'] := GetValue(Path + 'VersionInfo/InternalName/Value', '');
-      StringTable['LegalCopyright'] := GetValue(Path + 'VersionInfo/LegalCopyright/Value', '');
-      StringTable['LegalTrademarks'] := GetValue(Path + 'VersionInfo/LegalTrademarks/Value', '');
-      StringTable['OriginalFilename'] := GetValue(Path + 'VersionInfo/OriginalFilename/Value', '');
-      StringTable['ProductName'] := GetValue(Path + 'VersionInfo/ProductName/Value', '');
-      StringTable['ProductVersion'] := GetValue(Path + 'VersionInfo/ProductVersion/Value', BuildFileVersionString);
+      FStringTable['Comments'] := GetValue(Path + 'VersionInfo/Comments/Value', '');
+      FStringTable['CompanyName'] := GetValue(Path + 'VersionInfo/CompanyName/Value', '');
+      FStringTable['FileDescription'] := GetValue(Path + 'VersionInfo/FileDescription/Value', '');
+      FStringTable['InternalName'] := GetValue(Path + 'VersionInfo/InternalName/Value', '');
+      FStringTable['LegalCopyright'] := GetValue(Path + 'VersionInfo/LegalCopyright/Value', '');
+      FStringTable['LegalTrademarks'] := GetValue(Path + 'VersionInfo/LegalTrademarks/Value', '');
+      FStringTable['OriginalFilename'] := GetValue(Path + 'VersionInfo/OriginalFilename/Value', '');
+      FStringTable['ProductName'] := GetValue(Path + 'VersionInfo/ProductName/Value', '');
+      FStringTable['ProductVersion'] := GetValue(Path + 'VersionInfo/ProductVersion/Value', BuildFileVersionString);
     end;
 
     SetFileVersionFromVersion;
@@ -605,7 +602,7 @@
   S, Part: string;
   i, p: integer;
 begin
-  S := StringTable['ProductVersion'];
+  S := FStringTable['ProductVersion'];
   for i := 0 to 3 do
   begin
     p := Pos('.', S);
-- 
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to