Merge pull request #63989 from timothyqiu/vs2017

This commit is contained in:
Rémi Verschelde 2022-08-06 12:13:06 +02:00 committed by GitHub
commit 3b17447d43
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -49,16 +49,24 @@ public:
struct DataEntry { struct DataEntry {
Theme::DataType type; Theme::DataType type;
Variant value; Variant value;
} const valid_data[Theme::DATA_TYPE_MAX] = { } valid_data[Theme::DATA_TYPE_MAX] = {
{ Theme::DATA_TYPE_COLOR, Color() }, { Theme::DATA_TYPE_COLOR, Color() },
{ Theme::DATA_TYPE_CONSTANT, 42 }, { Theme::DATA_TYPE_CONSTANT, 42 },
{ Theme::DATA_TYPE_FONT, Ref<Font>(memnew(BitmapFont)) }, { Theme::DATA_TYPE_FONT, Variant() },
{ Theme::DATA_TYPE_ICON, Ref<Texture>(memnew(ImageTexture)) }, { Theme::DATA_TYPE_ICON, Variant() },
{ Theme::DATA_TYPE_STYLEBOX, Ref<StyleBox>(memnew(StyleBoxFlat)) }, { Theme::DATA_TYPE_STYLEBOX, Variant() },
}; };
const StringName valid_item_name = "valid_item_name"; const StringName valid_item_name = "valid_item_name";
const StringName valid_type_name = "ValidTypeName"; const StringName valid_type_name = "ValidTypeName";
// Part of `valid_data` initialization is moved here so that it compiles in Visual Studio 2017.
// See issue #63975.
Fixture() {
valid_data[Theme::DATA_TYPE_FONT].value = Ref<Font>(memnew(BitmapFont));
valid_data[Theme::DATA_TYPE_ICON].value = Ref<Texture>(memnew(ImageTexture));
valid_data[Theme::DATA_TYPE_STYLEBOX].value = Ref<StyleBox>(memnew(StyleBoxFlat));
}
}; };
bool test_good_theme_type_names() { bool test_good_theme_type_names() {