From 6b9995be443afe03212126b76abc6047bb2f625f Mon Sep 17 00:00:00 2001 From: sukoi26 Date: Tue, 14 Feb 2017 22:33:54 +0100 Subject: [PATCH] recommit "rename some things and fix some formatting" --- source/detail/xlsx_consumer.cpp | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/source/detail/xlsx_consumer.cpp b/source/detail/xlsx_consumer.cpp index f896682a..c6f8f811 100755 --- a/source/detail/xlsx_consumer.cpp +++ b/source/detail/xlsx_consumer.cpp @@ -2542,11 +2542,7 @@ variant xlsx_consumer::read_variant() } if (element == qn("vt", "bool")) { - // 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); + value = variant(is_true(text)); } else if (element == qn("vt", "vector")) { @@ -2662,12 +2658,8 @@ std::vector xlsx_consumer::read_namespaces() bool xlsx_consumer::in_element(const xml::qname &name) { - - if ((parser().peek() == xml::parser::event_type::end_element ) && (stack_.back() == name )) - { - return false; - } - return true; + return parser().peek() != xml::parser::event_type::end_element + && stack_.back() == name; } xml::qname xlsx_consumer::expect_start_element(xml::content content) @@ -2762,13 +2754,13 @@ rich_text xlsx_consumer::read_rich_text(const xml::qname &parent) } else if (current_run_property_element == xml::qname(xmlns, "b")) { - run.second.get().bold( - parser().attribute_present("val") ? is_true(parser().attribute("val")) : true); + run.second.get().bold(parser().attribute_present("val") + ? is_true(parser().attribute("val")) : true); } else if (current_run_property_element == xml::qname(xmlns, "i")) { - run.second.get().bold( - parser().attribute_present("val") ? is_true(parser().attribute("val")) : true); + run.second.get().bold(parser().attribute_present("val") + ? is_true(parser().attribute("val")) : true); } else if (current_run_property_element == xml::qname(xmlns, "u")) {