From: <ah...@us...> - 2007-12-16 19:00:28
|
Revision: 11620 http://jvcl.svn.sourceforge.net/jvcl/?rev=11620&view=rev Author: ahuser Date: 2007-12-16 11:00:26 -0800 (Sun, 16 Dec 2007) Log Message: ----------- Mantis #4293: Docklayout restoration for storage for not existign forms (Mantis #4293) Modified Paths: -------------- trunk/jvcl/run/JvDockInfo.pas Modified: trunk/jvcl/run/JvDockInfo.pas =================================================================== --- trunk/jvcl/run/JvDockInfo.pas 2007-12-16 18:44:51 UTC (rev 11619) +++ trunk/jvcl/run/JvDockInfo.pas 2007-12-16 19:00:26 UTC (rev 11620) @@ -466,6 +466,8 @@ end; end; +var + FormName: string; begin FormList := TStringList.Create; FJvDockInfoStyle := isJVCLReadInfo; // set mode for Scan. @@ -480,17 +482,26 @@ if FAppStorage.ValueStored('FormNames') then begin S := FAppStorage.ReadString('FormNames'); - { UniqueString is used because we modify the contents of S after - casting S to a PChar. S might point to an actual string in a storage, - as is the case with TJvAppXMLFileStorage. Not using UniqueString would - change the value in the storage too. } - UniqueString(S); CP := PChar(S); CP1 := StrPos(CP, ';'); while CP1 <> nil do begin - CP1^ := #0; - FormList.Add(string(CP)); + SetString(FormName, CP, CP1 - CP); + // (Mantis #4293) Avoid restoration of not instantiated forms => DockFormStyle == dsNormal + if TJvDockFormStyle(FAppStorage.ReadInteger( + FAppStorage.ConcatPaths([FormName, 'DockFormStyle']))) = dsNormal then + begin + for I := 0 to Screen.FormCount - 1 do + begin + if Screen.Forms[I].Name = FormName then + begin + FormList.Add(FormName); + Break; + end; + end; + end + else + FormList.Add(FormName); CP := CP1 + 1; CP1 := StrPos(CP, ';'); end; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |