Merge pull request #1384 from bhangart/fix/borderproperties-qreal-sizes

Read the default border's column width and row height as decimals
This commit is contained in:
ispyisail
2026-10-08 13:46:02 +13:00
committed by GitHub
3 changed files with 137 additions and 2 deletions
+8 -2
View File
@@ -117,9 +117,15 @@ void BorderProperties::toXml(QDomElement &e) const
*/
void BorderProperties::fromXml(QDomElement &e) {
if (e.hasAttribute("cols")) columns_count = e.attribute("cols").toInt();
if (e.hasAttribute("colsize")) columns_width = e.attribute("colsize").toInt();
if (e.hasAttribute("rows")) rows_count = e.attribute("rows").toInt();
if (e.hasAttribute("rowsize")) rows_height = e.attribute("rowsize").toInt();
// The sizes are decimals (toXml() writes them with %1), read as
// BorderTitleBlock::borderFromXml() does; an unreadable value is
// left as it was.
bool ok;
qreal size = e.attribute("colsize").toDouble(&ok);
if (ok && qIsFinite(size)) columns_width = size;
size = e.attribute("rowsize").toDouble(&ok);
if (ok && qIsFinite(size)) rows_height = size;
if (e.hasAttribute("displaycols")) display_columns = e.attribute("displaycols") == "true";
if (e.hasAttribute("displayrows")) display_rows = e.attribute("displayrows") == "true";
}