Merge pull request #529 from emmanuel099/worksheet_empty

worksheet: Add method to check if the worksheet is empty
This commit is contained in:
Thomas Fussell 2021-01-02 15:07:29 -05:00 committed by GitHub
commit bf90210d26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -770,6 +770,12 @@ public:
/// </summary>
bool has_drawing() const;
/// <summary>
/// Returns true if this worksheet is empty.
/// A worksheet is considered empty if it doesn't have any cells.
/// </summary>
bool is_empty() const;
private:
friend class cell;
friend class const_range_iterator;

View File

@ -1335,4 +1335,9 @@ bool worksheet::has_drawing() const
return d_->drawing_.is_set();
}
bool worksheet::is_empty() const
{
return d_->cell_map_.empty();
}
} // namespace xlnt