mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
should fix issue #9
This commit is contained in:
parent
c03f7d28e4
commit
8dc7342137
|
@ -168,8 +168,15 @@ std::string writer::write_workbook(const workbook &wb)
|
||||||
{
|
{
|
||||||
if(relationship.get_type() == relationship::type::worksheet)
|
if(relationship.get_type() == relationship::type::worksheet)
|
||||||
{
|
{
|
||||||
std::string sheet_index_string = relationship.get_target_uri().substr(16);
|
std::string sheet_index_string = relationship.get_target_uri();
|
||||||
std::size_t sheet_index = std::stoi(sheet_index_string.substr(0, sheet_index_string.find('.'))) - 1;
|
sheet_index_string = sheet_index_string.substr(0, sheet_index_string.find('.'));
|
||||||
|
sheet_index_string = sheet_index_string.substr(sheet_index_string.find_last_of('/'));
|
||||||
|
auto iter = sheet_index_string.end();
|
||||||
|
iter--;
|
||||||
|
while (isdigit(*iter)) iter--;
|
||||||
|
auto first_digit = iter - sheet_index_string.begin();
|
||||||
|
sheet_index_string = sheet_index_string.substr(first_digit + 1);
|
||||||
|
std::size_t sheet_index = std::stoi(sheet_index_string) - 1;
|
||||||
|
|
||||||
auto ws = wb.get_sheet_by_index(sheet_index);
|
auto ws = wb.get_sheet_by_index(sheet_index);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user