diff --git a/gtk/tools/gtk-builder-tool-simplify.c b/gtk/tools/gtk-builder-tool-simplify.c index da234e0394..92a126ca33 100644 --- a/gtk/tools/gtk-builder-tool-simplify.c +++ b/gtk/tools/gtk-builder-tool-simplify.c @@ -1434,21 +1434,21 @@ rewrite_grid_layout_prop (Element *element, const char *old_value, const char *new_value) { - char *canonical_name; - - canonical_name = g_strdup (old_value); - g_strdelimit (canonical_name, "_", '-'); - if (g_str_equal (element->element_name, "property")) { + char *canonical_name; + + canonical_name = g_strdup (old_value); + g_strdelimit (canonical_name, "_", '-'); + if (has_attribute (element, attr_name, old_value) || has_attribute (element, attr_name, canonical_name)) { set_attribute_value (element, attr_name, new_value); } - } - g_free (canonical_name); + g_free (canonical_name); + } } static void @@ -1460,6 +1460,8 @@ rewrite_grid_layout (Element *element, const char *old_value; const char *new_value; } props[] = { + { "name", "left_attach", "column", }, + { "name", "top_attach", "row", }, { "name", "width", "column-span", }, { "name", "height", "row-span", }, }; diff --git a/testsuite/tools/simplify-data-3to4/grid.expected b/testsuite/tools/simplify-data-3to4/grid.expected index f14ad0d248..b832c4ba31 100644 --- a/testsuite/tools/simplify-data-3to4/grid.expected +++ b/testsuite/tools/simplify-data-3to4/grid.expected @@ -15,8 +15,8 @@ 10 10 - 0 - 0 + 0 + 0 @@ -25,8 +25,8 @@ Hello World! 1 - 1 - 0 + 1 + 0 @@ -35,8 +35,8 @@ Hello World! 1 - 2 - 0 + 2 + 0 @@ -47,8 +47,8 @@ button3 1 - 3 - 0 + 3 + 0 @@ -57,8 +57,8 @@ 1 1 - 4 - 0 + 4 + 0 @@ -66,8 +66,8 @@ 1 - 5 - 0 + 5 + 0 @@ -76,8 +76,8 @@ 1 Text Button - 0 - 1 + 0 + 1 @@ -87,8 +87,8 @@ center center - 1 - 1 + 1 + 1 @@ -98,8 +98,8 @@ center center - 2 - 1 + 2 + 1 2 2 diff --git a/testsuite/tools/simplify-data-3to4/office-runner.expected b/testsuite/tools/simplify-data-3to4/office-runner.expected index 11131a71e5..adeca878bf 100644 --- a/testsuite/tools/simplify-data-3to4/office-runner.expected +++ b/testsuite/tools/simplify-data-3to4/office-runner.expected @@ -26,8 +26,8 @@ 1 - 0 - 0 + 0 + 0 @@ -41,8 +41,8 @@ 1 - 1 - 1 + 1 + 1 @@ -53,8 +53,8 @@ - 1 - 0 + 1 + 0 @@ -81,8 +81,8 @@ 1 - 1 - 0 + 1 + 0 @@ -96,8 +96,8 @@ - 0 - 0 + 0 + 0 @@ -121,8 +121,8 @@ - 0 - 0 + 0 + 0 @@ -176,8 +176,8 @@ - 1 - 0 + 1 + 0