fix clang build

This commit is contained in:
Thomas Fussell 2016-10-30 21:44:43 -04:00
parent 25aea3fe72
commit dce2367524
3 changed files with 11 additions and 9 deletions

View File

@ -153,7 +153,7 @@ private:
else
{
auto position_size = data_.size();
auto required_size = static_cast<std::size_t>(position_ + n);
auto required_size = static_cast<std::size_t>(position_ + static_cast<std::streampos>(n));
data_.resize(std::max(position_size, required_size));
}

View File

@ -7,7 +7,7 @@
#include <helpers/path_helper.hpp>
#include <xlnt/workbook/workbook.hpp>
#define TEST_CRYPTO false
#define TEST_CRYPTO true
#ifndef TEST_CRYPTO
#define TEST_CRYPTO false

View File

@ -302,18 +302,20 @@ public:
delete stream;
return compare_files(expected, contents, content_type);
}
static bool file_matches_archive_member(const xlnt::path &file,
static bool file_matches_archive_member(const xlnt::path &file,
Partio::ZipFileReader &archive,
const xlnt::path &member,
const std::string &content_type)
{
if (!archive.Has_File(member.string())) return false;
std::ostringstream member_stream;
auto stream = archive.Get_File(member.string(), true);
std::string contents((std::istreambuf_iterator<char>(*stream)), (std::istreambuf_iterator<char>()));
delete stream;
auto result = compare_files(file.read_contents(), contents, content_type);
std::vector<std::uint8_t> member_data;
xlnt::detail::vector_ostreambuf member_data_buffer(member_data);
std::ostream member_data_stream(&member_data_buffer);
std::unique_ptr<std::istream> member_stream(archive.Get_File(member.string(), true));
member_data_stream << member_stream->rdbuf();
std::string contents(member_data.begin(), member_data.end());
return compare_files(file.read_contents(), contents, content_type);
}
static bool file_matches_document(const xlnt::path &expected,