View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003360 | JEDI VCL | 00 JVCL Components | public | 2005-12-12 09:12 | 2005-12-22 03:13 |
Reporter | marcgeldon | Assigned To | elahn | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | no change required | ||
Product Version | 3.00 | ||||
Target Version | Fixed in Version | ||||
Summary | 0003360: TJvSimpleXML Access Violation | ||||
Description | Drop a TJvSimpleXML component on the form, drop a button on the form. Assign the following source: JvSimpleXML.Root.Name := 'TEST'; JvSimpleXML.Root.Container.Add('TEST', 'TEST'); ShowMessage(JvSimpleXML.XMLData); Run the project. It'll return an access violation. | ||||
Tags | No tags attached. | ||||
|
The AV occurs in the second line because the property Container is not assigned. The helpfile says about Container "Use Container to determine the list class that owns this item. An item is always a child of its Container" Use JvSimpleXML.Root.Items.Add('TEST', 'TEST'); instead to add subitems to the root. |
|
Okay. I understand. Where can I find the documentation? |
|
We should raise an exception if the Container is not assigned, so that we can prevent access violations. This should be changed. |
|
Why? How can you have a container for a root, it's the only element that has no parent? |
|
The idea would be the following: raise an exception if someone tries to access the container (instead of having an AV) |
|
The container property is defined: property Container: TJvSimpleXMLElems read FContainer write FContainer; In order to raise an exception, a "GetContainer" method would have to be added that checks if FContainer is nil & raises an exception if so. I am totally against this. Adding this method would only slow down access to the Container property. If you're not 100% certain that a variable/property contains an object, you should check if it's nil before accessing it. JVCL Help Files: http://sourceforge.net/project/showfiles.php?group_id=45786&package_id=42481&release_id=315599 |
Date Modified | Username | Field | Change |
---|---|---|---|
2005-12-12 09:12 | marcgeldon | New Issue | |
2005-12-12 12:53 | USchuster | Note Added: 0008207 | |
2005-12-13 02:23 | marcgeldon | Note Added: 0008211 | |
2005-12-13 02:23 | marcgeldon | Note Added: 0008212 | |
2005-12-13 06:09 | obones | Note Added: 0008216 | |
2005-12-13 18:13 | marcgeldon | Note Added: 0008218 | |
2005-12-14 05:57 | elahn | Note Added: 0008219 | |
2005-12-22 03:13 | elahn | Status | new => resolved |
2005-12-22 03:13 | elahn | Resolution | open => no change required |
2005-12-22 03:13 | elahn | Assigned To | => elahn |