View Issue Details

IDProjectCategoryView StatusLast Update
0004220JEDI VCL00 JVCL Componentspublic2007-09-10 18:08
ReporterivobauerAssigned Tojfudickar 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product VersionDaily / GIT 
Target VersionFixed in Version 
Summary0004220: TJvFormPlacement.AppStoragePath gets resolved when owner form is being loaded at design time
DescriptionThere is a bug in TJvFormPlacement (and hence in TJvFormStorage as well) that forces AppStoragePath property to be resolved when the owner form is being loaded at *design* time. If the AppStoragePath property has the default value (i.e. %FORM_NAME%), viewing form as text, then going back to view as form makes the AppStoragePath property value to change to the name of the owner form at *design* time.
Steps To Reproduce1) Drop TJvFormStorage component onto the form.
2) Select Form -> "View as Text" from the popup menu at design time.
3) Select "View as Form".

During transition between 2) and 3) AppStoragePath property has been resolved as it contains the name of the owner form rather than %FORM_NAME%.
Additional InformationI suspect that the bug is caused by a call to ResolveAppStoragePath from within the TJvFormPlacement.Loaded method - it gets called every time the Loaded method gets called, effectively ignoring the value of ComponentState property. I would suggest the following change to the source code, but someone should check this for any potential harms to existing behavior:

*** Current code ***

procedure TJvFormPlacement.Loaded;
var
  Loading: Boolean;
begin
  // Mantis 3190: Only resolve when we are loaded so that we get the correct
  // form name if it's a form inheriting from another one.
  ResolveAppStoragePath;
  Loading := csLoading in ComponentState;
  inherited Loaded;
  if not (csDesigning in ComponentState) then
  begin
    if Loading then
      SetEvents;
    CheckToggleHook;
  end;
end;

*** Proposed change ***

procedure TJvFormPlacement.Loaded;
var
  Loading: Boolean;
begin
  // Mantis 3190: Only resolve when we are loaded so that we get the correct
  // form name if it's a form inheriting from another one.
  Loading := csLoading in ComponentState;
  inherited Loaded;
  if not (csDesigning in ComponentState) then
  begin
    ResolveAppStoragePath; // <-- This line has been moved here
    if Loading then
      SetEvents;
    CheckToggleHook;
  end;
end;
TagsNo tags attached.

Activities

jfudickar

2007-09-10 18:08

developer   ~0013766

Added to svn.

Thanks for the hint.

Issue History

Date Modified Username Field Change
2007-08-29 18:13 ivobauer New Issue
2007-09-10 13:40 jfudickar Status new => assigned
2007-09-10 13:40 jfudickar Assigned To => jfudickar
2007-09-10 18:08 jfudickar Status assigned => resolved
2007-09-10 18:08 jfudickar Resolution open => fixed
2007-09-10 18:08 jfudickar Note Added: 0013766