[Lazarus] TTreeNode.MoveTo root node check

Mattias Gaertner nc-gaertnma at netcologne.de
Tue Jun 11 20:53:40 CEST 2013


On Mon, 10 Jun 2013 11:34:26 -0500
David Jenkins <david at scootersoftware.com> wrote:

> We are seeing an error when we do a move of an item at the base of a 
> TTreeView.
> 
> The particular situation is that with several items in the view a user 
> does a rename of an item that moves that item to bottom of the list.  
> Debugging the problem we are entering TreeView.TTreeNode.MoveTo() with 
> Destination = nil and Mode = nadAddChild and then hit the 
> TreeNodeError('TTreeNode.MoveTo Destination = nil) error.
> 
> Looking at the code and the definitions for TNodeAttachMode it seems, 
> assuming that Destination = nil indicates that you are at root level of 
> the TreeView,  the check should be for naAddChild and nadAddChildFirst 
> (add a child to the destination i.e to the root node) rather than naAdd 
> and naAddFirst (add siblings to destination).  In other words one can't 
> add siblings to the root node but should be adding children.
> 
> I can enter a bug report and attach a patch for this if it is indeed an 
> error.  I wanted to check first that I wasn't misunderstanding the code.

Please create a bug report with an example.

Mattias




More information about the Lazarus mailing list