From e92ca9bd71bb99441545c664a2312d269ef17db9 Mon Sep 17 00:00:00 2001 From: Vitaly Pavlov Date: Mon, 26 Feb 2024 18:50:52 +0300 Subject: [PATCH] Fixed 3nd block of errors --- include/xlnt/worksheet/cell_vector.hpp | 5 +++++ source/utils/time.cpp | 1 + source/utils/timedelta.cpp | 1 + source/workbook/workbook.cpp | 2 ++ source/worksheet/cell_vector.cpp | 5 +++++ 5 files changed, 14 insertions(+) diff --git a/include/xlnt/worksheet/cell_vector.hpp b/include/xlnt/worksheet/cell_vector.hpp index 87bdf40a..694bfc27 100644 --- a/include/xlnt/worksheet/cell_vector.hpp +++ b/include/xlnt/worksheet/cell_vector.hpp @@ -176,6 +176,11 @@ public: /// const cell operator[](std::size_t column_index) const; + /// + /// Returns true if this sheet has an initialized cell at the given cell_index. + /// + bool has_cell(std::size_t cell_index) const; + private: /// /// The worksheet this vector points to cells from diff --git a/source/utils/time.cpp b/source/utils/time.cpp index 89ec8914..6d0f3220 100644 --- a/source/utils/time.cpp +++ b/source/utils/time.cpp @@ -22,6 +22,7 @@ // @author: see AUTHORS file #include #include +#include #include diff --git a/source/utils/timedelta.cpp b/source/utils/timedelta.cpp index a263e685..ef065efd 100644 --- a/source/utils/timedelta.cpp +++ b/source/utils/timedelta.cpp @@ -22,6 +22,7 @@ // @author: see AUTHORS file #include #include +#include #include diff --git a/source/workbook/workbook.cpp b/source/workbook/workbook.cpp index dce9d3bd..1f167960 100644 --- a/source/workbook/workbook.cpp +++ b/source/workbook/workbook.cpp @@ -28,6 +28,8 @@ #include #include +#include + #include #include #include diff --git a/source/worksheet/cell_vector.cpp b/source/worksheet/cell_vector.cpp index 0d6162cf..12dd843c 100644 --- a/source/worksheet/cell_vector.cpp +++ b/source/worksheet/cell_vector.cpp @@ -171,4 +171,9 @@ const cell cell_vector::operator[](std::size_t cell_index) const return ws_.cell(cursor_.make_offset(0, static_cast(cell_index))); } +bool cell_vector::has_cell(std::size_t cell_index) const +{ + return ws_.has_cell(cursor_.make_offset(0, static_cast(cell_index))); +} + } // namespace xlnt