Skip to content

Commit

Permalink
DocData: Fix sorting of arguments and constants
Browse files Browse the repository at this point in the history
The missing `operator<` definitions caused `Vector::sort()` to fail
sorting those alphabetically by name on Windows (not sure why Linux
isn't affected, I guess GCC/Clang are cleverer and use the operator
from the first struct member).
  • Loading branch information
akien-mga committed May 20, 2020
1 parent 55377aa commit 2ddbaea
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions editor/doc_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ class DocData {
String type;
String enumeration;
String default_value;
bool operator<(const ArgumentDoc &p_arg) const {
return name < p_arg.name;
}
};

struct MethodDoc {
Expand All @@ -51,8 +54,8 @@ class DocData {
String qualifiers;
String description;
Vector<ArgumentDoc> arguments;
bool operator<(const MethodDoc &p_md) const {
return name < p_md.name;
bool operator<(const MethodDoc &p_method) const {
return name < p_method.name;
}
};

Expand All @@ -61,6 +64,9 @@ class DocData {
String value;
String enumeration;
String description;
bool operator<(const ConstantDoc &p_const) const {
return name < p_const.name;
}
};

struct PropertyDoc {
Expand All @@ -70,13 +76,10 @@ class DocData {
String description;
String setter, getter;
String default_value;
bool overridden;
bool overridden = false;
bool operator<(const PropertyDoc &p_prop) const {
return name < p_prop.name;
}
PropertyDoc() {
overridden = false;
}
};

struct ClassDoc {
Expand All @@ -91,6 +94,9 @@ class DocData {
Vector<ConstantDoc> constants;
Vector<PropertyDoc> properties;
Vector<PropertyDoc> theme_properties;
bool operator<(const ClassDoc &p_class) const {
return name < p_class.name;
}
};

String version;
Expand Down

0 comments on commit 2ddbaea

Please sign in to comment.