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"
|
kind "ConsoleApp"
|
||||||
language "C++"
|
language "C++"
|
||||||
targetname "xlnt.test"
|
targetname "xlnt.test"
|
||||||
|
targetdir "../bin"
|
||||||
includedirs {
|
includedirs {
|
||||||
"../include",
|
"../include",
|
||||||
"../third-party/pugixml/src",
|
"../third-party/pugixml/src",
|
||||||
|
"../third-party/miniz",
|
||||||
"../third-party/cxxtest"
|
"../third-party/cxxtest"
|
||||||
}
|
}
|
||||||
files {
|
files {
|
||||||
"../tests/*.hpp",
|
"../tests/*.hpp",
|
||||||
"../tests/runner-autogen.cpp"
|
"../tests/runner-autogen.cpp"
|
||||||
}
|
}
|
||||||
links {
|
links { "xlnt" }
|
||||||
"pugixml",
|
|
||||||
"xlnt"
|
|
||||||
}
|
|
||||||
prebuildcommands { "../../third-party/cxxtest/bin/cxxtestgen --runner=ErrorPrinter -o ../../tests/runner-autogen.cpp ../../tests/*.hpp" }
|
prebuildcommands { "../../third-party/cxxtest/bin/cxxtestgen --runner=ErrorPrinter -o ../../tests/runner-autogen.cpp ../../tests/*.hpp" }
|
||||||
flags {
|
flags { "Unicode" }
|
||||||
"Unicode",
|
|
||||||
"NoEditAndContinue",
|
|
||||||
"NoManifest",
|
|
||||||
"NoPCH"
|
|
||||||
}
|
|
||||||
configuration "Debug"
|
|
||||||
targetdir "../bin"
|
|
||||||
configuration "Release"
|
configuration "Release"
|
||||||
flags { "LinkTimeOptimization" }
|
flags { "LinkTimeOptimization" }
|
||||||
targetdir "../bin"
|
|
||||||
configuration "windows"
|
configuration "windows"
|
||||||
defines { "WIN32" }
|
defines { "WIN32" }
|
||||||
links { "Shlwapi" }
|
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"
|
project "xlnt"
|
||||||
kind "StaticLib"
|
kind "StaticLib"
|
||||||
language "C++"
|
language "C++"
|
||||||
warnings "Extra"
|
warnings "Extra"
|
||||||
targetdir "../lib/"
|
targetdir "../lib/"
|
||||||
links {
|
|
||||||
"pugixml"
|
|
||||||
}
|
|
||||||
includedirs {
|
includedirs {
|
||||||
"../include/xlnt",
|
"../include/xlnt",
|
||||||
|
"../third-party/miniz",
|
||||||
"../third-party/pugixml/src"
|
"../third-party/pugixml/src"
|
||||||
}
|
}
|
||||||
files {
|
files {
|
||||||
"../source/**.cpp",
|
"../source/**.cpp",
|
||||||
"../source/**.hpp",
|
"../source/**.hpp",
|
||||||
"../include/xlnt/**.hpp"
|
"../include/xlnt/**.hpp",
|
||||||
}
|
"../third-party/miniz/miniz.c",
|
||||||
flags {
|
"../third-party/pugixml/src/pugixml.cpp"
|
||||||
"Unicode",
|
|
||||||
"NoEditAndContinue",
|
|
||||||
"NoManifest",
|
|
||||||
"NoPCH"
|
|
||||||
}
|
}
|
||||||
|
flags { "Unicode" }
|
||||||
configuration "Debug"
|
configuration "Debug"
|
||||||
flags { "FatalWarnings" }
|
flags { "FatalWarnings" }
|
||||||
configuration "windows"
|
configuration "windows"
|
||||||
|
@ -80,30 +57,3 @@ project "xlnt"
|
||||||
"WIN32",
|
"WIN32",
|
||||||
"_CRT_SECURE_NO_WARNINGS"
|
"_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);
|
protection(type locked);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
type locked_;
|
// type locked_;
|
||||||
type hidden_;
|
// type hidden_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace xlnt
|
} // namespace xlnt
|
||||||
|
|
|
@ -4,11 +4,11 @@
|
||||||
namespace xlnt {
|
namespace xlnt {
|
||||||
namespace detail {
|
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 {
|
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 {
|
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, "xml", "", "application/xml" });
|
||||||
content_types.push_back({ true, "rels", "", "application/vnd.openxmlformats-package.relationships+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" });
|
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++)
|
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/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/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/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, "", "/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/core.xml", "application/vnd.openxmlformats-package.core-properties+xml"});
|
||||||
content_types.push_back({false, "", "/docProps/app.xml", "application/vnd.openxmlformats-officedocument.extended-properties+xml"});
|
content_types.push_back({false, "", "/docProps/app.xml", "application/vnd.openxmlformats-officedocument.extended-properties+xml"});
|
||||||
return content_types;
|
return content_types;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,7 @@
|
||||||
namespace xlnt {
|
namespace xlnt {
|
||||||
|
|
||||||
zip_file::zip_file(const std::string &filename, file_mode mode, file_access access)
|
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),
|
filename_(filename),
|
||||||
modified_(false),
|
modified_(false),
|
||||||
// mode_(mode),
|
// mode_(mode),
|
||||||
|
@ -130,7 +129,7 @@ void zip_file::read_all()
|
||||||
|
|
||||||
for(;i < num_files; i++)
|
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))
|
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++)
|
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))
|
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()
|
void zip_file::start_read()
|
||||||
{
|
{
|
||||||
zip_file_ = mz_zip_archive{0};
|
|
||||||
|
|
||||||
if(!mz_zip_reader_init_file(&zip_file_, filename_.c_str(), 0))
|
if(!mz_zip_reader_init_file(&zip_file_, filename_.c_str(), 0))
|
||||||
{
|
{
|
||||||
throw invalid_file_exception(filename_);
|
throw invalid_file_exception(filename_);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user