From b83dcd6a1f98965cb02750c21d15eb950a828c77 Mon Sep 17 00:00:00 2001 From: sukoi26 Date: Fri, 27 Jan 2017 23:48:27 +0100 Subject: [PATCH] variant read, bool change take in account number(0,1) or text(false, true) --- source/detail/xlsx_consumer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/detail/xlsx_consumer.cpp b/source/detail/xlsx_consumer.cpp index 328a3201..be401923 100755 --- a/source/detail/xlsx_consumer.cpp +++ b/source/detail/xlsx_consumer.cpp @@ -2507,8 +2507,11 @@ variant xlsx_consumer::read_variant() } if (element == qn("vt", "bool")) { - bool bvalue = std::stoi(text); - value = variant(bvalue); + // bool could be "0" or "false" + 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")) {