mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
Sharedstringtable
Same strings in shared stringtable makes it not possible to open a xlsx file.
This commit is contained in:
parent
f30260153f
commit
49663bc483
|
@ -1374,9 +1374,18 @@ std::size_t workbook::add_shared_string(const rich_text &shared, bool allow_dupl
|
|||
}
|
||||
}
|
||||
|
||||
auto sz = d_->shared_strings_ids_.size();
|
||||
d_->shared_strings_ids_[shared] = sz;
|
||||
//it can happen that similar strings are more then onetime in the shared stringtable (Excel bugfix?)
|
||||
//shared_strings_values map should start on position 0
|
||||
auto sz = d_->shared_strings_values_.size();
|
||||
if (d_->shared_strings_values_.count(sz) > 0)
|
||||
{
|
||||
// something went wrong!
|
||||
throw invalid_file("Error in shared string table!");
|
||||
}
|
||||
|
||||
d_->shared_strings_values_[sz] = shared;
|
||||
d_->shared_strings_ids_[shared] = sz;
|
||||
|
||||
|
||||
return sz;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user