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
a6baed2f
Commit
a6baed2f
authored
Dec 05, 2013
by
Tebjan Halm
Browse files
don't add subtree of a document to parent document and small performance improvement
parent
3e051754
Changes
2
Show whitespace changes
Inline
Side-by-side
Source/SvgElementCollection.cs
View file @
a6baed2f
...
@@ -84,11 +84,15 @@ namespace Svg
...
@@ -84,11 +84,15 @@ namespace Svg
if
(
this
.
_owner
.
OwnerDocument
!=
null
)
if
(
this
.
_owner
.
OwnerDocument
!=
null
)
{
{
this
.
_owner
.
OwnerDocument
.
IdManager
.
AddAndFixID
(
item
,
autoFixID
,
logElementOldIDNewID
);
this
.
_owner
.
OwnerDocument
.
IdManager
.
AddAndFixID
(
item
,
autoFixID
,
logElementOldIDNewID
);
if
(!(
item
is
SvgDocument
))
//don't add subtree of a document to parent document
{
foreach
(
var
child
in
item
.
Children
)
foreach
(
var
child
in
item
.
Children
)
{
{
child
.
ApplyRecursive
(
e
=>
this
.
_owner
.
OwnerDocument
.
IdManager
.
AddAndFixID
(
e
,
autoFixChildrenID
,
logElementOldIDNewID
));
child
.
ApplyRecursive
(
e
=>
this
.
_owner
.
OwnerDocument
.
IdManager
.
AddAndFixID
(
e
,
autoFixChildrenID
,
logElementOldIDNewID
));
}
}
}
}
}
item
.
_parent
=
this
.
_owner
;
item
.
_parent
=
this
.
_owner
;
}
}
...
...
Source/SvgExtentions.cs
View file @
a6baed2f
...
@@ -57,11 +57,13 @@ namespace Svg
...
@@ -57,11 +57,13 @@ namespace Svg
{
{
action
(
elem
);
action
(
elem
);
if
(!(
elem
is
SvgDocument
))
//don't apply action to subtree of documents
{
foreach
(
var
element
in
elem
.
Children
)
foreach
(
var
element
in
elem
.
Children
)
{
{
if
(!(
elem
is
SvgDocument
))
element
.
ApplyRecursive
(
action
);
element
.
ApplyRecursive
(
action
);
}
}
}
}
}
}
}
}
}
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