mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
fix shared string enumeration for #72
This commit is contained in:
parent
5479e572a4
commit
b83cf64287
|
@ -633,13 +633,18 @@ void xlsx_producer::write_shared_string_table(const relationship &rel)
|
|||
|
||||
for (const auto ws : source_)
|
||||
{
|
||||
for (const auto row : ws.rows())
|
||||
auto dimension = ws.calculate_dimension();
|
||||
|
||||
for (xlnt::row_t row = dimension.get_top_left().get_row();
|
||||
row <= dimension.get_bottom_right().get_row(); ++row)
|
||||
{
|
||||
for (const auto cell : row)
|
||||
for (xlnt::column_t column = dimension.get_top_left().get_column();
|
||||
column <= dimension.get_bottom_right().get_column(); ++column)
|
||||
{
|
||||
if (cell.get_data_type() == cell::type::string)
|
||||
if (ws.has_cell(xlnt::cell_reference(column, row)))
|
||||
{
|
||||
++string_count;
|
||||
string_count += (ws.get_cell(xlnt::cell_reference(column, row))
|
||||
.get_data_type() == cell::type::string) ? 1 : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user