Base: make getAttribute template

This commit is contained in:
Benjamin Bræstrup Sayoc
2025-02-25 20:32:11 +01:00
parent 7f49550dee
commit 2b1aec0041
64 changed files with 834 additions and 675 deletions

View File

@@ -122,12 +122,13 @@ void PropertyRowHeights::Restore(Base::XMLReader& reader)
// Row info
reader.readElement("RowInfo");
Cnt = reader.hasAttribute("Count") ? reader.getAttributeAsInteger("Count") : 0;
Cnt = reader.hasAttribute("Count") ? reader.getAttribute<long>("Count") : 0;
for (int i = 0; i < Cnt; i++) {
reader.readElement("Row");
const char* name = reader.hasAttribute("name") ? reader.getAttribute("name") : nullptr;
const char* name =
reader.hasAttribute("name") ? reader.getAttribute<const char*>("name") : nullptr;
const char* height =
reader.hasAttribute("height") ? reader.getAttribute("height") : nullptr;
reader.hasAttribute("height") ? reader.getAttribute<const char*>("height") : nullptr;
try {
if (name && height) {