View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004284 | JEDI VCL | 00 JVCL Components | public | 2007-10-30 19:15 | 2007-10-31 04:56 |
Reporter | law | Assigned To | AHUser | ||
Priority | normal | Severity | crash | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | Daily / GIT | ||||
Target Version | Fixed in Version | 3.34 | |||
Summary | 0004284: JvDBTreeView invalid class typecast | ||||
Description | if I inherit from TJvCustomDBTreeView, then TJvDBTreeNode.MoveTo raises exc. invalid class typeclass. here's the solution: procedure TJvDBTreeNode.MoveTo(Destination: TTreeNode; Mode: TNodeAttachMode); var PersistNode: Boolean; TV: TJvDBTreeView; begin if Destination <> nil then begin // If we are trying to move ourselves in the same parent and we are // already the last child, there is no point in moving us. // It's even dangerous as it triggers Mantis 3934 if not ((Parent = Destination) and (Self = Destination.GetLastChild) and (Mode = naAddChild)) then begin //+law 20071030 //TV := TreeView as TJvDBTreeView; TV := TreeView as TJvCustomDBTreeView; //-law PersistNode := TV.FPersistentNode; TV.MoveTo(Self as TJvDBTreeNode, Destination as TJvDBTreeNode, Mode); TV.FPersistentNode := True; if (Destination <> nil) and Destination.HasChildren and (Destination.Count = 0) then Free else inherited MoveTo(Destination, Mode); TV.FPersistentNode := PersistNode; end; end; end; | ||||
Tags | No tags attached. | ||||
|
working fix is here, sorry: procedure TJvDBTreeNode.MoveTo(Destination: TTreeNode; Mode: TNodeAttachMode); var PersistNode: Boolean; //+law 20071030 //TV: TJvDBTreeView; TV: TJvCustomDBTreeView; //-law begin if Destination <> nil then begin // If we are trying to move ourselves in the same parent and we are // already the last child, there is no point in moving us. // It's even dangerous as it triggers Mantis 3934 if not ((Parent = Destination) and (Self = Destination.GetLastChild) and (Mode = naAddChild)) then begin //+law 20071030 //TV := TreeView as TJvDBTreeView; TV := TreeView as TJvCustomDBTreeView; //-law PersistNode := TV.FPersistentNode; TV.MoveTo(Self as TJvDBTreeNode, Destination as TJvDBTreeNode, Mode); TV.FPersistentNode := True; if (Destination <> nil) and Destination.HasChildren and (Destination.Count = 0) then Free else inherited MoveTo(Destination, Mode); TV.FPersistentNode := PersistNode; end; end; end; |
|
Fixed. The TJvCustomDBTreeView.DragDrop method was also affected by the same bug. |
Date Modified | Username | Field | Change |
---|---|---|---|
2007-10-30 19:15 | law | New Issue | |
2007-10-30 20:05 | law | Note Added: 0014008 | |
2007-10-31 04:55 | AHUser | Status | new => resolved |
2007-10-31 04:55 | AHUser | Fixed in Version | => Daily / SVN |
2007-10-31 04:55 | AHUser | Resolution | open => fixed |
2007-10-31 04:55 | AHUser | Assigned To | => AHUser |
2007-10-31 04:55 | AHUser | Note Added: 0014009 |