mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
Merge pull request #240 from shamanas/master
Setting the height of a row now produces the expected result.
This commit is contained in:
commit
5b8820d2cd
|
@ -2175,8 +2175,14 @@ void xlsx_producer::write_worksheet(const relationship &rel)
|
||||||
|
|
||||||
write_start_element(xmlns, "sheetData");
|
write_start_element(xmlns, "sheetData");
|
||||||
|
|
||||||
for (auto row : ws.rows())
|
for (auto row : ws.rows(false))
|
||||||
{
|
{
|
||||||
|
auto row_index = row.front().row();
|
||||||
|
|
||||||
|
write_start_element(xmlns, "row");
|
||||||
|
|
||||||
|
write_attribute("r", row_index);
|
||||||
|
|
||||||
auto min = static_cast<xlnt::row_t>(row.length());
|
auto min = static_cast<xlnt::row_t>(row.length());
|
||||||
xlnt::row_t max = 0;
|
xlnt::row_t max = 0;
|
||||||
bool any_non_null = false;
|
bool any_non_null = false;
|
||||||
|
@ -2192,21 +2198,16 @@ void xlsx_producer::write_worksheet(const relationship &rel)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!any_non_null)
|
if (any_non_null)
|
||||||
{
|
{
|
||||||
continue;
|
write_attribute("spans", std::to_string(min) + ":" + std::to_string(max));
|
||||||
}
|
}
|
||||||
|
|
||||||
write_start_element(xmlns, "row");
|
if (ws.has_row_properties(row_index))
|
||||||
|
|
||||||
write_attribute("r", row.front().row());
|
|
||||||
write_attribute("spans", std::to_string(min) + ":" + std::to_string(max));
|
|
||||||
|
|
||||||
if (ws.has_row_properties(row.front().row()))
|
|
||||||
{
|
{
|
||||||
const auto &props = ws.row_properties(row.front().row());
|
const auto &props = ws.row_properties(row_index);
|
||||||
|
|
||||||
if (props.custom_height)
|
if (props.custom_height || props.height.is_set())
|
||||||
{
|
{
|
||||||
write_attribute("customHeight", write_bool(true));
|
write_attribute("customHeight", write_bool(true));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user