mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
fix clang warnings, update build script
This commit is contained in:
parent
92eec8ede8
commit
ec1d9f7ecb
|
@ -12,67 +12,44 @@ project "xlnt.test"
|
|||
kind "ConsoleApp"
|
||||
language "C++"
|
||||
targetname "xlnt.test"
|
||||
targetdir "../bin"
|
||||
includedirs {
|
||||
"../include",
|
||||
"../third-party/pugixml/src",
|
||||
"../third-party/miniz",
|
||||
"../third-party/cxxtest"
|
||||
}
|
||||
files {
|
||||
"../tests/*.hpp",
|
||||
"../tests/runner-autogen.cpp"
|
||||
}
|
||||
links {
|
||||
"pugixml",
|
||||
"xlnt"
|
||||
}
|
||||
links { "xlnt" }
|
||||
prebuildcommands { "../../third-party/cxxtest/bin/cxxtestgen --runner=ErrorPrinter -o ../../tests/runner-autogen.cpp ../../tests/*.hpp" }
|
||||
flags {
|
||||
"Unicode",
|
||||
"NoEditAndContinue",
|
||||
"NoManifest",
|
||||
"NoPCH"
|
||||
}
|
||||
configuration "Debug"
|
||||
targetdir "../bin"
|
||||
flags { "Unicode" }
|
||||
configuration "Release"
|
||||
flags { "LinkTimeOptimization" }
|
||||
targetdir "../bin"
|
||||
configuration "windows"
|
||||
defines { "WIN32" }
|
||||
links { "Shlwapi" }
|
||||
postbuildcommands { "..\\..\\bin\\xlnt.test" }
|
||||
configuration "not windows"
|
||||
postbuildcommands { "../../bin/xlnt.test" }
|
||||
buildoptions {
|
||||
"-std=c++11",
|
||||
"-Wno-unknown-pragmas"
|
||||
}
|
||||
configuration { "not windows", "Debug" }
|
||||
buildoptions { "-ggdb" }
|
||||
|
||||
project "xlnt"
|
||||
kind "StaticLib"
|
||||
language "C++"
|
||||
warnings "Extra"
|
||||
targetdir "../lib/"
|
||||
links {
|
||||
"pugixml"
|
||||
}
|
||||
includedirs {
|
||||
"../include/xlnt",
|
||||
"../third-party/miniz",
|
||||
"../third-party/pugixml/src"
|
||||
}
|
||||
files {
|
||||
"../source/**.cpp",
|
||||
"../source/**.hpp",
|
||||
"../include/xlnt/**.hpp"
|
||||
}
|
||||
flags {
|
||||
"Unicode",
|
||||
"NoEditAndContinue",
|
||||
"NoManifest",
|
||||
"NoPCH"
|
||||
"../include/xlnt/**.hpp",
|
||||
"../third-party/miniz/miniz.c",
|
||||
"../third-party/pugixml/src/pugixml.cpp"
|
||||
}
|
||||
flags { "Unicode" }
|
||||
configuration "Debug"
|
||||
flags { "FatalWarnings" }
|
||||
configuration "windows"
|
||||
|
@ -80,30 +57,3 @@ project "xlnt"
|
|||
"WIN32",
|
||||
"_CRT_SECURE_NO_WARNINGS"
|
||||
}
|
||||
configuration "not windows"
|
||||
buildoptions {
|
||||
"-std=c++11",
|
||||
"-Wno-unknown-pragmas"
|
||||
}
|
||||
configuration { "not windows", "Debug" }
|
||||
buildoptions { "-ggdb" }
|
||||
|
||||
project "pugixml"
|
||||
kind "StaticLib"
|
||||
language "C++"
|
||||
warnings "Off"
|
||||
targetdir "../lib/"
|
||||
includedirs {
|
||||
"../third-party/pugixml/src"
|
||||
}
|
||||
files {
|
||||
"../third-party/pugixml/src/pugixml.cpp"
|
||||
}
|
||||
flags {
|
||||
"Unicode",
|
||||
"NoEditAndContinue",
|
||||
"NoManifest",
|
||||
"NoPCH"
|
||||
}
|
||||
configuration "windows"
|
||||
defines { "WIN32" }
|
||||
|
|
|
@ -39,8 +39,8 @@ public:
|
|||
protection(type locked);
|
||||
|
||||
private:
|
||||
type locked_;
|
||||
type hidden_;
|
||||
// type locked_;
|
||||
// type hidden_;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
namespace xlnt {
|
||||
namespace detail {
|
||||
|
||||
cell_impl::cell_impl() : parent_(nullptr), column_(0), row_(0), style_(nullptr), merged(false), has_hyperlink_(false), is_date_(false)
|
||||
cell_impl::cell_impl() : parent_(nullptr), column_(0), row_(0), style_(nullptr), merged(false), is_date_(false), has_hyperlink_(false)
|
||||
{
|
||||
}
|
||||
|
||||
cell_impl::cell_impl(worksheet_impl *parent, int column_index, int row_index) : parent_(parent), column_(column_index), row_(row_index), style_(nullptr), merged(false), has_hyperlink_(false), is_date_(false)
|
||||
cell_impl::cell_impl(worksheet_impl *parent, int column_index, int row_index) : parent_(parent), column_(column_index), row_(row_index), style_(nullptr), merged(false), is_date_(false), has_hyperlink_(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
namespace xlnt {
|
||||
|
||||
protection::protection() : locked_(type::unprotected)
|
||||
protection::protection()// : locked_(type::unprotected)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protection::protection(type t) : locked_(t)
|
||||
protection::protection(type /*t*/)// : locked_(t)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace xlnt {
|
||||
|
||||
style::style(const style &rhs) : protection_(rhs.protection_), number_format_(rhs.number_format_)
|
||||
style::style(const style &rhs) : number_format_(rhs.number_format_), protection_(rhs.protection_)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -579,15 +579,15 @@ std::vector<content_type> xlnt::workbook::get_content_types() const
|
|||
content_types.push_back({ true, "xml", "", "application/xml" });
|
||||
content_types.push_back({ true, "rels", "", "application/vnd.openxmlformats-package.relationships+xml" });
|
||||
content_types.push_back({ false, "", "/xl/workbook.xml", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" });
|
||||
for(int i = 0; i < get_sheet_names().size(); i++)
|
||||
{
|
||||
content_types.push_back({false, "", "/xl/worksheets/sheet" + std::to_string(i + 1) + ".xml", "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"});
|
||||
}
|
||||
content_types.push_back({false, "", "/xl/theme/theme1.xml", "application/vnd.openxmlformats-officedocument.theme+xml"});
|
||||
content_types.push_back({false, "", "/xl/styles.xml", "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"});
|
||||
content_types.push_back({false, "", "/xl/sharedStrings.xml", "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"});
|
||||
content_types.push_back({false, "", "/docProps/core.xml", "application/vnd.openxmlformats-package.core-properties+xml"});
|
||||
content_types.push_back({false, "", "/docProps/app.xml", "application/vnd.openxmlformats-officedocument.extended-properties+xml"});
|
||||
for(std::size_t i = 0; i < get_sheet_names().size(); i++)
|
||||
{
|
||||
content_types.push_back({false, "", "/xl/worksheets/sheet" + std::to_string(i + 1) + ".xml", "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"});
|
||||
}
|
||||
content_types.push_back({false, "", "/xl/theme/theme1.xml", "application/vnd.openxmlformats-officedocument.theme+xml"});
|
||||
content_types.push_back({false, "", "/xl/styles.xml", "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"});
|
||||
content_types.push_back({false, "", "/xl/sharedStrings.xml", "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"});
|
||||
content_types.push_back({false, "", "/docProps/core.xml", "application/vnd.openxmlformats-package.core-properties+xml"});
|
||||
content_types.push_back({false, "", "/docProps/app.xml", "application/vnd.openxmlformats-officedocument.extended-properties+xml"});
|
||||
return content_types;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,8 +7,7 @@
|
|||
namespace xlnt {
|
||||
|
||||
zip_file::zip_file(const std::string &filename, file_mode mode, file_access access)
|
||||
: zip_file_({0}),
|
||||
current_state_(state::closed),
|
||||
: current_state_(state::closed),
|
||||
filename_(filename),
|
||||
modified_(false),
|
||||
// mode_(mode),
|
||||
|
@ -130,7 +129,7 @@ void zip_file::read_all()
|
|||
|
||||
for(;i < num_files; i++)
|
||||
{
|
||||
mz_zip_archive_file_stat file_info = {0};
|
||||
mz_zip_archive_file_stat file_info;
|
||||
|
||||
if(!mz_zip_reader_file_stat(&zip_file_, i, &file_info))
|
||||
{
|
||||
|
@ -185,7 +184,7 @@ std::string zip_file::read_from_zip(const std::string &filename)
|
|||
|
||||
for(;i < num_files; i++)
|
||||
{
|
||||
mz_zip_archive_file_stat file_info = {0};
|
||||
mz_zip_archive_file_stat file_info;
|
||||
|
||||
if(!mz_zip_reader_file_stat(&zip_file_, i, &file_info))
|
||||
{
|
||||
|
@ -311,8 +310,6 @@ bool zip_file::file_exists(const std::string& name)
|
|||
|
||||
void zip_file::start_read()
|
||||
{
|
||||
zip_file_ = mz_zip_archive{0};
|
||||
|
||||
if(!mz_zip_reader_init_file(&zip_file_, filename_.c_str(), 0))
|
||||
{
|
||||
throw invalid_file_exception(filename_);
|
||||
|
|
Loading…
Reference in New Issue
Block a user