mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
suppress conversion warnings
-- tolower takes chars and returns chars, types are int because C only deals with ints -- format parameter is size_t but there is no std parsing function that returns size_t. stoull is used instead as the widest alternative, and then the cast is applied to suppress the conversion warnings
This commit is contained in:
parent
1066b1007c
commit
5a14d7b9d1
|
@ -376,7 +376,6 @@ void cell::hyperlink(const std::string &url)
|
||||||
|
|
||||||
auto ws = worksheet();
|
auto ws = worksheet();
|
||||||
auto &manifest = ws.workbook().manifest();
|
auto &manifest = ws.workbook().manifest();
|
||||||
bool existing = false;
|
|
||||||
|
|
||||||
d_->hyperlink_ = detail::hyperlink_impl();
|
d_->hyperlink_ = detail::hyperlink_impl();
|
||||||
|
|
||||||
|
|
|
@ -198,7 +198,11 @@ pattern_fill_type from_string(const std::string &string)
|
||||||
auto toLower = [](std::string str) {
|
auto toLower = [](std::string str) {
|
||||||
auto bg{ std::begin (str) };
|
auto bg{ std::begin (str) };
|
||||||
auto en{ std::end (str) };
|
auto en{ std::end (str) };
|
||||||
std::transform (bg, en, bg, tolower);
|
std::transform(bg, en, bg,
|
||||||
|
[](char c) {
|
||||||
|
// static cast to avoid int -> char narrowing warning
|
||||||
|
return static_cast<char>(tolower(c));
|
||||||
|
});
|
||||||
|
|
||||||
return str;
|
return str;
|
||||||
};
|
};
|
||||||
|
|
|
@ -246,7 +246,7 @@ cell xlsx_consumer::read_cell()
|
||||||
|
|
||||||
if (parser().attribute_present("s"))
|
if (parser().attribute_present("s"))
|
||||||
{
|
{
|
||||||
cell.format(target_.format(std::stoull(parser().attribute("s"))));
|
cell.format(target_.format(static_cast<std::size_t>(std::stoull(parser().attribute("s")))));
|
||||||
}
|
}
|
||||||
|
|
||||||
auto has_value = false;
|
auto has_value = false;
|
||||||
|
@ -673,7 +673,7 @@ void xlsx_consumer::read_worksheet_sheetdata()
|
||||||
|
|
||||||
if (parser().attribute_present("s"))
|
if (parser().attribute_present("s"))
|
||||||
{
|
{
|
||||||
cell.format(target_.format(std::stoull(parser().attribute("s"))));
|
cell.format(target_.format(static_cast<std::size_t>(std::stoull(parser().attribute("s")))));
|
||||||
}
|
}
|
||||||
|
|
||||||
auto has_value = false;
|
auto has_value = false;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user