From: Eduardo DAVILA Date: Wed, 23 Nov 2022 09:48:29 +0000 (+0100) Subject: Clean Code X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=3579beef5bd466705bc0431d7347d1150cdffe97;p=creaImageIO.git Clean Code --- diff --git a/src/creaImageIOWxTreeView.cpp b/src/creaImageIOWxTreeView.cpp index c324fab..3f98bd0 100644 --- a/src/creaImageIOWxTreeView.cpp +++ b/src/creaImageIOWxTreeView.cpp @@ -473,17 +473,12 @@ namespace creaImageIO <<"WxTreeView::RecursiveUpdateLevel(level " <& sel(GetSelected(level)); - - // to speed up inserting we hide the control temporarily GetCtrl(l)->Hide(); GetCtrl(l)->DeleteAllItems(); - std::vector::const_iterator i; - for (i=sel.begin(); i!=sel.end(); ++i) { GimmickDebugMessage(1, @@ -492,9 +487,7 @@ namespace creaImageIO <<"'" <LoadChildren(*i,1); tree::Node::ChildrenListType::reverse_iterator j; for (j = (*i)->GetChildrenList().rbegin(); @@ -506,7 +499,6 @@ namespace creaImageIO <<(*j)->GetLabel() <<"'" <node = *j; data->id = _id; - item.SetId(_id); item.SetData(data); - _id++; GetCtrl(l)->InsertItem(item); - //Setting attributes for (int k=0; kGetColumnCount(); ++k) { @@ -543,7 +532,7 @@ namespace creaImageIO std::string valtmp(val); try { - boost::gregorian::date d1(boost::gregorian::from_undelimited_string(val)); + boost::gregorian::date d1(boost::gregorian::from_undelimited_string(val)); val = to_iso_extended_string(d1); } catch (...) { val = valtmp; @@ -567,14 +556,11 @@ namespace creaImageIO } item.SetText( crea::std2wx(val)); item.SetColumn(k); - GetCtrl(l)->SetItem(item); } // for k item.Clear(); - } // for j - } // for i - + } // for i SortLevel(l); GetCtrl(l)->Show(); }