fixing build warnings

This commit is contained in:
Crzyrndm 2018-06-23 22:43:11 +12:00
parent 3eb06bac0d
commit 4cfb74443c
4 changed files with 11 additions and 5 deletions

View File

@ -38,7 +38,7 @@ struct rich_text_run
{ {
std::string first; std::string first;
optional<font> second; optional<font> second;
bool preserve_space; bool preserve_space = false;
bool operator==(const rich_text_run &other) const; bool operator==(const rich_text_run &other) const;

View File

@ -29,12 +29,12 @@
namespace xlnt { namespace xlnt {
rich_text::rich_text(const std::string &plain_text) rich_text::rich_text(const std::string &plain_text)
: rich_text({plain_text, optional<font>()}) : rich_text(rich_text_run{plain_text, optional<font>()})
{ {
} }
rich_text::rich_text(const std::string &plain_text, const class font &text_font) rich_text::rich_text(const std::string &plain_text, const class font &text_font)
: rich_text({plain_text, optional<font>(text_font)}) : rich_text(rich_text_run{plain_text, optional<font>(text_font)})
{ {
} }

View File

@ -44,6 +44,12 @@ namespace {
s.characters(p.value()); s.characters(p.value());
break; break;
} }
case xml::parser::eof:
return;
case xml::parser::start_attribute:
case xml::parser::end_attribute:
default:
break;
} }
} }
} }

View File

@ -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) 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]) 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) 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]) if (str == Alignments[i])
{ {