diff --git a/build/premake5.lua b/build/premake5.lua index 3ded30a5..3e96ebde 100644 --- a/build/premake5.lua +++ b/build/premake5.lua @@ -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" } diff --git a/include/xlnt/styles/protection.hpp b/include/xlnt/styles/protection.hpp index 8a7b5944..eb3bd1b5 100644 --- a/include/xlnt/styles/protection.hpp +++ b/include/xlnt/styles/protection.hpp @@ -39,8 +39,8 @@ public: protection(type locked); private: - type locked_; - type hidden_; +// type locked_; +// type hidden_; }; } // namespace xlnt diff --git a/source/detail/cell_impl.cpp b/source/detail/cell_impl.cpp index 414c8150..45fab450 100644 --- a/source/detail/cell_impl.cpp +++ b/source/detail/cell_impl.cpp @@ -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) { } diff --git a/source/protection.cpp b/source/protection.cpp index 66d5bc6c..57884d73 100644 --- a/source/protection.cpp +++ b/source/protection.cpp @@ -2,14 +2,14 @@ namespace xlnt { -protection::protection() : locked_(type::unprotected) +protection::protection()// : locked_(type::unprotected) { } -protection::protection(type t) : locked_(t) +protection::protection(type /*t*/)// : locked_(t) { } -} // namespace xlnt \ No newline at end of file +} // namespace xlnt diff --git a/source/style.cpp b/source/style.cpp index 0057abf4..80b6792a 100644 --- a/source/style.cpp +++ b/source/style.cpp @@ -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_) { } diff --git a/source/workbook.cpp b/source/workbook.cpp index dbe59fb8..82fbe9c4 100644 --- a/source/workbook.cpp +++ b/source/workbook.cpp @@ -579,15 +579,15 @@ std::vector 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; } diff --git a/source/zip_file.cpp b/source/zip_file.cpp index ce00caf7..7e4c2ee9 100644 --- a/source/zip_file.cpp +++ b/source/zip_file.cpp @@ -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_);