recommit "rename some things and fix some formatting"

This commit is contained in:
sukoi26 2017-02-14 22:33:54 +01:00 committed by GitHub
parent dc3decd0be
commit 6b9995be44

View File

@ -2542,11 +2542,7 @@ variant xlsx_consumer::read_variant()
} }
if (element == qn("vt", "bool")) if (element == qn("vt", "bool"))
{ {
// bool could be "0" or "false" value = variant(is_true(text));
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"))
{ {
@ -2662,12 +2658,8 @@ std::vector<std::string> xlsx_consumer::read_namespaces()
bool xlsx_consumer::in_element(const xml::qname &name) bool xlsx_consumer::in_element(const xml::qname &name)
{ {
return parser().peek() != xml::parser::event_type::end_element
if ((parser().peek() == xml::parser::event_type::end_element ) && (stack_.back() == name )) && stack_.back() == name;
{
return false;
}
return true;
} }
xml::qname xlsx_consumer::expect_start_element(xml::content content) 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")) else if (current_run_property_element == xml::qname(xmlns, "b"))
{ {
run.second.get().bold( run.second.get().bold(parser().attribute_present("val")
parser().attribute_present("val") ? is_true(parser().attribute("val")) : true); ? is_true(parser().attribute("val")) : true);
} }
else if (current_run_property_element == xml::qname(xmlns, "i")) else if (current_run_property_element == xml::qname(xmlns, "i"))
{ {
run.second.get().bold( run.second.get().bold(parser().attribute_present("val")
parser().attribute_present("val") ? is_true(parser().attribute("val")) : true); ? is_true(parser().attribute("val")) : true);
} }
else if (current_run_property_element == xml::qname(xmlns, "u")) else if (current_run_property_element == xml::qname(xmlns, "u"))
{ {