use static_cast instead of c-style cast for stream pointers

This commit is contained in:
Thomas Fussell 2017-07-11 20:40:55 -07:00
parent e38b1cdd69
commit fee2319093

View File

@ -107,7 +107,7 @@ void streaming_workbook_reader::open(const std::vector<std::uint8_t> &data)
void streaming_workbook_reader::open(const std::string &filename) void streaming_workbook_reader::open(const std::string &filename)
{ {
stream_.reset(new std::ifstream()); stream_.reset(new std::ifstream());
xlnt::detail::open_stream((std::ifstream &)stream_, filename); xlnt::detail::open_stream(static_cast<std::ifstream &>(*stream_), filename);
open(*stream_); open(*stream_);
} }
@ -115,7 +115,7 @@ void streaming_workbook_reader::open(const std::string &filename)
void streaming_workbook_reader::open(const std::wstring &filename) void streaming_workbook_reader::open(const std::wstring &filename)
{ {
stream_.reset(new std::ifstream()); stream_.reset(new std::ifstream());
xlnt::detail::open_stream((std::ifstream &)*stream_, filename); xlnt::detail::open_stream(static_cast<std::ifstream &>(*stream_), filename);
open(*stream_); open(*stream_);
} }
#endif #endif
@ -123,7 +123,7 @@ void streaming_workbook_reader::open(const std::wstring &filename)
void streaming_workbook_reader::open(const xlnt::path &filename) void streaming_workbook_reader::open(const xlnt::path &filename)
{ {
stream_.reset(new std::ifstream()); stream_.reset(new std::ifstream());
xlnt::detail::open_stream((std::ifstream &)*stream_, filename.string()); xlnt::detail::open_stream(static_cast<std::ifstream &>(*stream_), filename.string());
open(*stream_); open(*stream_);
} }