diff --git a/include/xlnt/cell/rich_text_run.hpp b/include/xlnt/cell/rich_text_run.hpp index 0988a7e7..c7112a6a 100644 --- a/include/xlnt/cell/rich_text_run.hpp +++ b/include/xlnt/cell/rich_text_run.hpp @@ -38,7 +38,7 @@ struct rich_text_run { std::string first; optional second; - bool preserve_space; + bool preserve_space = false; bool operator==(const rich_text_run &other) const; diff --git a/source/cell/rich_text.cpp b/source/cell/rich_text.cpp index de0a3a4c..47fc5b07 100644 --- a/source/cell/rich_text.cpp +++ b/source/cell/rich_text.cpp @@ -29,12 +29,12 @@ namespace xlnt { rich_text::rich_text(const std::string &plain_text) - : rich_text({plain_text, optional()}) + : rich_text(rich_text_run{plain_text, optional()}) { } rich_text::rich_text(const std::string &plain_text, const class font &text_font) - : rich_text({plain_text, optional(text_font)}) + : rich_text(rich_text_run{plain_text, optional(text_font)}) { } diff --git a/source/packaging/ext_list.cpp b/source/packaging/ext_list.cpp index de36a9e8..7f837124 100644 --- a/source/packaging/ext_list.cpp +++ b/source/packaging/ext_list.cpp @@ -44,6 +44,12 @@ namespace { s.characters(p.value()); break; } + case xml::parser::eof: + return; + case xml::parser::start_attribute: + case xml::parser::end_attribute: + default: + break; } } } diff --git a/source/worksheet/phonetic_pr.cpp b/source/worksheet/phonetic_pr.cpp index 80a2be81..c86f58d3 100644 --- a/source/worksheet/phonetic_pr.cpp +++ b/source/worksheet/phonetic_pr.cpp @@ -113,7 +113,7 @@ const std::string &phonetic_pr::type_as_string(phonetic_pr::Type type) phonetic_pr::Type phonetic_pr::type_from_string(const std::string &str) { - for (int i = 0; i < Types.size(); ++i) + for (std::size_t i = 0; i < Types.size(); ++i) { if (str == Types[i]) { @@ -130,7 +130,7 @@ const std::string &phonetic_pr::alignment_as_string(Alignment type) phonetic_pr::Alignment phonetic_pr::alignment_from_string(const std::string &str) { - for (int i = 0; i < Alignments.size(); ++i) + for (std::size_t i = 0; i < Alignments.size(); ++i) { if (str == Alignments[i]) {