mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
references aren't assignable, switch them to pointers
This commit is contained in:
parent
db1493ccd3
commit
b108794579
|
@ -396,22 +396,22 @@ void style_reader::read_borders(pugi::xml_node borders_node)
|
||||||
{
|
{
|
||||||
border new_border;
|
border new_border;
|
||||||
|
|
||||||
const std::vector<std::tuple<std::string, side &, bool &>> sides =
|
const std::vector<std::tuple<std::string, side *, bool *>> sides =
|
||||||
{
|
{
|
||||||
{"start", new_border.start, new_border.start_assigned},
|
{"start", &new_border.start, &new_border.start_assigned},
|
||||||
{"end", new_border.end, new_border.end_assigned},
|
{"end", &new_border.end, &new_border.end_assigned},
|
||||||
{"left", new_border.left, new_border.left_assigned},
|
{"left", &new_border.left, &new_border.left_assigned},
|
||||||
{"right", new_border.right, new_border.right_assigned},
|
{"right", &new_border.right, &new_border.right_assigned},
|
||||||
{"top", new_border.top, new_border.top_assigned},
|
{"top", &new_border.top, &new_border.top_assigned},
|
||||||
{"bottom", new_border.bottom, new_border.bottom_assigned},
|
{"bottom", &new_border.bottom, &new_border.bottom_assigned},
|
||||||
{"diagonal", new_border.diagonal, new_border.diagonal_assigned},
|
{"diagonal", &new_border.diagonal, &new_border.diagonal_assigned},
|
||||||
{"vertical", new_border.vertical, new_border.vertical_assigned},
|
{"vertical", &new_border.vertical, &new_border.vertical_assigned},
|
||||||
{"horizontal", new_border.horizontal, new_border.horizontal_assigned}
|
{"horizontal", &new_border.horizontal, &new_border.horizontal_assigned}
|
||||||
};
|
};
|
||||||
|
|
||||||
for(const auto &side : sides)
|
for(const auto &side : sides)
|
||||||
{
|
{
|
||||||
read_side(border_node.child(std::get<0>(side).c_str()), std::get<1>(side), std::get<2>(side));
|
read_side(border_node.child(std::get<0>(side).c_str()), *std::get<1>(side), *std::get<2>(side));
|
||||||
}
|
}
|
||||||
|
|
||||||
borders_.push_back(new_border);
|
borders_.push_back(new_border);
|
||||||
|
|
|
@ -166,7 +166,7 @@ std::string style_writer::write_table() const
|
||||||
{
|
{
|
||||||
auto border_node = borders_node.append_child("border");
|
auto border_node = borders_node.append_child("border");
|
||||||
|
|
||||||
const std::vector<std::tuple<std::string, const side &, bool>> sides =
|
const std::vector<std::tuple<std::string, const side, bool>> sides =
|
||||||
{
|
{
|
||||||
{"start", border_.start, border_.start_assigned},
|
{"start", border_.start, border_.start_assigned},
|
||||||
{"end", border_.end, border_.end_assigned},
|
{"end", border_.end, border_.end_assigned},
|
||||||
|
@ -182,7 +182,7 @@ std::string style_writer::write_table() const
|
||||||
for(const auto &side_tuple : sides)
|
for(const auto &side_tuple : sides)
|
||||||
{
|
{
|
||||||
std::string name = std::get<0>(side_tuple);
|
std::string name = std::get<0>(side_tuple);
|
||||||
const side &side_ = std::get<1>(side_tuple);
|
const side side_ = std::get<1>(side_tuple);
|
||||||
bool assigned = std::get<2>(side_tuple);
|
bool assigned = std::get<2>(side_tuple);
|
||||||
|
|
||||||
if(assigned)
|
if(assigned)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user