mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
serialisation of custom row format property added
This commit is contained in:
parent
fe90c9d488
commit
3eb06bac0d
|
@ -54,6 +54,11 @@ public:
|
||||||
/// </summary>
|
/// </summary>
|
||||||
bool hidden = false;
|
bool hidden = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// True if row style should be applied
|
||||||
|
/// </summary>
|
||||||
|
optional<bool> custom_format;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The index to the style used by all cells in this row
|
/// The index to the style used by all cells in this row
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -659,7 +659,16 @@ void xlsx_consumer::read_worksheet_sheetdata()
|
||||||
row_properties.dy_descent = parser().attribute<double>(qn("x14ac", "dyDescent"));
|
row_properties.dy_descent = parser().attribute<double>(qn("x14ac", "dyDescent"));
|
||||||
}
|
}
|
||||||
|
|
||||||
skip_attributes({ "customFormat", "s", "customFont",
|
if (parser().attribute_present("s"))
|
||||||
|
{
|
||||||
|
row_properties.style.set(static_cast<std::size_t>(std::stoull(parser().attribute("s"))));
|
||||||
|
}
|
||||||
|
if (parser().attribute_present("customFormat"))
|
||||||
|
{
|
||||||
|
row_properties.custom_format.set(parser().attribute<bool>("customFormat"));
|
||||||
|
}
|
||||||
|
|
||||||
|
skip_attributes({ "customFont",
|
||||||
"outlineLevel", "collapsed", "thickTop", "thickBot",
|
"outlineLevel", "collapsed", "thickTop", "thickBot",
|
||||||
"ph", "spans" });
|
"ph", "spans" });
|
||||||
|
|
||||||
|
|
|
@ -2362,11 +2362,6 @@ void xlsx_producer::write_worksheet(const relationship &rel)
|
||||||
write_attribute("width", (props.width.get() * 7 + 5) / 7);
|
write_attribute("width", (props.width.get() * 7 + 5) / 7);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (props.custom_width)
|
|
||||||
{
|
|
||||||
write_attribute("customWidth", write_bool(true));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (props.style.is_set())
|
if (props.style.is_set())
|
||||||
{
|
{
|
||||||
write_attribute("style", props.style.get());
|
write_attribute("style", props.style.get());
|
||||||
|
@ -2377,6 +2372,11 @@ void xlsx_producer::write_worksheet(const relationship &rel)
|
||||||
write_attribute("hidden", write_bool(true));
|
write_attribute("hidden", write_bool(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (props.custom_width)
|
||||||
|
{
|
||||||
|
write_attribute("customWidth", write_bool(true));
|
||||||
|
}
|
||||||
|
|
||||||
write_end_element(xmlns, "col");
|
write_end_element(xmlns, "col");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2440,6 +2440,15 @@ void xlsx_producer::write_worksheet(const relationship &rel)
|
||||||
{
|
{
|
||||||
const auto &props = ws.row_properties(row);
|
const auto &props = ws.row_properties(row);
|
||||||
|
|
||||||
|
if (props.style.is_set())
|
||||||
|
{
|
||||||
|
write_attribute("s", props.style.get());
|
||||||
|
}
|
||||||
|
if (props.custom_format.is_set())
|
||||||
|
{
|
||||||
|
write_attribute("customFormat", write_bool(props.custom_format.get()));
|
||||||
|
}
|
||||||
|
|
||||||
if (props.height.is_set())
|
if (props.height.is_set())
|
||||||
{
|
{
|
||||||
auto height = props.height.get();
|
auto height = props.height.get();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user