FLTK logo

Re: [LOW] STR #3528: Fl_Tree: dragging an item over a widget() can cause FL_RELEASE to be ignored

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.bugs  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: [LOW] STR #3528: Fl_Tree: dragging an item over a widget() can cause FL_RELEASE to be ignored Albrecht Schlosser Aug 28, 2019  
 
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: https://www.fltk.org/str.php?L3528
Version: 1.4-current


While we're at it (a little code review): I found some redundant and maybe
confusing code in Fl_Tree::handle() - as mentioned above, code as of today,
commit 8c39007b26.

  int ret = 0;

is defined early in handle() at line 227 (OK).

The statements at line 319 and 322 (ret = 1;) are redundant and should be
removed. This value is not used because there is 'return(1);' at line 324.
It's also possible to change this to 'return(ret);' but I think
'return(1);' is more explicit and to be preferred here.

That said, the statement at line 381 (after calling Fl_Group::handle())

  if ( ! _root ) return(ret);

could also be written as:

  if ( ! _root ) return(0);

because at this point in the code 'ret' is always zero.

The following statements use 'ret' correctly AFAICT.

Just my 2 ct.


Link: https://www.fltk.org/str.php?L3528
Version: 1.4-current


Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.