mirror of https://github.com/tfussell/xlnt
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
parent
3c7122a78c
commit
9df7c83ca6
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue