Skip to content

Commit 3b50a64

Browse files
authored
Merge pull request #179 from Xottab-DUTY/xrWeatherEditor
Fix xrWeatherEditor compilation and one bug
2 parents 8589126 + 87fd7aa commit 3b50a64

10 files changed

+116
-134
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: 14 additions & 16 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,17 +42,16 @@ 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
}
5856

59-
void property_float_enum_value_reference::increment(float const % increment) {}
57+
void property_float_enum_value_reference::Increment(float const % increment) {}

src/editors/xrWeatherEditor/property_float_enum_value_reference.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ ref class property_float_enum_value_reference : public property_float_reference
2929
property_float_enum_value_reference(float& value, pair* values, u32 const& value_count);
3030
virtual Object ^ GetValue() override;
3131
virtual void SetValue(Object ^ object) override;
32-
virtual void increment(float const % increment) override;
32+
virtual void Increment(float const % increment) override;
3333

3434
public:
3535
collection_type ^ m_collection;

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
}

0 commit comments

Comments
 (0)