variant read, bool change take in account number(0,1) or text(false, true)

This commit is contained in:
sukoi26 2017-01-27 23:48:27 +01:00 committed by GitHub
parent e14e595b6a
commit b83dcd6a1f

View File

@ -2507,8 +2507,11 @@ variant xlsx_consumer::read_variant()
} }
if (element == qn("vt", "bool")) if (element == qn("vt", "bool"))
{ {
bool bvalue = std::stoi(text); // bool could be "0" or "false"
value = variant(bvalue); bool bvalue;
if (text[0] == '0' or text[0] == 'f' or text[0]=='F') bvalue = false;
else bvalue = true;
value = variant(bvalue);
} }
else if (element == qn("vt", "vector")) else if (element == qn("vt", "vector"))
{ {