]> Creatis software - creaImageIO.git/commitdiff
Clean Code
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Wed, 23 Nov 2022 09:48:29 +0000 (10:48 +0100)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Wed, 23 Nov 2022 09:48:29 +0000 (10:48 +0100)
src/creaImageIOWxTreeView.cpp

index c324fab08cb941739990890d0ee73e22a7609bd3..3f98bd048df690cae661a11e94054d5241d74f22 100644 (file)
@@ -473,17 +473,12 @@ namespace creaImageIO
                        <<"WxTreeView::RecursiveUpdateLevel(level "
                        <<level
                        <<")"<<std::endl);
-    
     int l = level - 1; 
     const std::vector<tree::Node*>& sel(GetSelected(level));
-    
-    
     // to speed up inserting we hide the control temporarily
     GetCtrl(l)->Hide();
     GetCtrl(l)->DeleteAllItems();
-    
     std::vector<tree::Node*>::const_iterator i;
-    
     for (i=sel.begin(); i!=sel.end(); ++i)
     {
        GimmickDebugMessage(1,
@@ -492,9 +487,7 @@ namespace creaImageIO
                            <<"'"
                            <<std::endl);
        int _id=0;
-       
-       //Adds items and sets their attributes 
-       
+       //Adds items and sets their attributes
        GetTreeHandler()->LoadChildren(*i,1);
        tree::Node::ChildrenListType::reverse_iterator j;
        for (j = (*i)->GetChildrenList().rbegin(); 
@@ -506,7 +499,6 @@ namespace creaImageIO
                                <<(*j)->GetLabel()
                                <<"'"
                                <<std::endl);
-           
            wxListItem item;
            item.SetMask(wxLIST_MASK_STATE | 
                         wxLIST_MASK_TEXT |
@@ -519,13 +511,10 @@ namespace creaImageIO
                ItemData* data  = new ItemData();
            data->node          = *j;
            data->id            = _id;
-               
            item.SetId(_id);
            item.SetData(data);
-
            _id++;
            GetCtrl(l)->InsertItem(item);
-           
            //Setting attributes
            for (int k=0; k<GetCtrl(l)->GetColumnCount(); ++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();
   }