fix:create_sheet(index) index>sheetcount error

This commit is contained in:
mensong 2023-11-03 10:29:55 +08:00
parent 297b331435
commit 508c9c43dc

View File

@ -1091,6 +1091,11 @@ void workbook::remove_sheet(worksheet ws)
worksheet workbook::create_sheet(std::size_t index) worksheet workbook::create_sheet(std::size_t index)
{ {
if (index > d_->worksheets_.size())
{
throw invalid_parameter();
}
create_sheet(); create_sheet();
if (index != d_->worksheets_.size() - 1) if (index != d_->worksheets_.size() - 1)