Skip to content

Commit 87fd7aa

Browse files
committed
Fix compilation of xrWeatherEditor
Was broken with c96c2e4 Corresponding formatting fixes
1 parent 2af4148 commit 87fd7aa

9 files changed

+114
-132
lines changed

src/editors/xrWeatherEditor/property_container.cpp

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,17 @@ bool property_container::equal_category(String ^ new_category, String ^ old_cate
7878

7979
String ^ property_container::update_categories(String ^ new_category)
8080
{
81-
for
82-
each(PropertySpec ^ i in m_ordered_properties)
83-
{
84-
String ^ category = i->Category;
85-
if (!equal_category(new_category, category))
86-
continue;
81+
for each(PropertySpec ^ i in m_ordered_properties)
82+
{
83+
String ^ category = i->Category;
84+
if (!equal_category(new_category, category))
85+
continue;
8786

88-
return (category);
89-
}
87+
return (category);
88+
}
9089

91-
for
92-
each(PropertySpec ^ i in m_ordered_properties) i->Category = "\t" + i->Category;
90+
for each(PropertySpec ^ i in m_ordered_properties)
91+
i->Category = "\t" + i->Category;
9392

9493
return (new_category);
9594
}
@@ -128,21 +127,19 @@ void property_container::try_update_name(PropertySpec ^ description, String ^ na
128127
void property_container::update_names(String ^ name)
129128
{
130129
bool found = false;
131-
for
132-
each(PropertySpec ^ i in m_ordered_properties)
133-
{
134-
if (i->Name != name)
135-
continue;
130+
for each(PropertySpec ^ i in m_ordered_properties)
131+
{
132+
if (i->Name != name)
133+
continue;
136134

137-
found = true;
138-
break;
139-
}
135+
found = true;
136+
break;
137+
}
140138

141139
if (!found)
142140
return;
143141

144-
for
145-
each(PropertySpec ^ i in m_ordered_properties) try_update_name(i, name);
142+
for each(PropertySpec ^ i in m_ordered_properties) try_update_name(i, name);
146143
}
147144

148145
void property_container::add_property(PropertySpec ^ description, IProperty ^ value)

src/editors/xrWeatherEditor/property_container_converter.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ PropertyDescriptorCollection ^ property_container_converter::GetProperties(
2828
{
2929
ArrayList % properties = container->ordered_properties();
3030
ArrayList ^ names = gcnew ArrayList();
31-
for
32-
each(PropertySpec ^ i in properties) names->Add(i->Name);
31+
for each(PropertySpec ^ i in properties) names->Add(i->Name);
3332

3433
return (current->Sort(reinterpret_cast<array<String ^> ^>(names->ToArray(String::typeid))));
3534
}
@@ -41,8 +40,7 @@ PropertyDescriptorCollection ^ property_container_converter::GetProperties(
4140
container = safe_cast<property_container ^>(objects->GetValue(0));
4241
ArrayList % properties = container->ordered_properties();
4342
ArrayList ^ names = gcnew ArrayList();
44-
for
45-
each(PropertySpec ^ i in properties) names->Add(i->Name);
43+
for each(PropertySpec ^ i in properties) names->Add(i->Name);
4644

4745
return (current->Sort(reinterpret_cast<array<String ^> ^>(names->ToArray(String::typeid))));
4846
}

src/editors/xrWeatherEditor/property_converter_float_enum.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,13 @@ Object ^ property_converter_float_enum::ConvertTo(
5555
property_float_enum_value ^ real_value = safe_cast<property_float_enum_value ^>(raw_value);
5656
float float_value = safe_cast<float>(value);
5757

58-
for
59-
each(ValuePair ^ i in real_value->m_collection)
60-
{
61-
if (i->first != float_value)
62-
continue;
58+
for each(ValuePair ^ i in real_value->m_collection)
59+
{
60+
if (i->first != float_value)
61+
continue;
6362

64-
return (i->second);
65-
}
63+
return (i->second);
64+
}
6665

6766
return (safe_cast<ValuePair ^>(real_value->m_collection[0])->second);
6867
}

src/editors/xrWeatherEditor/property_converter_integer_enum.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,13 @@ Object ^ property_converter_integer_enum::ConvertTo(
5555
property_integer_enum_value ^ real_value = safe_cast<property_integer_enum_value ^>(raw_value);
5656
int int_value = safe_cast<int>(value);
5757

58-
for
59-
each(ValuePair ^ i in real_value->m_collection)
60-
{
61-
if (i->first != int_value)
62-
continue;
58+
for each(ValuePair ^ i in real_value->m_collection)
59+
{
60+
if (i->first != int_value)
61+
continue;
6362

64-
return (i->second);
65-
}
63+
return (i->second);
64+
}
6665

6766
return (safe_cast<ValuePair ^>(real_value->m_collection[0])->second);
6867
}

src/editors/xrWeatherEditor/property_float_enum_value.cpp

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,13 @@ property_float_enum_value::property_float_enum_value(
2727
System::Object ^ property_float_enum_value::GetValue()
2828
{
2929
float value = safe_cast<float>(inherited::GetValue());
30-
for
31-
each(ValuePair ^ i in m_collection)
32-
{
33-
if (i->first != value)
34-
continue;
30+
for each(ValuePair ^ i in m_collection)
31+
{
32+
if (i->first != value)
33+
continue;
3534

36-
return (value);
37-
}
35+
return (value);
36+
}
3837

3938
return (safe_cast<ValuePair ^>(m_collection[0])->first);
4039
}
@@ -43,15 +42,14 @@ void property_float_enum_value::SetValue(Object ^ object)
4342
{
4443
String ^ string_value = dynamic_cast<String ^>(object);
4544

46-
for
47-
each(ValuePair ^ i in m_collection)
48-
{
49-
if (!i->second->Equals(string_value))
50-
continue;
45+
for each(ValuePair ^ i in m_collection)
46+
{
47+
if (!i->second->Equals(string_value))
48+
continue;
5149

52-
inherited::SetValue(i->first);
53-
return;
54-
}
50+
inherited::SetValue(i->first);
51+
return;
52+
}
5553

5654
inherited::SetValue(safe_cast<ValuePair ^>(m_collection[0])->first);
5755
}

src/editors/xrWeatherEditor/property_float_enum_value_reference.cpp

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,13 @@ property_float_enum_value_reference::property_float_enum_value_reference(
2727
System::Object ^ property_float_enum_value_reference::GetValue()
2828
{
2929
float value = safe_cast<float>(inherited::GetValue());
30-
for
31-
each(ValuePair ^ i in m_collection)
32-
{
33-
if (i->first != value)
34-
continue;
30+
for each(ValuePair ^ i in m_collection)
31+
{
32+
if (i->first != value)
33+
continue;
3534

36-
return (value);
37-
}
35+
return (value);
36+
}
3837

3938
return (safe_cast<ValuePair ^>(m_collection[0])->first);
4039
}
@@ -43,15 +42,14 @@ void property_float_enum_value_reference::SetValue(Object ^ object)
4342
{
4443
String ^ string_value = dynamic_cast<String ^>(object);
4544

46-
for
47-
each(ValuePair ^ i in m_collection)
48-
{
49-
if (!i->second->Equals(string_value))
50-
continue;
45+
for each(ValuePair ^ i in m_collection)
46+
{
47+
if (!i->second->Equals(string_value))
48+
continue;
5149

52-
inherited::SetValue(i->first);
53-
return;
54-
}
50+
inherited::SetValue(i->first);
51+
return;
52+
}
5553

5654
inherited::SetValue(safe_cast<ValuePair ^>(m_collection[0])->first);
5755
}

src/editors/xrWeatherEditor/property_integer_enum_value.cpp

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,13 @@ property_integer_enum_value::property_integer_enum_value(
2727
System::Object ^ property_integer_enum_value::GetValue()
2828
{
2929
int value = safe_cast<int>(inherited::GetValue());
30-
for
31-
each(ValuePair ^ i in m_collection)
32-
{
33-
if (i->first != value)
34-
continue;
30+
for each(ValuePair ^ i in m_collection)
31+
{
32+
if (i->first != value)
33+
continue;
3534

36-
return (value);
37-
}
35+
return (value);
36+
}
3837

3938
return (safe_cast<ValuePair ^>(m_collection[0])->first);
4039
}
@@ -43,15 +42,14 @@ void property_integer_enum_value::SetValue(Object ^ object)
4342
{
4443
String ^ string_value = dynamic_cast<String ^>(object);
4544

46-
for
47-
each(ValuePair ^ i in m_collection)
48-
{
49-
if (!i->second->Equals(string_value))
50-
continue;
45+
for each(ValuePair ^ i in m_collection)
46+
{
47+
if (!i->second->Equals(string_value))
48+
continue;
5149

52-
inherited::SetValue(i->first);
53-
return;
54-
}
50+
inherited::SetValue(i->first);
51+
return;
52+
}
5553

5654
inherited::SetValue(safe_cast<ValuePair ^>(m_collection[0])->first);
5755
}

src/editors/xrWeatherEditor/property_integer_enum_value_reference.cpp

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,13 @@ property_integer_enum_value_reference::property_integer_enum_value_reference(
2727
System::Object ^ property_integer_enum_value_reference::GetValue()
2828
{
2929
int value = safe_cast<int>(inherited::GetValue());
30-
for
31-
each(ValuePair ^ i in m_collection)
32-
{
33-
if (i->first != value)
34-
continue;
30+
for each(ValuePair ^ i in m_collection)
31+
{
32+
if (i->first != value)
33+
continue;
3534

36-
return (value);
37-
}
35+
return (value);
36+
}
3837

3938
return (safe_cast<ValuePair ^>(m_collection[0])->first);
4039
}
@@ -43,15 +42,14 @@ void property_integer_enum_value_reference::SetValue(Object ^ object)
4342
{
4443
String ^ string_value = dynamic_cast<String ^>(object);
4544

46-
for
47-
each(ValuePair ^ i in m_collection)
48-
{
49-
if (!i->second->Equals(string_value))
50-
continue;
45+
for each(ValuePair ^ i in m_collection)
46+
{
47+
if (!i->second->Equals(string_value))
48+
continue;
5149

52-
inherited::SetValue(i->first);
53-
return;
54-
}
50+
inherited::SetValue(i->first);
51+
return;
52+
}
5553

5654
inherited::SetValue(safe_cast<ValuePair ^>(m_collection[0])->first);
5755
}

src/editors/xrWeatherEditor/window_tree_values.cpp

Lines changed: 31 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)