Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
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
Commit
e95bbca0
authored
11 years ago
by
Tibor Peluch
Browse files
Options
Download
Email Patches
Plain Diff
fixed loading of documents with unknown elements
parent
697d0bbe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Source/SvgDocument.cs
+11
-8
Source/SvgDocument.cs
with
11 additions
and
8 deletions
+11
-8
Source/SvgDocument.cs
+
11
-
8
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
();
}
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help