doctool: Fix writing theme_item descriptions

We already had support for parsing and saving theme_item descriptions
in DocData, and displaying it in the editor, but doctool would drop the
changes as it was not writing them back to the XML.

Part of #29868.

(cherry picked from commit 615ffb3507)
This commit is contained in:
Rémi Verschelde 2019-06-25 12:57:35 +02:00
parent 67efb30f2a
commit b8d29b5c66
2 changed files with 2 additions and 1 deletions

View File

@ -552,7 +552,7 @@
<theme_item name="number_color" type="Color"> <theme_item name="number_color" type="Color">
</theme_item> </theme_item>
<theme_item name="read_only" type="StyleBox"> <theme_item name="read_only" type="StyleBox">
Sets the [StyleBox] of this [TextEdit] when [member read_only] is enabled. Sets the [StyleBox] of this [TextEdit] when [member readonly] is enabled.
</theme_item> </theme_item>
<theme_item name="safe_line_number_color" type="Color"> <theme_item name="safe_line_number_color" type="Color">
</theme_item> </theme_item>

View File

@ -1127,6 +1127,7 @@ Error DocData::save_classes(const String &p_default_path, const Map<String, Stri
const PropertyDoc &p = c.theme_properties[i]; const PropertyDoc &p = c.theme_properties[i];
_write_string(f, 2, "<theme_item name=\"" + p.name + "\" type=\"" + p.type + "\">"); _write_string(f, 2, "<theme_item name=\"" + p.name + "\" type=\"" + p.type + "\">");
_write_string(f, 3, p.description.strip_edges().xml_escape());
_write_string(f, 2, "</theme_item>"); _write_string(f, 2, "</theme_item>");
} }
_write_string(f, 1, "</theme_items>"); _write_string(f, 1, "</theme_items>");