@@ -41,27 +41,25 @@ void window_tree_values::values(property_string_values_value_base::collection_ty
4141
4242 TreeNode ^ selected = nullptr ;
4343
44- for
45- each (String ^ i in values)
44+ for each (String ^ i in values)
45+ {
46+ TreeNode ^ current = nullptr ;
47+ String ^ j = i;
48+ while (j->Length )
4649 {
47- TreeNode ^ current = nullptr ;
48- String ^ j = i;
49- while (j->Length )
50+ int index = j->IndexOf (' \\ ' );
51+ String ^ k = index < 0 ? j : j->Substring (0 , index);
52+ j = index < 0 ? " " : j->Substring (index + 1 );
53+ if (!current)
5054 {
51- int index = j->IndexOf (' \\ ' );
52- String ^ k = index < 0 ? j : j->Substring (0 , index);
53- j = index < 0 ? " " : j->Substring (index + 1 );
54- if (!current)
55+ for each (TreeNode ^ i in TreeView->Nodes )
5556 {
56- for
57- each (TreeNode ^ i in TreeView->Nodes )
58- {
59- if (i->Text != k)
60- continue ;
57+ if (i->Text != k)
58+ continue ;
6159
62- current = i;
63- break ;
64- }
60+ current = i;
61+ break ;
62+ }
6563
6664 if (current)
6765 continue ;
@@ -70,33 +68,32 @@ void window_tree_values::values(property_string_values_value_base::collection_ty
7068 current->ImageIndex = 0 ;
7169 current->SelectedImageIndex = 0 ;
7270 continue ;
73- }
71+ }
7472
75- bool found = false ;
76- for
77- each (TreeNode ^ i in current->Nodes )
78- {
79- if (i->Text != k)
80- continue ;
73+ bool found = false ;
74+ for each (TreeNode ^ i in current->Nodes )
75+ {
76+ if (i->Text != k)
77+ continue ;
8178
82- found = true ;
83- current = i;
84- break ;
85- }
79+ found = true ;
80+ current = i;
81+ break ;
82+ }
8683 if (!found)
8784 {
8885 current->ImageIndex = 0 ;
8986 current->SelectedImageIndex = 0 ;
9087 current = current->Nodes ->Add (k);
9188 }
92- }
89+ }
9390
94- if (current->FullPath == current_value)
95- selected = current;
91+ if (current->FullPath == current_value)
92+ selected = current;
9693
97- current->ImageIndex = 2 ;
98- current->SelectedImageIndex = 2 ;
99- }
94+ current->ImageIndex = 2 ;
95+ current->SelectedImageIndex = 2 ;
96+ }
10097
10198 TreeView->TreeViewNodeSorter = gcnew NodeSorter ();
10299 TreeView->Sort ();
0 commit comments