Skip to content

Commit

Permalink
Fix compilation of xrWeatherEditor
Browse files Browse the repository at this point in the history
Was broken with c96c2e4
Corresponding formatting fixes
  • Loading branch information
Xottab-DUTY committed Mar 15, 2017
1 parent 2af4148 commit 87fd7aa
Show file tree
Hide file tree
Showing 9 changed files with 114 additions and 132 deletions.
37 changes: 17 additions & 20 deletions src/editors/xrWeatherEditor/property_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,17 @@ bool property_container::equal_category(String ^ new_category, String ^ old_cate

String ^ property_container::update_categories(String ^ new_category)
{
for
each(PropertySpec ^ i in m_ordered_properties)
{
String ^ category = i->Category;
if (!equal_category(new_category, category))
continue;
for each(PropertySpec ^ i in m_ordered_properties)
{
String ^ category = i->Category;
if (!equal_category(new_category, category))
continue;

return (category);
}
return (category);
}

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

return (new_category);
}
Expand Down Expand Up @@ -128,21 +127,19 @@ void property_container::try_update_name(PropertySpec ^ description, String ^ na
void property_container::update_names(String ^ name)
{
bool found = false;
for
each(PropertySpec ^ i in m_ordered_properties)
{
if (i->Name != name)
continue;
for each(PropertySpec ^ i in m_ordered_properties)
{
if (i->Name != name)
continue;

found = true;
break;
}
found = true;
break;
}

if (!found)
return;

for
each(PropertySpec ^ i in m_ordered_properties) try_update_name(i, name);
for each(PropertySpec ^ i in m_ordered_properties) try_update_name(i, name);
}

void property_container::add_property(PropertySpec ^ description, IProperty ^ value)
Expand Down
6 changes: 2 additions & 4 deletions src/editors/xrWeatherEditor/property_container_converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ PropertyDescriptorCollection ^ property_container_converter::GetProperties(
{
ArrayList % properties = container->ordered_properties();
ArrayList ^ names = gcnew ArrayList();
for
each(PropertySpec ^ i in properties) names->Add(i->Name);
for each(PropertySpec ^ i in properties) names->Add(i->Name);

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

return (current->Sort(reinterpret_cast<array<String ^> ^>(names->ToArray(String::typeid))));
}
Expand Down
13 changes: 6 additions & 7 deletions src/editors/xrWeatherEditor/property_converter_float_enum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,13 @@ Object ^ property_converter_float_enum::ConvertTo(
property_float_enum_value ^ real_value = safe_cast<property_float_enum_value ^>(raw_value);
float float_value = safe_cast<float>(value);

for
each(ValuePair ^ i in real_value->m_collection)
{
if (i->first != float_value)
continue;
for each(ValuePair ^ i in real_value->m_collection)
{
if (i->first != float_value)
continue;

return (i->second);
}
return (i->second);
}

return (safe_cast<ValuePair ^>(real_value->m_collection[0])->second);
}
13 changes: 6 additions & 7 deletions src/editors/xrWeatherEditor/property_converter_integer_enum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,13 @@ Object ^ property_converter_integer_enum::ConvertTo(
property_integer_enum_value ^ real_value = safe_cast<property_integer_enum_value ^>(raw_value);
int int_value = safe_cast<int>(value);

for
each(ValuePair ^ i in real_value->m_collection)
{
if (i->first != int_value)
continue;
for each(ValuePair ^ i in real_value->m_collection)
{
if (i->first != int_value)
continue;

return (i->second);
}
return (i->second);
}

return (safe_cast<ValuePair ^>(real_value->m_collection[0])->second);
}
28 changes: 13 additions & 15 deletions src/editors/xrWeatherEditor/property_float_enum_value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@ property_float_enum_value::property_float_enum_value(
System::Object ^ property_float_enum_value::GetValue()
{
float value = safe_cast<float>(inherited::GetValue());
for
each(ValuePair ^ i in m_collection)
{
if (i->first != value)
continue;
for each(ValuePair ^ i in m_collection)
{
if (i->first != value)
continue;

return (value);
}
return (value);
}

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

for
each(ValuePair ^ i in m_collection)
{
if (!i->second->Equals(string_value))
continue;
for each(ValuePair ^ i in m_collection)
{
if (!i->second->Equals(string_value))
continue;

inherited::SetValue(i->first);
return;
}
inherited::SetValue(i->first);
return;
}

inherited::SetValue(safe_cast<ValuePair ^>(m_collection[0])->first);
}
Expand Down
28 changes: 13 additions & 15 deletions src/editors/xrWeatherEditor/property_float_enum_value_reference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@ property_float_enum_value_reference::property_float_enum_value_reference(
System::Object ^ property_float_enum_value_reference::GetValue()
{
float value = safe_cast<float>(inherited::GetValue());
for
each(ValuePair ^ i in m_collection)
{
if (i->first != value)
continue;
for each(ValuePair ^ i in m_collection)
{
if (i->first != value)
continue;

return (value);
}
return (value);
}

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

for
each(ValuePair ^ i in m_collection)
{
if (!i->second->Equals(string_value))
continue;
for each(ValuePair ^ i in m_collection)
{
if (!i->second->Equals(string_value))
continue;

inherited::SetValue(i->first);
return;
}
inherited::SetValue(i->first);
return;
}

inherited::SetValue(safe_cast<ValuePair ^>(m_collection[0])->first);
}
Expand Down
28 changes: 13 additions & 15 deletions src/editors/xrWeatherEditor/property_integer_enum_value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@ property_integer_enum_value::property_integer_enum_value(
System::Object ^ property_integer_enum_value::GetValue()
{
int value = safe_cast<int>(inherited::GetValue());
for
each(ValuePair ^ i in m_collection)
{
if (i->first != value)
continue;
for each(ValuePair ^ i in m_collection)
{
if (i->first != value)
continue;

return (value);
}
return (value);
}

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

for
each(ValuePair ^ i in m_collection)
{
if (!i->second->Equals(string_value))
continue;
for each(ValuePair ^ i in m_collection)
{
if (!i->second->Equals(string_value))
continue;

inherited::SetValue(i->first);
return;
}
inherited::SetValue(i->first);
return;
}

inherited::SetValue(safe_cast<ValuePair ^>(m_collection[0])->first);
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@ property_integer_enum_value_reference::property_integer_enum_value_reference(
System::Object ^ property_integer_enum_value_reference::GetValue()
{
int value = safe_cast<int>(inherited::GetValue());
for
each(ValuePair ^ i in m_collection)
{
if (i->first != value)
continue;
for each(ValuePair ^ i in m_collection)
{
if (i->first != value)
continue;

return (value);
}
return (value);
}

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

for
each(ValuePair ^ i in m_collection)
{
if (!i->second->Equals(string_value))
continue;
for each(ValuePair ^ i in m_collection)
{
if (!i->second->Equals(string_value))
continue;

inherited::SetValue(i->first);
return;
}
inherited::SetValue(i->first);
return;
}

inherited::SetValue(safe_cast<ValuePair ^>(m_collection[0])->first);
}
65 changes: 31 additions & 34 deletions src/editors/xrWeatherEditor/window_tree_values.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,25 @@ void window_tree_values::values(property_string_values_value_base::collection_ty

TreeNode ^ selected = nullptr;

for
each(String ^ i in values)
for each(String ^ i in values)
{
TreeNode ^ current = nullptr;
String ^ j = i;
while (j->Length)
{
TreeNode ^ current = nullptr;
String ^ j = i;
while (j->Length)
int index = j->IndexOf('\\');
String ^ k = index < 0 ? j : j->Substring(0, index);
j = index < 0 ? "" : j->Substring(index + 1);
if (!current)
{
int index = j->IndexOf('\\');
String ^ k = index < 0 ? j : j->Substring(0, index);
j = index < 0 ? "" : j->Substring(index + 1);
if (!current)
for each(TreeNode ^ i in TreeView->Nodes)
{
for
each(TreeNode ^ i in TreeView->Nodes)
{
if (i->Text != k)
continue;
if (i->Text != k)
continue;

current = i;
break;
}
current = i;
break;
}

if (current)
continue;
Expand All @@ -70,33 +68,32 @@ void window_tree_values::values(property_string_values_value_base::collection_ty
current->ImageIndex = 0;
current->SelectedImageIndex = 0;
continue;
}
}

bool found = false;
for
each(TreeNode ^ i in current->Nodes)
{
if (i->Text != k)
continue;
bool found = false;
for each(TreeNode ^ i in current->Nodes)
{
if (i->Text != k)
continue;

found = true;
current = i;
break;
}
found = true;
current = i;
break;
}
if (!found)
{
current->ImageIndex = 0;
current->SelectedImageIndex = 0;
current = current->Nodes->Add(k);
}
}
}

if (current->FullPath == current_value)
selected = current;
if (current->FullPath == current_value)
selected = current;

current->ImageIndex = 2;
current->SelectedImageIndex = 2;
}
current->ImageIndex = 2;
current->SelectedImageIndex = 2;
}

TreeView->TreeViewNodeSorter = gcnew NodeSorter();
TreeView->Sort();
Expand Down

0 comments on commit 87fd7aa

Please sign in to comment.