mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
fix clang build
This commit is contained in:
parent
25aea3fe72
commit
dce2367524
|
@ -153,7 +153,7 @@ private:
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto position_size = data_.size();
|
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));
|
data_.resize(std::max(position_size, required_size));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#include <helpers/path_helper.hpp>
|
#include <helpers/path_helper.hpp>
|
||||||
#include <xlnt/workbook/workbook.hpp>
|
#include <xlnt/workbook/workbook.hpp>
|
||||||
|
|
||||||
#define TEST_CRYPTO false
|
#define TEST_CRYPTO true
|
||||||
|
|
||||||
#ifndef TEST_CRYPTO
|
#ifndef TEST_CRYPTO
|
||||||
#define TEST_CRYPTO false
|
#define TEST_CRYPTO false
|
||||||
|
|
|
@ -302,18 +302,20 @@ public:
|
||||||
delete stream;
|
delete stream;
|
||||||
return compare_files(expected, contents, content_type);
|
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,
|
Partio::ZipFileReader &archive,
|
||||||
const xlnt::path &member,
|
const xlnt::path &member,
|
||||||
const std::string &content_type)
|
const std::string &content_type)
|
||||||
{
|
{
|
||||||
if (!archive.Has_File(member.string())) return false;
|
if (!archive.Has_File(member.string())) return false;
|
||||||
std::ostringstream member_stream;
|
std::vector<std::uint8_t> member_data;
|
||||||
auto stream = archive.Get_File(member.string(), true);
|
xlnt::detail::vector_ostreambuf member_data_buffer(member_data);
|
||||||
std::string contents((std::istreambuf_iterator<char>(*stream)), (std::istreambuf_iterator<char>()));
|
std::ostream member_data_stream(&member_data_buffer);
|
||||||
delete stream;
|
std::unique_ptr<std::istream> member_stream(archive.Get_File(member.string(), true));
|
||||||
auto result = compare_files(file.read_contents(), contents, content_type);
|
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,
|
static bool file_matches_document(const xlnt::path &expected,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user