react-native-nitro-xlsx 0.2.5 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NitroXlsx.podspec +26 -27
- package/Package.swift +31 -10
- package/README.md +21 -9
- package/android/CMakeLists.txt +20 -27
- package/cpp/HybridNitroXlsx.cpp +25 -1
- package/cpp/HybridXlsxCellFormat.cpp +46 -146
- package/cpp/HybridXlsxCellFormat.hpp +9 -41
- package/cpp/HybridXlsxConditionalFormat.cpp +4 -1
- package/cpp/HybridXlsxConditionalFormats.cpp +5 -1
- package/cpp/HybridXlsxWorkbook.cpp +38 -8
- package/cpp/HybridXlsxWorkbook.hpp +10 -1
- package/cpp/HybridXlsxWorksheet.cpp +422 -141
- package/cpp/HybridXlsxWorksheet.hpp +4 -1
- package/cpp/XlsxCacheDir.cpp +25 -2
- package/cpp/XlsxCacheDir.hpp +3 -1
- package/cpp/XlsxCellStyle.hpp +360 -0
- package/cpp/XlsxJson.cpp +29 -8
- package/package.json +2 -2
- package/scripts/run-cpp-tests.sh +1 -1
- package/scripts/sync-openxlsx-headers.sh +34 -0
- package/src/__mocks__/react-native-nitro-modules.ts +523 -20
- package/src/__tests__/index.test.ts +124 -16
- package/src/index.ts +13 -13
- package/thirdparty/OpenXLSX/.clang-format +118 -0
- package/thirdparty/OpenXLSX/.clang-tidy +28 -0
- package/thirdparty/OpenXLSX/.gitignore +130 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-07-29-benchmarks_before_XMLNode_wrappers +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-07-29-benchmarks_with_XMLNode_wrappers_and_namespace_and_stripping +49 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-07-29-benchmarks_with_XMLNode_wrappers_and_namespace_char_support +49 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-07-29-benchmarks_with_XMLNode_wrappers_and_namespace_support +49 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-07-29-benchmarks_with_XMLNode_wrappers_and_namespaced_name_disabled +49 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-08-11-benchmarks_post-XLCellIterator-Rework +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-08-14-benchmarks_post-default-row-column-style-support +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-09-02-benchmarks +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-12-19-benchmarks +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-12-30-benchmarks-post-XLSharedStrings-by-ref +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2025-01-09-benchmarks-post-conditionalFormatsAndSheetProtection +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2025-01-10-benchmarks-post-XLCellValue-bugfix +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2025-01-31-benchmarks-post-XLComments-implementation +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2025-02-02-benchmarks-post-XLRowIterator-Rework +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2025-07-20-benchmarks-after-hiding-pugixml-internals +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2025-08-29-benchmarks-after-code-review-with-libzip +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/Benchmark.cpp +249 -0
- package/thirdparty/OpenXLSX/Benchmarks/CMakeLists.txt +19 -0
- package/thirdparty/OpenXLSX/CMakeLists.txt +466 -0
- package/thirdparty/OpenXLSX/Documentation/CMakeLists.txt +31 -0
- package/thirdparty/OpenXLSX/Documentation/Doxyfile.in +2471 -0
- package/thirdparty/OpenXLSX/Documentation/DoxygenLayout.xml +194 -0
- package/thirdparty/OpenXLSX/Documentation/customdoxygen.css +1355 -0
- package/thirdparty/OpenXLSX/Examples/CMakeLists.txt +103 -0
- package/thirdparty/OpenXLSX/Examples/Demo1.cpp +279 -0
- package/thirdparty/OpenXLSX/Examples/Demo10.cpp +545 -0
- package/thirdparty/OpenXLSX/Examples/Demo1A.cpp +137 -0
- package/thirdparty/OpenXLSX/Examples/Demo2.cpp +65 -0
- package/thirdparty/OpenXLSX/Examples/Demo3.cpp +89 -0
- package/thirdparty/OpenXLSX/Examples/Demo4.cpp +86 -0
- package/thirdparty/OpenXLSX/Examples/Demo5.cpp +77 -0
- package/thirdparty/OpenXLSX/Examples/Demo6.cpp +103 -0
- package/thirdparty/OpenXLSX/Examples/Demo7.cpp +79 -0
- package/thirdparty/OpenXLSX/Examples/Demo8.cpp +117 -0
- package/thirdparty/OpenXLSX/Examples/Demo9.cpp +363 -0
- package/thirdparty/OpenXLSX/Examples/cmake/FindLIBZIP.cmake +61 -0
- package/thirdparty/OpenXLSX/Examples/external/CustomZip/CustomZip.hpp +256 -0
- package/thirdparty/OpenXLSX/LICENSE.md +29 -0
- package/thirdparty/OpenXLSX/Makefile.GNU +530 -0
- package/thirdparty/OpenXLSX/Notes/TBDs.txt +16 -0
- package/thirdparty/OpenXLSX/Notes/confirmed-TBCs.txt +8 -0
- package/thirdparty/OpenXLSX/Notes/styles-missing-support.xml +12 -0
- package/thirdparty/OpenXLSX/Notes/todo-list.txt +108 -0
- package/thirdparty/OpenXLSX/OpenXLSX/CMakeLists.txt +631 -0
- package/thirdparty/OpenXLSX/OpenXLSX/OpenXLSX.hpp +63 -0
- package/thirdparty/OpenXLSX/OpenXLSX/OpenXLSXConfig.cmake +11 -0
- package/thirdparty/OpenXLSX/OpenXLSX/cmake/bundle_static_library.cmake +198 -0
- package/thirdparty/OpenXLSX/OpenXLSX/cmake/patch_pkg_config.cmake +69 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/IZipArchive.hpp +361 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/IZipArchive.hpp +361 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/OpenXLSX-Exports.hpp +12 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLCell.hpp +367 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLCellIterator.hpp +252 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLCellRange.hpp +223 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLCellReference.hpp +317 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLCellValue.hpp +793 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLColor.hpp +232 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLColumn.hpp +159 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLCommandQuery.hpp +228 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLComments.hpp +270 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLConstants.hpp +18 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLContentTypes.hpp +264 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLDateTime.hpp +175 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLDocument.hpp +505 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLDrawing.hpp +452 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLException.hpp +161 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLFormula.hpp +375 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLIterator.hpp +40 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLMergeCells.hpp +216 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLProperties.hpp +348 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLRelationships.hpp +348 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLRow.hpp +721 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLRowData.hpp +488 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLSharedStrings.hpp +204 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLSheet.hpp +1640 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLStyles.hpp +2390 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLTables.hpp +132 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLWorkbook.hpp +404 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLXmlData.hpp +283 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLXmlFile.hpp +194 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLXmlParser.hpp +282 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLXmlParserForwardDeclarations.hpp +85 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLZipArchive.hpp +232 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/detail/LibZip.hpp +447 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/detail/OpenXLSXFileSystemTools.hpp +207 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/detail/Zippy.hpp +1375 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX-Exports.hpp +12 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLCell.hpp +367 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLCellIterator.hpp +252 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLCellRange.hpp +223 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLCellReference.hpp +317 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLCellValue.hpp +793 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLColor.hpp +232 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLColumn.hpp +159 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLCommandQuery.hpp +228 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLComments.hpp +270 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLConstants.hpp +18 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLContentTypes.hpp +264 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLDateTime.hpp +175 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLDocument.hpp +505 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLDrawing.hpp +452 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLException.hpp +161 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLFormula.hpp +375 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLIterator.hpp +40 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLMergeCells.hpp +216 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLProperties.hpp +348 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLRelationships.hpp +348 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLRow.hpp +721 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLRowData.hpp +488 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLSharedStrings.hpp +204 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLSheet.hpp +1640 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLStyles.hpp +2390 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLTables.hpp +132 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLWorkbook.hpp +404 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLXmlData.hpp +283 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLXmlFile.hpp +194 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLXmlParser.hpp +282 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLXmlParserForwardDeclarations.hpp +85 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLZipArchive.hpp +232 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/detail/LibZip.hpp +447 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/detail/OpenXLSXFileSystemTools.hpp +207 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/detail/Zippy.hpp +1375 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLCell.cpp +340 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLCellIterator.cpp +427 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLCellRange.cpp +221 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLCellReference.cpp +408 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLCellValue.cpp +519 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLColor.cpp +202 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLColumn.cpp +141 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLComments.cpp +637 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLContentTypes.cpp +329 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLDateTime.cpp +269 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLDocument.cpp +1678 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLDrawing.cpp +784 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLFormula.cpp +201 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLMergeCells.cpp +357 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLProperties.cpp +810 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLRelationships.cpp +529 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLRow.cpp +918 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLRowData.cpp +508 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLSharedStrings.cpp +220 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLSheet.cpp +1970 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLStyles.cpp +3014 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLTables.cpp +125 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLWorkbook.cpp +784 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLXmlData.cpp +247 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLXmlFile.cpp +160 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLXmlParser.cpp +261 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLZipArchive.cpp +266 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/utilities/XLUtilities.hpp +478 -0
- package/thirdparty/OpenXLSX/README.md +1279 -0
- package/thirdparty/OpenXLSX/Scripts/cmake-cleanup.sh +102 -0
- package/thirdparty/OpenXLSX/Scripts/compile.sh +23 -0
- package/thirdparty/OpenXLSX/Scripts/demos-cleanup.sh +25 -0
- package/thirdparty/OpenXLSX/Scripts/demos-run-all.sh +60 -0
- package/thirdparty/OpenXLSX/Scripts/guarded-xml-format.sh +47 -0
- package/thirdparty/OpenXLSX/Scripts/make-gnu.sh +11 -0
- package/thirdparty/OpenXLSX/Scripts/uninstall-manifest.sh +48 -0
- package/thirdparty/OpenXLSX/Scripts/xml-format-all.sh +19 -0
- package/thirdparty/OpenXLSX/Scripts/xml-format.sh +38 -0
- package/thirdparty/OpenXLSX/Tests/CMakeLists.txt +37 -0
- package/thirdparty/OpenXLSX/Tests/catch/catch.hpp +17799 -0
- package/thirdparty/OpenXLSX/Tests/catch/catch_reporter_automake.hpp +68 -0
- package/thirdparty/OpenXLSX/Tests/catch/catch_reporter_sonarqube.hpp +182 -0
- package/thirdparty/OpenXLSX/Tests/catch/catch_reporter_tap.hpp +278 -0
- package/thirdparty/OpenXLSX/Tests/catch/catch_reporter_teamcity.hpp +212 -0
- package/thirdparty/OpenXLSX/Tests/main.cpp +55 -0
- package/thirdparty/OpenXLSX/Tests/testXLCell.cpp +176 -0
- package/thirdparty/OpenXLSX/Tests/testXLCellRange.cpp +180 -0
- package/thirdparty/OpenXLSX/Tests/testXLCellReference.cpp +160 -0
- package/thirdparty/OpenXLSX/Tests/testXLCellValue.cpp +366 -0
- package/thirdparty/OpenXLSX/Tests/testXLCellValueProxy.cpp +255 -0
- package/thirdparty/OpenXLSX/Tests/testXLColor.cpp +75 -0
- package/thirdparty/OpenXLSX/Tests/testXLDateTime.cpp +229 -0
- package/thirdparty/OpenXLSX/Tests/testXLDocument.cpp +197 -0
- package/thirdparty/OpenXLSX/Tests/testXLFormula.cpp +131 -0
- package/thirdparty/OpenXLSX/Tests/testXLRow.cpp +597 -0
- package/thirdparty/OpenXLSX/Tests/testXLSheet.cpp +77 -0
- package/thirdparty/OpenXLSX/Tests/ziptest-with-libs.cpp +88 -0
- package/thirdparty/OpenXLSX/Tests/ziptest.cpp +735 -0
- package/thirdparty/OpenXLSX/cmake/get-git-HEAD-ID.cmake +45 -0
- package/thirdparty/OpenXLSX/cmake/libopenxlsxCPackOptions.cmake.in +20 -0
- package/thirdparty/OpenXLSX/cmake/manage_dependency.cmake +813 -0
- package/thirdparty/OpenXLSX/cmake/recursive_library_type_test.cmake +52 -0
- package/thirdparty/OpenXLSX/gnu-make-crutch/OpenXLSX-Exports-shared.hpp +42 -0
- package/thirdparty/OpenXLSX/gnu-make-crutch/OpenXLSX-Exports-static.hpp +42 -0
- package/thirdparty/OpenXLSX/vcpkg.json +24 -0
- package/thirdparty/README.md +46 -0
- package/thirdparty/miniz/.clang-format +47 -0
- package/thirdparty/miniz/.travis.yml +2 -0
- package/thirdparty/miniz/CMakeLists.txt +333 -0
- package/thirdparty/miniz/CMakePresets.json +31 -0
- package/thirdparty/miniz/ChangeLog.md +272 -0
- package/thirdparty/miniz/Config.cmake.in +1 -0
- package/thirdparty/miniz/LICENSE +22 -0
- package/thirdparty/miniz/amalgamate.sh +57 -0
- package/thirdparty/miniz/examples/example1.c +105 -0
- package/thirdparty/miniz/examples/example2.c +164 -0
- package/thirdparty/miniz/examples/example3.c +269 -0
- package/thirdparty/miniz/examples/example4.c +102 -0
- package/thirdparty/miniz/examples/example5.c +327 -0
- package/thirdparty/miniz/examples/example6.c +189 -0
- package/thirdparty/miniz/meson.build +21 -0
- package/thirdparty/miniz/miniz.c +646 -0
- package/thirdparty/miniz/miniz.h +615 -0
- package/thirdparty/miniz/miniz.pc.in +13 -0
- package/thirdparty/miniz/miniz_common.h +89 -0
- package/thirdparty/miniz/miniz_export.h +20 -0
- package/thirdparty/miniz/miniz_tdef.c +1602 -0
- package/thirdparty/miniz/miniz_tdef.h +199 -0
- package/thirdparty/miniz/miniz_tinfl.c +778 -0
- package/thirdparty/miniz/miniz_tinfl.h +150 -0
- package/thirdparty/miniz/miniz_zip.c +4895 -0
- package/thirdparty/miniz/miniz_zip.h +454 -0
- package/thirdparty/miniz/readme.md +46 -0
- package/thirdparty/miniz/test.sh +36 -0
- package/thirdparty/miniz/tests/add_in_place_fuzzer.c +87 -0
- package/thirdparty/miniz/tests/catch_amalgamated.cpp +10795 -0
- package/thirdparty/miniz/tests/catch_amalgamated.hpp +13143 -0
- package/thirdparty/miniz/tests/checksum_fuzzer.c +26 -0
- package/thirdparty/miniz/tests/compress_fuzzer.c +91 -0
- package/thirdparty/miniz/tests/flush_fuzzer.c +88 -0
- package/thirdparty/miniz/tests/fuzz_main.c +55 -0
- package/thirdparty/miniz/tests/large_fuzzer.c +133 -0
- package/thirdparty/miniz/tests/main.cpp +185 -0
- package/thirdparty/miniz/tests/miniz_tdefl_fuzzer.cc +115 -0
- package/thirdparty/miniz/tests/miniz_tester.cpp +1881 -0
- package/thirdparty/miniz/tests/miniz_zip_validate_fuzzer.cc +71 -0
- package/thirdparty/miniz/tests/miniz_zip_writer_fuzzer.cc +96 -0
- package/thirdparty/miniz/tests/ossfuzz.sh +48 -0
- package/thirdparty/miniz/tests/small_fuzzer.c +126 -0
- package/thirdparty/miniz/tests/timer.cpp +152 -0
- package/thirdparty/miniz/tests/timer.h +40 -0
- package/thirdparty/miniz/tests/uncompress2_fuzzer.c +21 -0
- package/thirdparty/miniz/tests/uncompress_fuzzer.c +30 -0
- package/thirdparty/miniz/tests/zip.dict +9 -0
- package/thirdparty/miniz/tests/zip_fuzzer.c +63 -0
- package/thirdparty/pugixml/.codecov.yml +7 -0
- package/thirdparty/pugixml/.gitattributes +1 -0
- package/thirdparty/pugixml/CMakeLists.txt +330 -0
- package/thirdparty/pugixml/LICENSE.md +24 -0
- package/thirdparty/pugixml/Makefile +98 -0
- package/thirdparty/pugixml/README.md +81 -0
- package/thirdparty/pugixml/SECURITY.md +9 -0
- package/thirdparty/pugixml/appveyor.yml +50 -0
- package/thirdparty/pugixml/docs/config.adoc +7 -0
- package/thirdparty/pugixml/docs/images/dom_tree.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2005_link1.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2005_link2.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2005_pch1.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2005_pch2.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2005_pch3.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2005_pch4.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2010_link1.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2010_link2.png +0 -0
- package/thirdparty/pugixml/docs/manual.adoc +3326 -0
- package/thirdparty/pugixml/docs/manual.html +6395 -0
- package/thirdparty/pugixml/docs/quickstart.adoc +287 -0
- package/thirdparty/pugixml/docs/quickstart.html +1107 -0
- package/thirdparty/pugixml/docs/samples/character.xml +8 -0
- package/thirdparty/pugixml/docs/samples/custom_memory_management.cpp +27 -0
- package/thirdparty/pugixml/docs/samples/include.cpp +64 -0
- package/thirdparty/pugixml/docs/samples/load_error_handling.cpp +33 -0
- package/thirdparty/pugixml/docs/samples/load_file.cpp +16 -0
- package/thirdparty/pugixml/docs/samples/load_memory.cpp +66 -0
- package/thirdparty/pugixml/docs/samples/load_options.cpp +30 -0
- package/thirdparty/pugixml/docs/samples/load_stream.cpp +97 -0
- package/thirdparty/pugixml/docs/samples/modify_add.cpp +29 -0
- package/thirdparty/pugixml/docs/samples/modify_base.cpp +43 -0
- package/thirdparty/pugixml/docs/samples/modify_remove.cpp +27 -0
- package/thirdparty/pugixml/docs/samples/save_custom_writer.cpp +116 -0
- package/thirdparty/pugixml/docs/samples/save_declaration.cpp +27 -0
- package/thirdparty/pugixml/docs/samples/save_file.cpp +17 -0
- package/thirdparty/pugixml/docs/samples/save_options.cpp +48 -0
- package/thirdparty/pugixml/docs/samples/save_stream.cpp +18 -0
- package/thirdparty/pugixml/docs/samples/save_subtree.cpp +26 -0
- package/thirdparty/pugixml/docs/samples/text.cpp +35 -0
- package/thirdparty/pugixml/docs/samples/transitions.xml +7 -0
- package/thirdparty/pugixml/docs/samples/traverse_base.cpp +51 -0
- package/thirdparty/pugixml/docs/samples/traverse_iter.cpp +27 -0
- package/thirdparty/pugixml/docs/samples/traverse_predicate.cpp +48 -0
- package/thirdparty/pugixml/docs/samples/traverse_rangefor.cpp +32 -0
- package/thirdparty/pugixml/docs/samples/traverse_walker.cpp +35 -0
- package/thirdparty/pugixml/docs/samples/tree.xml +12 -0
- package/thirdparty/pugixml/docs/samples/weekly-shift_jis.xml +78 -0
- package/thirdparty/pugixml/docs/samples/weekly-utf-16.xml +0 -0
- package/thirdparty/pugixml/docs/samples/weekly-utf-8.xml +78 -0
- package/thirdparty/pugixml/docs/samples/xgconsole.xml +12 -0
- package/thirdparty/pugixml/docs/samples/xpath_error.cpp +43 -0
- package/thirdparty/pugixml/docs/samples/xpath_query.cpp +36 -0
- package/thirdparty/pugixml/docs/samples/xpath_select.cpp +28 -0
- package/thirdparty/pugixml/docs/samples/xpath_variables.cpp +38 -0
- package/thirdparty/pugixml/readme.txt +50 -0
- package/thirdparty/pugixml/scripts/archive.py +54 -0
- package/thirdparty/pugixml/scripts/cocoapods_push.sh +4 -0
- package/thirdparty/pugixml/scripts/natvis/pugixml.natvis +77 -0
- package/thirdparty/pugixml/scripts/natvis/pugixml_compact.natvis +506 -0
- package/thirdparty/pugixml/scripts/nuget/build/native/pugixml-propertiesui.xml +17 -0
- package/thirdparty/pugixml/scripts/nuget/build/native/pugixml.targets +28 -0
- package/thirdparty/pugixml/scripts/nuget/pugixml.nuspec +20 -0
- package/thirdparty/pugixml/scripts/nuget_build.ps1 +60 -0
- package/thirdparty/pugixml/scripts/premake4.lua +92 -0
- package/thirdparty/pugixml/scripts/pugixml-config.cmake.in +12 -0
- package/thirdparty/pugixml/scripts/pugixml.pc.in +11 -0
- package/thirdparty/pugixml/scripts/pugixml.podspec +14 -0
- package/thirdparty/pugixml/scripts/pugixml.xcodeproj/project.pbxproj +212 -0
- package/thirdparty/pugixml/scripts/pugixml_airplay.mkf +13 -0
- package/thirdparty/pugixml/scripts/pugixml_codeblocks.cbp +44 -0
- package/thirdparty/pugixml/scripts/pugixml_codelite.project +56 -0
- package/thirdparty/pugixml/scripts/pugixml_dll.rc +45 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2005.vcproj +343 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2005_static.vcproj +343 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2008.vcproj +339 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2008_static.vcproj +339 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2010.vcxproj +191 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2010_static.vcxproj +191 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2013.vcxproj +199 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2013_static.vcxproj +199 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2015.vcxproj +172 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2015_static.vcxproj +176 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2017.vcxproj +172 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2017_static.vcxproj +176 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2019.vcxproj +176 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2019_static.vcxproj +180 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2022.vcxproj +176 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2022_static.vcxproj +180 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2026.vcxproj +176 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2026_static.vcxproj +180 -0
- package/thirdparty/pugixml/scripts/sbom.cdx.json +47 -0
- package/thirdparty/pugixml/src/pugiconfig.hpp +81 -0
- package/thirdparty/pugixml/src/pugixml.cpp +13776 -0
- package/thirdparty/pugixml/src/pugixml.hpp +1604 -0
- package/thirdparty/pugixml/tests/allocator.cpp +175 -0
- package/thirdparty/pugixml/tests/allocator.hpp +10 -0
- package/thirdparty/pugixml/tests/autotest-appveyor.ps1 +93 -0
- package/thirdparty/pugixml/tests/cmake-appveyor.ps1 +57 -0
- package/thirdparty/pugixml/tests/data/empty.xml +0 -0
- package/thirdparty/pugixml/tests/data/large.xml +1 -0
- package/thirdparty/pugixml/tests/data/latintest_latin1.xml +1 -0
- package/thirdparty/pugixml/tests/data/latintest_utf8.xml +1 -0
- package/thirdparty/pugixml/tests/data/multiline.xml +3 -0
- package/thirdparty/pugixml/tests/data/small.xml +1 -0
- package/thirdparty/pugixml/tests/data/truncation.xml +19 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_be.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_be_bom.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_be_clean.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_be_nodecl.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_le.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_le_bom.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_le_clean.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_le_nodecl.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_be.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_be_bom.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_be_clean.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_be_nodecl.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_le.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_le_bom.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_le_clean.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_le_nodecl.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf8.xml +87 -0
- package/thirdparty/pugixml/tests/data/utftest_utf8_bom.xml +87 -0
- package/thirdparty/pugixml/tests/data/utftest_utf8_clean.xml +84 -0
- package/thirdparty/pugixml/tests/data/utftest_utf8_nodecl.xml +86 -0
- package/thirdparty/pugixml/tests/data//321/202/320/265/321/201/321/202.xml +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_parse/basic.xml +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_parse/doctype.xml +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_parse/refs.xml +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_parse/types.xml +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_parse/utf16.xml +0 -0
- package/thirdparty/pugixml/tests/data_fuzz_parse/utf32.xml +0 -0
- package/thirdparty/pugixml/tests/data_fuzz_xpath/basic.xpath +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_xpath/functions.xpath +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_xpath/math.xpath +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_xpath/path.xpath +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_xpath/predicate.xpath +1 -0
- package/thirdparty/pugixml/tests/fuzz_parse.cpp +14 -0
- package/thirdparty/pugixml/tests/fuzz_parse.dict +72 -0
- package/thirdparty/pugixml/tests/fuzz_setup.sh +11 -0
- package/thirdparty/pugixml/tests/fuzz_xpath.cpp +46 -0
- package/thirdparty/pugixml/tests/fuzz_xpath.dict +72 -0
- package/thirdparty/pugixml/tests/helpers.hpp +114 -0
- package/thirdparty/pugixml/tests/main.cpp +218 -0
- package/thirdparty/pugixml/tests/test.cpp +220 -0
- package/thirdparty/pugixml/tests/test.hpp +175 -0
- package/thirdparty/pugixml/tests/test_compact.cpp +150 -0
- package/thirdparty/pugixml/tests/test_deprecated.cpp +25 -0
- package/thirdparty/pugixml/tests/test_document.cpp +1910 -0
- package/thirdparty/pugixml/tests/test_dom_modify.cpp +2122 -0
- package/thirdparty/pugixml/tests/test_dom_text.cpp +601 -0
- package/thirdparty/pugixml/tests/test_dom_traverse.cpp +1481 -0
- package/thirdparty/pugixml/tests/test_header_guard.cpp +3 -0
- package/thirdparty/pugixml/tests/test_header_iosfwd_1.cpp +3 -0
- package/thirdparty/pugixml/tests/test_header_iosfwd_2.cpp +3 -0
- package/thirdparty/pugixml/tests/test_header_iostream_1.cpp +3 -0
- package/thirdparty/pugixml/tests/test_header_iostream_2.cpp +3 -0
- package/thirdparty/pugixml/tests/test_header_only_1.cpp +21 -0
- package/thirdparty/pugixml/tests/test_header_only_2.cpp +21 -0
- package/thirdparty/pugixml/tests/test_header_string_1.cpp +3 -0
- package/thirdparty/pugixml/tests/test_header_string_2.cpp +3 -0
- package/thirdparty/pugixml/tests/test_header_string_iostream.cpp +5 -0
- package/thirdparty/pugixml/tests/test_memory.cpp +303 -0
- package/thirdparty/pugixml/tests/test_parse.cpp +1463 -0
- package/thirdparty/pugixml/tests/test_parse_doctype.cpp +366 -0
- package/thirdparty/pugixml/tests/test_unicode.cpp +152 -0
- package/thirdparty/pugixml/tests/test_version.cpp +5 -0
- package/thirdparty/pugixml/tests/test_write.cpp +757 -0
- package/thirdparty/pugixml/tests/test_xpath.cpp +833 -0
- package/thirdparty/pugixml/tests/test_xpath_api.cpp +646 -0
- package/thirdparty/pugixml/tests/test_xpath_functions.cpp +844 -0
- package/thirdparty/pugixml/tests/test_xpath_operators.cpp +566 -0
- package/thirdparty/pugixml/tests/test_xpath_parse.cpp +428 -0
- package/thirdparty/pugixml/tests/test_xpath_paths.cpp +787 -0
- package/thirdparty/pugixml/tests/test_xpath_paths_abbrev_w3c.cpp +219 -0
- package/thirdparty/pugixml/tests/test_xpath_paths_w3c.cpp +312 -0
- package/thirdparty/pugixml/tests/test_xpath_variables.cpp +683 -0
- package/thirdparty/pugixml/tests/test_xpath_xalan_1.cpp +411 -0
- package/thirdparty/pugixml/tests/test_xpath_xalan_2.cpp +417 -0
- package/thirdparty/pugixml/tests/test_xpath_xalan_3.cpp +321 -0
- package/thirdparty/pugixml/tests/test_xpath_xalan_4.cpp +300 -0
- package/thirdparty/pugixml/tests/test_xpath_xalan_5.cpp +295 -0
- package/thirdparty/pugixml/tests/writer_string.cpp +79 -0
- package/thirdparty/pugixml/tests/writer_string.hpp +27 -0
- package/scripts/prepare-openxlsx.js +0 -126
|
@@ -0,0 +1,597 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Created by Kenneth Balslev on 27/08/2021.
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
#include <OpenXLSX.hpp>
|
|
6
|
+
#include <catch.hpp>
|
|
7
|
+
#include <fstream>
|
|
8
|
+
#include <vector>
|
|
9
|
+
#include <list>
|
|
10
|
+
#include <deque>
|
|
11
|
+
|
|
12
|
+
using namespace OpenXLSX;
|
|
13
|
+
|
|
14
|
+
TEST_CASE("XLRow Tests", "[XLRow]")
|
|
15
|
+
{
|
|
16
|
+
SECTION("XLRow")
|
|
17
|
+
{
|
|
18
|
+
XLDocument doc;
|
|
19
|
+
doc.create("./testXLRow.xlsx");
|
|
20
|
+
auto wks = doc.workbook().worksheet("Sheet1");
|
|
21
|
+
|
|
22
|
+
auto row_3 = wks.row(3);
|
|
23
|
+
REQUIRE(row_3.rowNumber() == 3);
|
|
24
|
+
|
|
25
|
+
XLRow copy1 = row_3;
|
|
26
|
+
auto height = copy1.height();
|
|
27
|
+
REQUIRE(copy1.height() == height);
|
|
28
|
+
|
|
29
|
+
XLRow copy2 = std::move(copy1);
|
|
30
|
+
auto descent = copy2.descent();
|
|
31
|
+
REQUIRE(copy2.descent() == descent);
|
|
32
|
+
|
|
33
|
+
XLRow copy3;
|
|
34
|
+
copy3 = copy2;
|
|
35
|
+
copy3.setHeight(height * 3);
|
|
36
|
+
REQUIRE(copy3.height() == height * 3);
|
|
37
|
+
copy3.setHeight(height * 4);
|
|
38
|
+
REQUIRE(copy3.height() == height * 4);
|
|
39
|
+
|
|
40
|
+
XLRow copy4;
|
|
41
|
+
copy4 = std::move(copy3);
|
|
42
|
+
copy4.setDescent(descent * 2);
|
|
43
|
+
REQUIRE(copy4.descent() == descent * 2);
|
|
44
|
+
copy4.setDescent(descent * 3);
|
|
45
|
+
REQUIRE(copy4.descent() == descent * 3);
|
|
46
|
+
|
|
47
|
+
REQUIRE(copy4.isHidden() == false);
|
|
48
|
+
copy4.setHidden(true);
|
|
49
|
+
REQUIRE(copy4.isHidden() == true);
|
|
50
|
+
copy4.setHidden(false);
|
|
51
|
+
REQUIRE(copy4.isHidden() == false);
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
auto row1 = wks.row(11);
|
|
55
|
+
auto row2 = wks.row(12);
|
|
56
|
+
auto row3 = wks.row(13);
|
|
57
|
+
auto row4 = wks.row(13);
|
|
58
|
+
REQUIRE(row3 == row4);
|
|
59
|
+
REQUIRE(row4 >= row3);
|
|
60
|
+
REQUIRE(row3 <= row4);
|
|
61
|
+
REQUIRE(row3 >= row2);
|
|
62
|
+
REQUIRE(row2 <= row3);
|
|
63
|
+
REQUIRE(row1 != row2);
|
|
64
|
+
REQUIRE(row2 > row1);
|
|
65
|
+
REQUIRE(row1 < row2);
|
|
66
|
+
|
|
67
|
+
doc.save();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
TEST_CASE("XLRowData Tests", "[XLRowData]")
|
|
72
|
+
{
|
|
73
|
+
|
|
74
|
+
SECTION("XLRowData (vector<int>)") {
|
|
75
|
+
XLDocument doc;
|
|
76
|
+
doc.create("./testXLRow.xlsx");
|
|
77
|
+
auto wks = doc.workbook().worksheet("Sheet1");
|
|
78
|
+
|
|
79
|
+
auto val1 = std::vector<int> {1, 2, 3, 4, 5};
|
|
80
|
+
auto row1 = wks.row(1);
|
|
81
|
+
row1.values() = val1;
|
|
82
|
+
|
|
83
|
+
const auto row1c = row1;
|
|
84
|
+
|
|
85
|
+
auto val1sum = 0;
|
|
86
|
+
const auto val1results1 = static_cast<std::vector<int>>(row1c.values());
|
|
87
|
+
for (const auto v : val1results1) val1sum += v;
|
|
88
|
+
REQUIRE(val1sum == 15);
|
|
89
|
+
|
|
90
|
+
val1sum = 0;
|
|
91
|
+
const auto val1results2 = static_cast<std::vector<XLCellValue>>(row1c.values());
|
|
92
|
+
for (const auto v : val1results2) val1sum += v.get<int>();
|
|
93
|
+
REQUIRE(val1sum == 15);
|
|
94
|
+
|
|
95
|
+
row1.values().clear();
|
|
96
|
+
|
|
97
|
+
doc.save();
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
SECTION("XLRowData (vector<double>)") {
|
|
101
|
+
XLDocument doc;
|
|
102
|
+
doc.create("./testXLRow.xlsx");
|
|
103
|
+
auto wks = doc.workbook().worksheet("Sheet1");
|
|
104
|
+
|
|
105
|
+
auto val1 = std::vector<double> {1.1, 2.2, 3.3, 4.4, 5.5};
|
|
106
|
+
auto row1 = wks.row(1);
|
|
107
|
+
row1.values() = val1;
|
|
108
|
+
|
|
109
|
+
const auto row1c = row1;
|
|
110
|
+
|
|
111
|
+
auto val1sum = 0.0;
|
|
112
|
+
const auto val1results1 = static_cast<std::vector<double>>(row1c.values());
|
|
113
|
+
for (const auto v : val1results1) val1sum += v;
|
|
114
|
+
REQUIRE(val1sum == 16.5);
|
|
115
|
+
|
|
116
|
+
val1sum = 0;
|
|
117
|
+
const auto val1results2 = static_cast<std::vector<XLCellValue>>(row1c.values());
|
|
118
|
+
for (const auto v : val1results2) val1sum += v.get<double>();
|
|
119
|
+
REQUIRE(val1sum == 16.5);
|
|
120
|
+
|
|
121
|
+
row1.values().clear();
|
|
122
|
+
|
|
123
|
+
doc.save();
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
SECTION("XLRowData (vector<bool>)") {
|
|
127
|
+
XLDocument doc;
|
|
128
|
+
doc.create("./testXLRow.xlsx");
|
|
129
|
+
auto wks = doc.workbook().worksheet("Sheet1");
|
|
130
|
+
|
|
131
|
+
auto val1 = std::vector<bool> {true, false, true, false, true};
|
|
132
|
+
auto row1 = wks.row(1);
|
|
133
|
+
row1.values() = val1;
|
|
134
|
+
|
|
135
|
+
const auto row1c = row1;
|
|
136
|
+
|
|
137
|
+
auto val1sum = 0;
|
|
138
|
+
const auto val1results1 = static_cast<std::vector<bool>>(row1c.values());
|
|
139
|
+
for (const auto v : val1results1)
|
|
140
|
+
if (v) val1sum += 1;
|
|
141
|
+
REQUIRE(val1sum == 3);
|
|
142
|
+
|
|
143
|
+
val1sum = 0;
|
|
144
|
+
const auto val1results2 = static_cast<std::vector<XLCellValue>>(row1c.values());
|
|
145
|
+
for (const auto v : val1results2)
|
|
146
|
+
if(v.get<bool>()) val1sum += 1;
|
|
147
|
+
REQUIRE(val1sum == 3);
|
|
148
|
+
|
|
149
|
+
row1.values().clear();
|
|
150
|
+
|
|
151
|
+
doc.save();
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
SECTION("XLRowData (vector<std::string>)") {
|
|
155
|
+
XLDocument doc;
|
|
156
|
+
doc.create("./testXLRow.xlsx");
|
|
157
|
+
auto wks = doc.workbook().worksheet("Sheet1");
|
|
158
|
+
|
|
159
|
+
auto val1 = std::vector<std::string> {"This", "is", "a", "test."};
|
|
160
|
+
auto row1 = wks.row(1);
|
|
161
|
+
row1.values() = val1;
|
|
162
|
+
|
|
163
|
+
const auto row1c = row1;
|
|
164
|
+
|
|
165
|
+
auto val1sum = 0;
|
|
166
|
+
const auto val1results1 = static_cast<std::vector<std::string>>(row1c.values());
|
|
167
|
+
for (const auto v : val1results1) val1sum += v.size();
|
|
168
|
+
REQUIRE(val1sum == 12);
|
|
169
|
+
|
|
170
|
+
val1sum = 0;
|
|
171
|
+
const auto val1results2 = static_cast<std::vector<XLCellValue>>(row1c.values());
|
|
172
|
+
for (const auto v : val1results2) val1sum += v.get<std::string>().size();
|
|
173
|
+
REQUIRE(val1sum == 12);
|
|
174
|
+
|
|
175
|
+
row1.values().clear();
|
|
176
|
+
|
|
177
|
+
doc.save();
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
SECTION("XLRowData (vector<XLCellValue>)") {
|
|
181
|
+
XLDocument doc;
|
|
182
|
+
doc.create("./testXLRow.xlsx");
|
|
183
|
+
auto wks = doc.workbook().worksheet("Sheet1");
|
|
184
|
+
|
|
185
|
+
auto val1 = std::vector<XLCellValue> {1, 2, 3, 4, 5};
|
|
186
|
+
auto row1 = wks.row(1);
|
|
187
|
+
row1.values() = val1;
|
|
188
|
+
|
|
189
|
+
const auto row1c = row1;
|
|
190
|
+
|
|
191
|
+
auto val1sum = 0;
|
|
192
|
+
const auto val1results1 = static_cast<std::vector<int>>(row1c.values());
|
|
193
|
+
for (const auto v : val1results1) val1sum += v;
|
|
194
|
+
REQUIRE(val1sum == 15);
|
|
195
|
+
|
|
196
|
+
val1sum = 0;
|
|
197
|
+
const auto val1results2 = static_cast<std::vector<XLCellValue>>(row1c.values());
|
|
198
|
+
for (const auto v : val1results2) val1sum += v.get<int>();
|
|
199
|
+
REQUIRE(val1sum == 15);
|
|
200
|
+
|
|
201
|
+
row1.values().clear();
|
|
202
|
+
|
|
203
|
+
doc.save();
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
SECTION("XLRowData (list<int>)") {
|
|
207
|
+
XLDocument doc;
|
|
208
|
+
doc.create("./testXLRow.xlsx");
|
|
209
|
+
auto wks = doc.workbook().worksheet("Sheet1");
|
|
210
|
+
|
|
211
|
+
auto val1 = std::list<int> {1, 2, 3, 4, 5};
|
|
212
|
+
auto row1 = wks.row(1);
|
|
213
|
+
row1.values() = val1;
|
|
214
|
+
|
|
215
|
+
const auto row1c = row1;
|
|
216
|
+
|
|
217
|
+
auto val1sum = 0;
|
|
218
|
+
const auto val1results1 = static_cast<std::list<int>>(row1c.values());
|
|
219
|
+
for (const auto v : val1results1) val1sum += v;
|
|
220
|
+
REQUIRE(val1sum == 15);
|
|
221
|
+
|
|
222
|
+
val1sum = 0;
|
|
223
|
+
const auto val1results2 = static_cast<std::list<XLCellValue>>(row1c.values());
|
|
224
|
+
for (const auto v : val1results2) val1sum += v.get<int>();
|
|
225
|
+
REQUIRE(val1sum == 15);
|
|
226
|
+
|
|
227
|
+
row1.values().clear();
|
|
228
|
+
|
|
229
|
+
doc.save();
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
SECTION("XLRowData (list<bool>)") {
|
|
233
|
+
XLDocument doc;
|
|
234
|
+
doc.create("./testXLRow.xlsx");
|
|
235
|
+
auto wks = doc.workbook().worksheet("Sheet1");
|
|
236
|
+
|
|
237
|
+
auto val1 = std::list<bool> {true, false, true, false, true};
|
|
238
|
+
auto row1 = wks.row(1);
|
|
239
|
+
row1.values() = val1;
|
|
240
|
+
|
|
241
|
+
const auto row1c = row1;
|
|
242
|
+
|
|
243
|
+
auto val1sum = 0;
|
|
244
|
+
const auto val1results1 = static_cast<std::list<bool>>(row1c.values());
|
|
245
|
+
for (const auto v : val1results1)
|
|
246
|
+
if (v) val1sum += 1;
|
|
247
|
+
REQUIRE(val1sum == 3);
|
|
248
|
+
|
|
249
|
+
val1sum = 0;
|
|
250
|
+
const auto val1results2 = static_cast<std::list<XLCellValue>>(row1c.values());
|
|
251
|
+
for (const auto v : val1results2)
|
|
252
|
+
if (v.get<bool>()) val1sum += 1;
|
|
253
|
+
REQUIRE(val1sum == 3);
|
|
254
|
+
|
|
255
|
+
row1.values().clear();
|
|
256
|
+
|
|
257
|
+
doc.save();
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
SECTION("XLRowData (list<double>)") {
|
|
261
|
+
XLDocument doc;
|
|
262
|
+
doc.create("./testXLRow.xlsx");
|
|
263
|
+
auto wks = doc.workbook().worksheet("Sheet1");
|
|
264
|
+
|
|
265
|
+
auto val1 = std::list<double> {1.1, 2.2, 3.3, 4.4, 5.5};
|
|
266
|
+
auto row1 = wks.row(1);
|
|
267
|
+
row1.values() = val1;
|
|
268
|
+
|
|
269
|
+
const auto row1c = row1;
|
|
270
|
+
|
|
271
|
+
auto val1sum = 0.0;
|
|
272
|
+
const auto val1results1 = static_cast<std::list<double>>(row1c.values());
|
|
273
|
+
for (const auto v : val1results1) val1sum += v;
|
|
274
|
+
REQUIRE(val1sum == 16.5);
|
|
275
|
+
|
|
276
|
+
val1sum = 0;
|
|
277
|
+
const auto val1results2 = static_cast<std::list<XLCellValue>>(row1c.values());
|
|
278
|
+
for (const auto v : val1results2) val1sum += v.get<double>();
|
|
279
|
+
REQUIRE(val1sum == 16.5);
|
|
280
|
+
|
|
281
|
+
row1.values().clear();
|
|
282
|
+
|
|
283
|
+
doc.save();
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
SECTION("XLRowData (list<std::string>)") {
|
|
287
|
+
XLDocument doc;
|
|
288
|
+
doc.create("./testXLRow.xlsx");
|
|
289
|
+
auto wks = doc.workbook().worksheet("Sheet1");
|
|
290
|
+
|
|
291
|
+
auto val1 = std::list<std::string> {"This", "is", "a", "test."};
|
|
292
|
+
auto row1 = wks.row(1);
|
|
293
|
+
row1.values() = val1;
|
|
294
|
+
|
|
295
|
+
const auto row1c = row1;
|
|
296
|
+
|
|
297
|
+
auto val1sum = 0;
|
|
298
|
+
const auto val1results1 = static_cast<std::list<std::string>>(row1c.values());
|
|
299
|
+
for (const auto v : val1results1) val1sum += v.size();
|
|
300
|
+
REQUIRE(val1sum == 12);
|
|
301
|
+
|
|
302
|
+
val1sum = 0;
|
|
303
|
+
const auto val1results2 = static_cast<std::list<XLCellValue>>(row1c.values());
|
|
304
|
+
for (const auto v : val1results2) val1sum += v.get<std::string>().size();
|
|
305
|
+
REQUIRE(val1sum == 12);
|
|
306
|
+
|
|
307
|
+
row1.values().clear();
|
|
308
|
+
|
|
309
|
+
doc.save();
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
SECTION("XLRowData (list<XLCellValue>)") {
|
|
313
|
+
XLDocument doc;
|
|
314
|
+
doc.create("./testXLRow.xlsx");
|
|
315
|
+
auto wks = doc.workbook().worksheet("Sheet1");
|
|
316
|
+
|
|
317
|
+
auto val1 = std::list<XLCellValue> {1, 2, 3, 4, 5};
|
|
318
|
+
auto row1 = wks.row(1);
|
|
319
|
+
row1.values() = val1;
|
|
320
|
+
|
|
321
|
+
const auto row1c = row1;
|
|
322
|
+
|
|
323
|
+
auto val1sum = 0;
|
|
324
|
+
const auto val1results1 = static_cast<std::list<int>>(row1c.values());
|
|
325
|
+
for (const auto v : val1results1) val1sum += v;
|
|
326
|
+
REQUIRE(val1sum == 15);
|
|
327
|
+
|
|
328
|
+
val1sum = 0;
|
|
329
|
+
const auto val1results2 = static_cast<std::list<XLCellValue>>(row1c.values());
|
|
330
|
+
for (const auto v : val1results2) val1sum += v.get<int>();
|
|
331
|
+
REQUIRE(val1sum == 15);
|
|
332
|
+
|
|
333
|
+
row1.values().clear();
|
|
334
|
+
|
|
335
|
+
doc.save();
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
SECTION("XLRowData (deque<int>)") {
|
|
339
|
+
XLDocument doc;
|
|
340
|
+
doc.create("./testXLRow.xlsx");
|
|
341
|
+
auto wks = doc.workbook().worksheet("Sheet1");
|
|
342
|
+
|
|
343
|
+
auto val1 = std::deque<int> {1, 2, 3, 4, 5};
|
|
344
|
+
auto row1 = wks.row(1);
|
|
345
|
+
row1.values() = val1;
|
|
346
|
+
|
|
347
|
+
const auto row1c = row1;
|
|
348
|
+
|
|
349
|
+
auto val1sum = 0;
|
|
350
|
+
const auto val1results1 = static_cast<std::deque<int>>(row1c.values());
|
|
351
|
+
for (const auto v : val1results1) val1sum += v;
|
|
352
|
+
REQUIRE(val1sum == 15);
|
|
353
|
+
|
|
354
|
+
val1sum = 0;
|
|
355
|
+
const auto val1results2 = static_cast<std::deque<XLCellValue>>(row1c.values());
|
|
356
|
+
for (const auto v : val1results2) val1sum += v.get<int>();
|
|
357
|
+
REQUIRE(val1sum == 15);
|
|
358
|
+
|
|
359
|
+
row1.values().clear();
|
|
360
|
+
|
|
361
|
+
doc.save();
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
SECTION("XLRowData (deque<bool>)") {
|
|
365
|
+
XLDocument doc;
|
|
366
|
+
doc.create("./testXLRow.xlsx");
|
|
367
|
+
auto wks = doc.workbook().worksheet("Sheet1");
|
|
368
|
+
|
|
369
|
+
auto val1 = std::deque<bool> {true, false, true, false, true};
|
|
370
|
+
auto row1 = wks.row(1);
|
|
371
|
+
row1.values() = val1;
|
|
372
|
+
|
|
373
|
+
const auto row1c = row1;
|
|
374
|
+
|
|
375
|
+
auto val1sum = 0;
|
|
376
|
+
const auto val1results1 = static_cast<std::deque<bool>>(row1c.values());
|
|
377
|
+
for (const auto v : val1results1)
|
|
378
|
+
if (v) val1sum += 1;
|
|
379
|
+
REQUIRE(val1sum == 3);
|
|
380
|
+
|
|
381
|
+
val1sum = 0;
|
|
382
|
+
const auto val1results2 = static_cast<std::deque<XLCellValue>>(row1c.values());
|
|
383
|
+
for (const auto v : val1results2)
|
|
384
|
+
if (v.get<bool>()) val1sum += 1;
|
|
385
|
+
REQUIRE(val1sum == 3);
|
|
386
|
+
|
|
387
|
+
row1.values().clear();
|
|
388
|
+
|
|
389
|
+
doc.save();
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
SECTION("XLRowData (deque<double>)") {
|
|
393
|
+
XLDocument doc;
|
|
394
|
+
doc.create("./testXLRow.xlsx");
|
|
395
|
+
auto wks = doc.workbook().worksheet("Sheet1");
|
|
396
|
+
|
|
397
|
+
auto val1 = std::deque<double> {1.1, 2.2, 3.3, 4.4, 5.5};
|
|
398
|
+
auto row1 = wks.row(1);
|
|
399
|
+
row1.values() = val1;
|
|
400
|
+
|
|
401
|
+
const auto row1c = row1;
|
|
402
|
+
|
|
403
|
+
auto val1sum = 0.0;
|
|
404
|
+
const auto val1results1 = static_cast<std::deque<double>>(row1c.values());
|
|
405
|
+
for (const auto v : val1results1) val1sum += v;
|
|
406
|
+
REQUIRE(val1sum == 16.5);
|
|
407
|
+
|
|
408
|
+
val1sum = 0;
|
|
409
|
+
const auto val1results2 = static_cast<std::deque<XLCellValue>>(row1c.values());
|
|
410
|
+
for (const auto v : val1results2) val1sum += v.get<double>();
|
|
411
|
+
REQUIRE(val1sum == 16.5);
|
|
412
|
+
|
|
413
|
+
row1.values().clear();
|
|
414
|
+
|
|
415
|
+
doc.save();
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
SECTION("XLRowData (deque<std::string>)") {
|
|
419
|
+
XLDocument doc;
|
|
420
|
+
doc.create("./testXLRow.xlsx");
|
|
421
|
+
auto wks = doc.workbook().worksheet("Sheet1");
|
|
422
|
+
|
|
423
|
+
auto val1 = std::deque<std::string> {"This", "is", "a", "test."};
|
|
424
|
+
auto row1 = wks.row(1);
|
|
425
|
+
row1.values() = val1;
|
|
426
|
+
|
|
427
|
+
const auto row1c = row1;
|
|
428
|
+
|
|
429
|
+
auto val1sum = 0;
|
|
430
|
+
const auto val1results1 = static_cast<std::deque<std::string>>(row1c.values());
|
|
431
|
+
for (const auto v : val1results1) val1sum += v.size();
|
|
432
|
+
REQUIRE(val1sum == 12);
|
|
433
|
+
|
|
434
|
+
val1sum = 0;
|
|
435
|
+
const auto val1results2 = static_cast<std::deque<XLCellValue>>(row1c.values());
|
|
436
|
+
for (const auto v : val1results2) val1sum += v.get<std::string>().size();
|
|
437
|
+
REQUIRE(val1sum == 12);
|
|
438
|
+
|
|
439
|
+
row1.values().clear();
|
|
440
|
+
|
|
441
|
+
doc.save();
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
SECTION("XLRowData (deque<XLCellValue>)") {
|
|
445
|
+
XLDocument doc;
|
|
446
|
+
doc.create("./testXLRow.xlsx");
|
|
447
|
+
auto wks = doc.workbook().worksheet("Sheet1");
|
|
448
|
+
|
|
449
|
+
auto val1 = std::deque<XLCellValue> {1, 2, 3, 4, 5};
|
|
450
|
+
auto row1 = wks.row(1);
|
|
451
|
+
row1.values() = val1;
|
|
452
|
+
|
|
453
|
+
const auto row1c = row1;
|
|
454
|
+
|
|
455
|
+
auto val1sum = 0;
|
|
456
|
+
const auto val1results1 = static_cast<std::deque<int>>(row1c.values());
|
|
457
|
+
for (const auto v : val1results1) val1sum += v;
|
|
458
|
+
REQUIRE(val1sum == 15);
|
|
459
|
+
|
|
460
|
+
val1sum = 0;
|
|
461
|
+
const auto val1results2 = static_cast<std::deque<XLCellValue>>(row1c.values());
|
|
462
|
+
for (const auto v : val1results2) val1sum += v.get<int>();
|
|
463
|
+
REQUIRE(val1sum == 15);
|
|
464
|
+
|
|
465
|
+
row1.values().clear();
|
|
466
|
+
|
|
467
|
+
doc.save();
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
TEST_CASE("XLRowDataRange Tests", "[XLRowDataRange]")
|
|
472
|
+
{
|
|
473
|
+
SECTION("XLRowDataRange") {
|
|
474
|
+
|
|
475
|
+
XLDocument doc;
|
|
476
|
+
doc.create("./testXLRow.xlsx");
|
|
477
|
+
auto wks = doc.workbook().worksheet("Sheet1");
|
|
478
|
+
|
|
479
|
+
auto row = wks.row(1);
|
|
480
|
+
auto range = row.cells();
|
|
481
|
+
for (auto& cell : range) cell.value() = 1;
|
|
482
|
+
|
|
483
|
+
auto sum = 0;
|
|
484
|
+
for (const auto& cell : range) sum += cell.value().get<int>();
|
|
485
|
+
REQUIRE(sum == 1);
|
|
486
|
+
REQUIRE(range.size() == 1);
|
|
487
|
+
|
|
488
|
+
auto range_copy = range;
|
|
489
|
+
sum = 0;
|
|
490
|
+
for (const auto& cell : range_copy) sum += cell.value().get<int>();
|
|
491
|
+
REQUIRE(sum == 1);
|
|
492
|
+
REQUIRE(range_copy.size() == 1);
|
|
493
|
+
|
|
494
|
+
auto range_move = std::move(range_copy);
|
|
495
|
+
sum = 0;
|
|
496
|
+
for (const auto& cell : range_move) sum += cell.value().get<int>();
|
|
497
|
+
REQUIRE(sum == 1);
|
|
498
|
+
REQUIRE(range_move.size() == 1);
|
|
499
|
+
|
|
500
|
+
auto range_copy2 = range_move;
|
|
501
|
+
range_copy2 = range;
|
|
502
|
+
sum = 0;
|
|
503
|
+
for (const auto& cell : range_copy2) sum += cell.value().get<int>();
|
|
504
|
+
REQUIRE(sum == 1);
|
|
505
|
+
REQUIRE(range_copy2.size() == 1);
|
|
506
|
+
|
|
507
|
+
auto range_move2 = range_move;
|
|
508
|
+
range_move2 = std::move(range_copy2);
|
|
509
|
+
sum = 0;
|
|
510
|
+
for (const auto& cell : range_move2) sum += cell.value().get<int>();
|
|
511
|
+
REQUIRE(sum == 1);
|
|
512
|
+
REQUIRE(range_move2.size() == 1);
|
|
513
|
+
|
|
514
|
+
auto row2 = wks.row(2);
|
|
515
|
+
auto range2 = row2.cells(8);
|
|
516
|
+
for (auto& cell : range2) cell.value() = 1;
|
|
517
|
+
|
|
518
|
+
sum = 0;
|
|
519
|
+
for (const auto& cell : row2.cells()) sum += cell.value().get<int>();
|
|
520
|
+
REQUIRE(sum == 8);
|
|
521
|
+
REQUIRE(range2.size() == 8);
|
|
522
|
+
|
|
523
|
+
auto row3 = wks.row(3);
|
|
524
|
+
auto range3 = row3.cells(3, 8);
|
|
525
|
+
for (auto& cell : range3) cell.value() = 1;
|
|
526
|
+
|
|
527
|
+
sum = 0;
|
|
528
|
+
for (const auto& cell : row3.cells())
|
|
529
|
+
if (cell.value().type() == XLValueType::Integer) sum += cell.value().get<int>();
|
|
530
|
+
REQUIRE(sum == 6);
|
|
531
|
+
REQUIRE(row3.cells().size() == 8);
|
|
532
|
+
|
|
533
|
+
doc.save();
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
SECTION("XLRowDataIterator") {
|
|
537
|
+
|
|
538
|
+
XLDocument doc;
|
|
539
|
+
doc.create("./testXLRow.xlsx");
|
|
540
|
+
auto wks = doc.workbook().worksheet("Sheet1");
|
|
541
|
+
|
|
542
|
+
auto row = wks.row(1);
|
|
543
|
+
auto range = row.cells(2);
|
|
544
|
+
for (auto& cell : range) cell.value() = 1;
|
|
545
|
+
auto begin = range.begin();
|
|
546
|
+
auto end = range.end();
|
|
547
|
+
auto other = begin;
|
|
548
|
+
|
|
549
|
+
REQUIRE(begin == other);
|
|
550
|
+
REQUIRE_FALSE(begin == end);
|
|
551
|
+
REQUIRE(begin != end);
|
|
552
|
+
REQUIRE_FALSE(begin != other);
|
|
553
|
+
|
|
554
|
+
++other;
|
|
555
|
+
REQUIRE_FALSE(begin == other);
|
|
556
|
+
|
|
557
|
+
++other;
|
|
558
|
+
REQUIRE(other == end);
|
|
559
|
+
|
|
560
|
+
other = begin;
|
|
561
|
+
REQUIRE(begin == other);
|
|
562
|
+
|
|
563
|
+
other++;
|
|
564
|
+
other = std::move(begin);
|
|
565
|
+
begin = range.begin();
|
|
566
|
+
REQUIRE(begin == other);
|
|
567
|
+
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
TEST_CASE("XLRowIterator Tests", "[XLRowDataRange]")
|
|
573
|
+
{
|
|
574
|
+
SECTION("XLRowIterator") {
|
|
575
|
+
|
|
576
|
+
XLDocument doc;
|
|
577
|
+
doc.create("./testXLRow.xlsx");
|
|
578
|
+
auto wks = doc.workbook().worksheet("Sheet1");
|
|
579
|
+
|
|
580
|
+
auto range = wks.rows(1,3);
|
|
581
|
+
auto first = range.begin();
|
|
582
|
+
auto second = first;
|
|
583
|
+
second++;
|
|
584
|
+
auto third = range.end();
|
|
585
|
+
auto fourth = std::move(third);
|
|
586
|
+
third = second;
|
|
587
|
+
second = std::move(first);
|
|
588
|
+
first = range.begin();
|
|
589
|
+
|
|
590
|
+
REQUIRE(second == range.begin());
|
|
591
|
+
REQUIRE_FALSE(second == third);
|
|
592
|
+
REQUIRE_FALSE(second == fourth);
|
|
593
|
+
REQUIRE(range.rowCount() == 3);
|
|
594
|
+
REQUIRE(first->rowNumber() == 1);
|
|
595
|
+
|
|
596
|
+
}
|
|
597
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Created by Kenneth Balslev on 27/08/2021.
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
#include <OpenXLSX.hpp>
|
|
6
|
+
#include <catch.hpp>
|
|
7
|
+
|
|
8
|
+
using namespace OpenXLSX;
|
|
9
|
+
|
|
10
|
+
TEST_CASE("XLSheet Tests", "[XLSheet]")
|
|
11
|
+
{
|
|
12
|
+
SECTION("XLSheet Visibility") {
|
|
13
|
+
|
|
14
|
+
XLDocument doc;
|
|
15
|
+
doc.create("./testXLSheet1.xlsx");
|
|
16
|
+
|
|
17
|
+
auto wks1 = doc.workbook().sheet(1);
|
|
18
|
+
wks1.setName("VeryHidden");
|
|
19
|
+
REQUIRE(wks1.name() == "VeryHidden");
|
|
20
|
+
|
|
21
|
+
doc.workbook().addWorksheet("Hidden");
|
|
22
|
+
auto wks2 = doc.workbook().sheet("Hidden");
|
|
23
|
+
REQUIRE(wks2.name() == "Hidden");
|
|
24
|
+
|
|
25
|
+
doc.workbook().addWorksheet("Visible");
|
|
26
|
+
auto wks3 = doc.workbook().sheet("Visible");
|
|
27
|
+
REQUIRE(wks3.name() == "Visible");
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
REQUIRE(wks1.visibility() == XLSheetState::Visible);
|
|
31
|
+
REQUIRE(wks2.visibility() == XLSheetState::Visible);
|
|
32
|
+
REQUIRE(wks3.visibility() == XLSheetState::Visible);
|
|
33
|
+
|
|
34
|
+
wks1.setVisibility(XLSheetState::VeryHidden);
|
|
35
|
+
REQUIRE(wks1.visibility() == XLSheetState::VeryHidden);
|
|
36
|
+
|
|
37
|
+
wks2.setVisibility(XLSheetState::Hidden);
|
|
38
|
+
REQUIRE(wks2.visibility() == XLSheetState::Hidden);
|
|
39
|
+
|
|
40
|
+
REQUIRE_THROWS(wks3.setVisibility(XLSheetState::Hidden));
|
|
41
|
+
wks3.setVisibility(XLSheetState::Visible);
|
|
42
|
+
|
|
43
|
+
doc.save();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
SECTION("XLSheet Tab Color") {
|
|
47
|
+
|
|
48
|
+
XLDocument doc;
|
|
49
|
+
doc.create("./testXLSheet2.xlsx");
|
|
50
|
+
|
|
51
|
+
auto wks1 = doc.workbook().sheet(1);
|
|
52
|
+
wks1.setName("Sheet1");
|
|
53
|
+
REQUIRE(wks1.name() == "Sheet1");
|
|
54
|
+
|
|
55
|
+
doc.workbook().addWorksheet("Sheet2");
|
|
56
|
+
auto wks2 = doc.workbook().sheet("Sheet2");
|
|
57
|
+
REQUIRE(wks2.name() == "Sheet2");
|
|
58
|
+
|
|
59
|
+
doc.workbook().addWorksheet("Sheet3");
|
|
60
|
+
auto wks3 = doc.workbook().sheet("Sheet3");
|
|
61
|
+
REQUIRE(wks3.name() == "Sheet3");
|
|
62
|
+
|
|
63
|
+
wks1.setColor(XLColor(255, 0, 0));
|
|
64
|
+
REQUIRE(wks1.color() == XLColor(255, 0, 0));
|
|
65
|
+
REQUIRE_FALSE(wks1.color() == XLColor(0, 0, 0));
|
|
66
|
+
|
|
67
|
+
wks2.setColor(XLColor(0, 255, 0));
|
|
68
|
+
REQUIRE(wks2.color() == XLColor(0, 255, 0));
|
|
69
|
+
REQUIRE_FALSE(wks2.color() == XLColor(0, 0, 0));
|
|
70
|
+
|
|
71
|
+
wks3.setColor(XLColor(0, 0, 255));
|
|
72
|
+
REQUIRE(wks3.color() == XLColor(0, 0, 255));
|
|
73
|
+
REQUIRE_FALSE(wks3.color() == XLColor(0, 0, 0));
|
|
74
|
+
|
|
75
|
+
doc.save();
|
|
76
|
+
}
|
|
77
|
+
}
|