Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions source/workbook/workbook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,9 @@ worksheet workbook::copy_sheet(worksheet to_copy)

worksheet workbook::copy_sheet(worksheet to_copy, std::size_t index)
{
if (index > d_->worksheets_.size())
throw invalid_parameter();

copy_sheet(to_copy);

if (index != d_->worksheets_.size() - 1)
Expand Down Expand Up @@ -1091,6 +1094,11 @@ void workbook::remove_sheet(worksheet ws)

worksheet workbook::create_sheet(std::size_t index)
{
if (index > d_->worksheets_.size())
{
throw invalid_parameter();
}

create_sheet();

if (index != d_->worksheets_.size() - 1)
Expand Down