Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ImportedProjects
SVG
Commits
e95bbca0
"vscode:/vscode.git/clone" did not exist on "535abaf897eda5b73cc64e607f2ffabf4bb10d10"
Commit
e95bbca0
authored
Feb 26, 2014
by
Tibor Peluch
Browse files
fixed loading of documents with unknown elements
parent
697d0bbe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Source/SvgDocument.cs
View file @
e95bbca0
...
...
@@ -215,16 +215,12 @@ namespace Svg
element
=
svgDocument
;
}
if
(
element
==
null
)
{
continue
;
}
// Add to the parents children
if
(
elementStack
.
Count
>
0
)
{
parent
=
elementStack
.
Peek
();
parent
.
Children
.
Add
(
element
);
if
(
parent
!=
null
&&
element
!=
null
)
parent
.
Children
.
Add
(
element
);
}
// Push element into stack
...
...
@@ -236,11 +232,17 @@ namespace Svg
goto
case
XmlNodeType
.
EndElement
;
}
if
(
element
==
null
)
{
continue
;
}
break
;
case
XmlNodeType
.
EndElement
:
// Skip if no element was created and is not the closing tag for the last
// known element
if
(
element
==
null
&&
reader
.
LocalName
!=
elementStack
.
Peek
().
ElementName
)
SvgElement
topElement
=
elementStack
.
Peek
();
if
(
element
==
null
&&
(
topElement
!=
null
&&
reader
.
LocalName
!=
topElement
.
ElementName
))
{
continue
;
}
...
...
@@ -249,7 +251,8 @@ namespace Svg
if
(
value
.
Length
>
0
)
{
element
.
Content
=
value
.
ToString
();
if
(
element
!=
null
)
element
.
Content
=
value
.
ToString
();
// Reset content value for new element
value
=
new
StringBuilder
();
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment