Skip to content

Commit c78ebd7

Browse files
committed
fix build
1 parent 76d278a commit c78ebd7

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

src/odr/internal/ooxml/spreadsheet/ooxml_spreadsheet_parser.cpp

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,15 @@ void parse_any_element_children(ElementRegistry &registry,
2929
const ElementIdentifier parent_id,
3030
const pugi::xml_node node) {
3131
for (pugi::xml_node child_node = node.first_child(); child_node;) {
32-
if (const auto [child_id, next_sibling] =
33-
parse_any_element_tree(registry, context, child_node);
34-
child_id == null_element_id) {
32+
const auto [child_id, next_sibling] =
33+
parse_any_element_tree(registry, context, child_node);
34+
if (child_id == null_element_id) {
3535
child_node = child_node.next_sibling();
36-
} else {
37-
registry.append_child(parent_id, child_id);
38-
child_node = next_sibling;
36+
continue;
3937
}
38+
39+
registry.append_child(parent_id, child_id);
40+
child_node = next_sibling;
4041
}
4142
}
4243

@@ -56,7 +57,7 @@ parse_element_tree(ElementRegistry &registry, const ParseContext &context,
5657
}
5758

5859
void parse_root_children(ElementRegistry &registry, const ParseContext &context,
59-
ElementIdentifier parent_id,
60+
const ElementIdentifier parent_id,
6061
const pugi::xml_node node) {
6162
for (pugi::xml_node child_node : node.child("sheets").children("sheet")) {
6263
const char *id = child_node.attribute("r:id").value();
@@ -75,7 +76,7 @@ void parse_root_children(ElementRegistry &registry, const ParseContext &context,
7576

7677
void parse_sheet_cell_children(ElementRegistry &registry,
7778
const ParseContext &context,
78-
ElementIdentifier parent_id,
79+
const ElementIdentifier parent_id,
7980
const pugi::xml_node node) {
8081
if (const pugi::xml_attribute type_attr = node.attribute("t");
8182
type_attr.value() == std::string("s")) {
@@ -91,10 +92,14 @@ void parse_sheet_cell_children(ElementRegistry &registry,
9192

9293
void parse_frame_children(ElementRegistry &registry,
9394
const ParseContext &context,
94-
ElementIdentifier parent_id,
95+
const ElementIdentifier parent_id,
9596
const pugi::xml_node node) {
97+
(void)registry;
98+
(void)context;
99+
(void)parent_id;
96100
if (const pugi::xml_node image_node =
97101
node.child("xdr:pic").child("xdr:blipFill").child("a:blip")) {
102+
(void)image_node;
98103
// TODO
99104
// auto [image, _] = parse_any_element_tree(registry, context, image_node);
100105
// registry.append_child(parent_id, image);
@@ -153,9 +158,10 @@ parse_sheet_element(ElementRegistry &registry, const ParseContext &context,
153158
for (const pugi::xml_node shape_node :
154159
drawing_xml.document_element().children()) {
155160
auto [shape, _] = parse_any_element_tree(registry, context, shape_node);
156-
if (shape != null_element_id) {
157-
registry.append_shape(element_id, shape);
161+
if (shape == null_element_id) {
162+
continue;
158163
}
164+
registry.append_shape(element_id, shape);
159165
}
160166
}
161167

0 commit comments

Comments
 (0)