worksheet: Add method to check if the worksheet is empty

A worksheet is considered empty if it doesn't have any cells.
pull/529/head
Emmanuel Pescosta 2020-04-15 11:28:36 +02:00
parent 3c7122a78c
commit 9df7c83ca6
No known key found for this signature in database
GPG Key ID: 67C7A6C81D838246
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