diff --git a/source/reader/style_reader.cpp b/source/reader/style_reader.cpp index 0ca43afd..a74973b7 100644 --- a/source/reader/style_reader.cpp +++ b/source/reader/style_reader.cpp @@ -396,22 +396,22 @@ void style_reader::read_borders(pugi::xml_node borders_node) { border new_border; - const std::vector> sides = + const std::vector> sides = { - {"start", new_border.start, new_border.start_assigned}, - {"end", new_border.end, new_border.end_assigned}, - {"left", new_border.left, new_border.left_assigned}, - {"right", new_border.right, new_border.right_assigned}, - {"top", new_border.top, new_border.top_assigned}, - {"bottom", new_border.bottom, new_border.bottom_assigned}, - {"diagonal", new_border.diagonal, new_border.diagonal_assigned}, - {"vertical", new_border.vertical, new_border.vertical_assigned}, - {"horizontal", new_border.horizontal, new_border.horizontal_assigned} + {"start", &new_border.start, &new_border.start_assigned}, + {"end", &new_border.end, &new_border.end_assigned}, + {"left", &new_border.left, &new_border.left_assigned}, + {"right", &new_border.right, &new_border.right_assigned}, + {"top", &new_border.top, &new_border.top_assigned}, + {"bottom", &new_border.bottom, &new_border.bottom_assigned}, + {"diagonal", &new_border.diagonal, &new_border.diagonal_assigned}, + {"vertical", &new_border.vertical, &new_border.vertical_assigned}, + {"horizontal", &new_border.horizontal, &new_border.horizontal_assigned} }; 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); diff --git a/source/writer/style_writer.cpp b/source/writer/style_writer.cpp index 15e51671..e0acb584 100644 --- a/source/writer/style_writer.cpp +++ b/source/writer/style_writer.cpp @@ -166,7 +166,7 @@ std::string style_writer::write_table() const { auto border_node = borders_node.append_child("border"); - const std::vector> sides = + const std::vector> sides = { {"start", border_.start, border_.start_assigned}, {"end", border_.end, border_.end_assigned}, @@ -182,7 +182,7 @@ std::string style_writer::write_table() const for(const auto &side_tuple : sides) { 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); if(assigned)