diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 8b35f3d1..0192d759 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -19,6 +19,7 @@ if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y") elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC") + add_definitions(-DUNICODE -D_UNICODE) endif() set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/../lib) diff --git a/cmake/xlnt.test.cmake b/cmake/xlnt.test.cmake index a92abce4..2ea886fc 100644 --- a/cmake/xlnt.test.cmake +++ b/cmake/xlnt.test.cmake @@ -17,6 +17,10 @@ source_group(helpers FILES ${TEST_HELPERS_HEADERS} ${TEST_HELPERS_SOURCES}) target_link_libraries(xlnt.test xlnt) +if(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC") + target_link_libraries(xlnt.test Shlwapi) +endif() + add_custom_target (generate-test-runner COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/generate-tests COMMENT "Generating test runner tests/runner-autogen.cpp" @@ -24,9 +28,11 @@ add_custom_target (generate-test-runner add_dependencies(xlnt.test generate-test-runner) -add_custom_command( - TARGET xlnt.test - POST_BUILD - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../bin/xlnt.test - VERBATIM -) +if(${CMAKE_GENERATOR} STREQUAL "Unix Makefiles") + add_custom_command( + TARGET xlnt.test + POST_BUILD + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../bin/xlnt.test + VERBATIM + ) +endif() diff --git a/configure b/configure index d0ce9c7a..6f3f5aef 100755 --- a/configure +++ b/configure @@ -33,7 +33,7 @@ if len(sys.argv) > 1: elif sys.platform == 'darwin': generator = 'Unix Makefiles' elif sys.platform == 'win32': - generator = 'Visual Studio 14 2015' + generator = 'Visual Studio 14 2015 Win64' cmake = 'cmake' diff --git a/include/xlnt/styles/font.hpp b/include/xlnt/styles/font.hpp index 21b35c0b..b0da3a2f 100644 --- a/include/xlnt/styles/font.hpp +++ b/include/xlnt/styles/font.hpp @@ -147,29 +147,17 @@ class font std::size_t hash() const { - std::size_t seed = bold_; - seed = seed << 1 & italic_; - seed = seed << 1 & superscript_; - seed = seed << 1 & subscript_; - seed = seed << 1 & strikethrough_; - + std::size_t seed = 0; + + hash_combine(seed, bold_); + hash_combine(seed, italic_); + hash_combine(seed, superscript_); + hash_combine(seed, subscript_); + hash_combine(seed, strikethrough_); hash_combine(seed, name_); hash_combine(seed, size_); hash_combine(seed, static_cast(underline_)); - hash_combine(seed, static_cast(color_.get_type())); - - switch (color_.get_type()) - { - case color::type::indexed: - hash_combine(seed, color_.get_index()); - break; - case color::type::theme: - hash_combine(seed, color_.get_theme()); - break; - default: - break; - } - + hash_combine(seed, color_.hash()); hash_combine(seed, family_); hash_combine(seed, scheme_); diff --git a/include/xlnt/workbook/workbook.hpp b/include/xlnt/workbook/workbook.hpp index 5d097642..a4f87f4f 100644 --- a/include/xlnt/workbook/workbook.hpp +++ b/include/xlnt/workbook/workbook.hpp @@ -212,16 +212,16 @@ class workbook void add_number_format(const number_format &format); void add_protection(const protection &p); - std::vector