diff --git a/ve/velib06.cpp b/ve/velib06.cpp index b17da0946..78c76668c 100755 --- a/ve/velib06.cpp +++ b/ve/velib06.cpp @@ -2145,11 +2145,9 @@ void TDocument_tree::select_node(const TObject* node, bool on) bool find_doc(TTree& tree, void* jolly, word flags) { TDocument_tree & t = (TDocument_tree &) tree; - if (!t.node_selected()) + if (!t.node_selected() && t.testata().get_long(DOC_NDOC) == *((long *) jolly)) { t.select_node(); - real & val = *((real *) jolly); - val = t.totale_doc(); return true; } return false; @@ -2160,7 +2158,8 @@ real TDocument_tree::select_doc(long numdoc) { real val; if (goto_root()) - scan_depth_first(find_doc, (void *) &val, SCAN_PRE_ORDER | SCAN_IGNORING_LEAVES); + if (scan_depth_first(find_doc, (void *) &numdoc, SCAN_PRE_ORDER | SCAN_IGNORING_LEAVES)) + val = totale_doc(); return val; }