fix a few more warnings [ci skip]

This commit is contained in:
Thomas Fussell 2016-12-10 18:39:51 +00:00
parent d0ef4333b4
commit c8e7df6289
4 changed files with 16 additions and 25 deletions

View File

@ -825,11 +825,9 @@ std::string cell::to_string() const
return nf.format(value<std::string>()); return nf.format(value<std::string>());
case cell::type::boolean: case cell::type::boolean:
return value<long double>() == 0.L ? "FALSE" : "TRUE"; return value<long double>() == 0.L ? "FALSE" : "TRUE";
#ifdef WIN32
default:
throw xlnt::exception("unhandled");
#endif
} }
return "";
} }
bool cell::has_format() const bool cell::has_format() const

View File

@ -1551,26 +1551,10 @@ void xlsx_consumer::read_worksheet(const std::string &rel_id)
ws.row_properties(row_index).height = parser().attribute<long double>("ht"); ws.row_properties(row_index).height = parser().attribute<long double>("ht");
} }
skip_attribute("customHeight");
auto min_column = full_range.top_left().column_index();
auto max_column = full_range.bottom_right().column_index();
if (parser().attribute_present("spans"))
{
std::string span_string = parser().attribute("spans");
auto colon_index = span_string.find(':');
if (colon_index != std::string::npos)
{
min_column = static_cast<column_t::index_t>(std::stoll(span_string.substr(0, colon_index)));
max_column = static_cast<column_t::index_t>(std::stoll(span_string.substr(colon_index + 1)));
}
}
skip_attributes({xml::qname(xmlns_x14ac, "dyDescent")}); skip_attributes({xml::qname(xmlns_x14ac, "dyDescent")});
skip_attributes({"customFormat", "s", "customFont", "hidden", skip_attributes({"customFormat", "s", "customFont", "hidden",
"outlineLevel", "collapsed", "thickTop", "thickBot", "ph"}); "outlineLevel", "collapsed", "thickTop", "thickBot", "ph",
"spans", "customHeight"});
while (in_element(xml::qname(xmlns, "row"))) while (in_element(xml::qname(xmlns, "row")))
{ {

View File

@ -25,6 +25,14 @@
#include <xlnt/utils/exceptions.hpp> #include <xlnt/utils/exceptions.hpp>
#include <xlnt/styles/border.hpp> #include <xlnt/styles/border.hpp>
#define EXCEPT_ON_UNHANDLED_SWITCH_CASE
#ifdef EXCEPT_ON_UNHANDLED_SWITCH_CASE
#define default_case(default_value) throw xlnt::exception("unhandled case");
#else
#define default_case(default_value) return default_value;
#endif
namespace xlnt { namespace xlnt {
optional<xlnt::color> border::border_property::color() const optional<xlnt::color> border::border_property::color() const
@ -112,10 +120,9 @@ optional<border::border_property> border::side(border_side s) const
case border_side::vertical: return vertical_; case border_side::vertical: return vertical_;
case border_side::horizontal: return horizontal_; case border_side::horizontal: return horizontal_;
case border_side::diagonal: return diagonal_; case border_side::diagonal: return diagonal_;
#ifdef WIN32
default: throw xlnt::exception("unhandled");
#endif
} }
default_case(start_);
} }
border &border::side(border_side s, const border_property &prop) border &border::side(border_side s, const border_property &prop)

View File

@ -53,6 +53,8 @@ set(BOTAN
if(MSVC) if(MSVC)
set_source_files_properties(${BOTAN} PROPERTIES COMPILE_FLAGS "/wd\"4244\" /wd\"4267\"") set_source_files_properties(${BOTAN} PROPERTIES COMPILE_FLAGS "/wd\"4244\" /wd\"4267\"")
else()
set_source_files_properties(${BOTAN} PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations")
endif() endif()
if (CMAKE_SIZEOF_VOID_P EQUAL 8) if (CMAKE_SIZEOF_VOID_P EQUAL 8)