View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004220 | JEDI VCL | 00 JVCL Components | public | 2007-08-29 18:13 | 2007-09-10 18:08 |
Reporter | ivobauer | Assigned To | jfudickar | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | Daily / GIT | ||||
Target Version | Fixed in Version | ||||
Summary | 0004220: TJvFormPlacement.AppStoragePath gets resolved when owner form is being loaded at design time | ||||
Description | There 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 Reproduce | 1) 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 Information | I 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; | ||||
Tags | No tags attached. | ||||
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 |