fix:copy_sheet index>sheetcount error

This commit is contained in:
mensong 2023-11-03 10:35:19 +08:00
parent 508c9c43dc
commit 22e1868ab5

View File

@ -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)