From d7486830a6f2e37b0767a85115d42f5a3a0cdb40 Mon Sep 17 00:00:00 2001 From: sukoi26 Date: Mon, 6 Feb 2017 23:00:45 +0100 Subject: [PATCH] comment changes anchor() , in element() --- source/cell/cell.cpp | 6 ++--- source/detail/xlsx_consumer.cpp | 47 +++++++++++++++++++++++++++------ 2 files changed, 42 insertions(+), 11 deletions(-) diff --git a/source/cell/cell.cpp b/source/cell/cell.cpp index 0a3a8f80..7e218587 100644 --- a/source/cell/cell.cpp +++ b/source/cell/cell.cpp @@ -528,15 +528,15 @@ std::pair cell::anchor() const for (column_t column_index = 1; column_index <= d_->column_ - 1; column_index++) { - left += worksheet().cell(column_index, row()).width(); + left += worksheet().column_width(column_index); } double top = 0; for (row_t row_index = 1; row_index <= d_->row_ - 1; row_index++) { - top += worksheet().cell(column(), row_index).height(); - } + top += worksheet().row_height(row_index); + } return {static_cast(left), static_cast(top)}; } diff --git a/source/detail/xlsx_consumer.cpp b/source/detail/xlsx_consumer.cpp index be401923..97308157 100755 --- a/source/detail/xlsx_consumer.cpp +++ b/source/detail/xlsx_consumer.cpp @@ -1345,6 +1345,28 @@ void xlsx_consumer::read_stylesheet() new_font.strikethrough(true); } } + else if (font_property_element == qn("spreadsheetml", "outline")) + { + if (parser().attribute_present("val")) + { + new_font.outlinethrough(is_true(parser().attribute("val"))); + } + else + { + new_font.outlinethrough(true); + } + } + else if (font_property_element == qn("spreadsheetml", "shadow")) + { + if (parser().attribute_present("val")) + { + new_font.shadowthrough(is_true(parser().attribute("val"))); + } + else + { + new_font.shadowthrough(true); + } + } else if (font_property_element == qn("spreadsheetml", "i")) { if (parser().attribute_present("val")) @@ -1575,11 +1597,11 @@ void xlsx_consumer::read_stylesheet() auto count = parser().attribute("count"); std::size_t processed = 0; - while (in_element(qn("spreadsheetml", "dxfs"))) + while (in_element(current_style_element)) { - auto current_element = expect_start_element(xml::content::complex); + auto current_element = expect_start_element(xml::content::mixed); skip_remaining_content(current_element); - + expect_end_element(current_element); ++processed; } @@ -1600,7 +1622,7 @@ void xlsx_consumer::read_stylesheet() { auto current_element = expect_start_element(xml::content::complex); skip_remaining_content(current_element); - + expect_end_element(current_element); ++processed; } @@ -1674,7 +1696,7 @@ void xlsx_consumer::read_stylesheet() */ /* std::size_t xf_id = 0; - + for (const auto &record : style_records) { auto style_iter = std::find_if(styles.begin(), styles.end(), @@ -2510,7 +2532,7 @@ variant xlsx_consumer::read_variant() // 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; + else bvalue = true; value = variant(bvalue); } else if (element == qn("vt", "vector")) @@ -2627,11 +2649,11 @@ 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) + + if ((parser().peek() == xml::parser::event_type::end_element ) && (stack_.back() == name )) { return false; } - return true; } @@ -2717,6 +2739,10 @@ rich_text xlsx_consumer::read_rich_text(const xml::qname &parent) { run.second.get().family(parser().attribute("val")); } + else if (current_run_property_element == xml::qname(xmlns, "charset")) + { + run.second.get().charset(parser().attribute("val")); + } else if (current_run_property_element == xml::qname(xmlns, "scheme")) { run.second.get().scheme(parser().attribute("val")); @@ -2726,6 +2752,11 @@ rich_text xlsx_consumer::read_rich_text(const xml::qname &parent) 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); + } else if (current_run_property_element == xml::qname(xmlns, "u")) { if (parser().attribute_present("val"))