From 3176749613e09a50e178798414478073f400c611 Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Tue, 30 Apr 2024 10:04:57 +0100 Subject: [PATCH] clang-format (pre-commit run --show-diff-on-failure --color=always --all-files) --- src/svg/svg_parser.cpp | 177 ++++++++++++++++++++--------------------- 1 file changed, 88 insertions(+), 89 deletions(-) diff --git a/src/svg/svg_parser.cpp b/src/svg/svg_parser.cpp index 853438fd3..1f08a7256 100644 --- a/src/svg/svg_parser.cpp +++ b/src/svg/svg_parser.cpp @@ -500,102 +500,102 @@ void traverse_tree(svg_parser& parser, rapidxml::xml_node const* node) switch (node->type()) { - case rapidxml::node_element: - parser.font_sizes_.push_back(parser.font_sizes_.back()); - switch (name) - { - case "defs"_case: { - if (node->first_node() != nullptr) + case rapidxml::node_element: + parser.font_sizes_.push_back(parser.font_sizes_.back()); + switch (name) { - parser.is_defs_ = true; - } - break; - } - case "clipPath"_case: - case "symbol"_case: - case "pattern"_case: { - parser.ignore_ = true; - break; - } - // the gradient tags *should* be in defs, but illustrator seems not to put them in there so - // accept them anywhere - case "linearGradient"_case: - parse_linear_gradient(parser, node); - break; - case "radialGradient"_case: - parse_radial_gradient(parser, node); - break; - case "g"_case: - parser.path_.push_attr(); - parse_id(parser, node); - if (parser.css_style_) - process_css(parser, node); - parse_attr(parser, node); - parser.path_.begin_group(); - break; - case "use"_case: - parser.path_.push_attr(); - parse_id(parser, node); - if (parser.css_style_) - process_css(parser, node); - parse_attr(parser, node); - if (parser.path_.cur_attr().opacity < 1.0) - parser.path_.begin_group(); - parse_use(parser, node); - if (parser.path_.cur_attr().opacity < 1.0) - parser.path_.end_group(); - parser.path_.pop_attr(); - break; - default: - parser.path_.push_attr(); - parse_id(parser, node); - if (parser.css_style_) - process_css(parser, node); - parse_attr(parser, node); - if (parser.path_.display()) - { - if (parser.path_.cur_attr().opacity < 1.0) - parser.path_.begin_group(); - parse_element(parser, node->name(), node); - if (parser.path_.cur_attr().opacity < 1.0) - parser.path_.end_group(); - } - parser.path_.pop_attr(); - break; - } - - if ("style"_case == name) - { - //