@@ -29,14 +29,15 @@ void parse_any_element_children(ElementRegistry ®istry,
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 ®istry, const ParseContext &context,
5657}
5758
5859void parse_root_children (ElementRegistry ®istry, 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 ®istry, const ParseContext &context,
7576
7677void parse_sheet_cell_children (ElementRegistry ®istry,
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 ®istry,
9192
9293void parse_frame_children (ElementRegistry ®istry,
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 ®istry, 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