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
2bfed054
Commit
2bfed054
authored
11 years ago
by
Tebjan Halm
Browse files
Options
Download
Email Patches
Plain Diff
don't add subtree of a document to parent document and small performance improvement
parent
cf4a475b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Source/SvgElementCollection.cs
+12
-8
Source/SvgElementCollection.cs
Source/SvgExtentions.cs
+4
-2
Source/SvgExtentions.cs
with
16 additions
and
10 deletions
+16
-10
Source/SvgElementCollection.cs
+
12
-
8
View file @
2bfed054
...
...
@@ -81,14 +81,18 @@ namespace Svg
{
if
(!
this
.
_mock
)
{
if
(
this
.
_owner
.
OwnerDocument
!=
null
)
{
this
.
_owner
.
OwnerDocument
.
IdManager
.
AddAndFixID
(
item
,
autoFixID
,
logElementOldIDNewID
);
foreach
(
var
child
in
item
.
Children
)
{
child
.
ApplyRecursive
(
e
=>
this
.
_owner
.
OwnerDocument
.
IdManager
.
AddAndFixID
(
e
,
autoFixChildrenID
,
logElementOldIDNewID
));
}
}
if
(
this
.
_owner
.
OwnerDocument
!=
null
)
{
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
)
{
child
.
ApplyRecursive
(
e
=>
this
.
_owner
.
OwnerDocument
.
IdManager
.
AddAndFixID
(
e
,
autoFixChildrenID
,
logElementOldIDNewID
));
}
}
}
item
.
_parent
=
this
.
_owner
;
}
...
...
This diff is collapsed.
Click to expand it.
Source/SvgExtentions.cs
+
4
-
2
View file @
2bfed054
...
...
@@ -57,10 +57,12 @@ namespace Svg
{
action
(
elem
);
foreach
(
var
element
in
elem
.
Children
)
if
(!(
elem
is
SvgDocument
))
//don't apply action to subtree of documents
{
if
(!(
elem
is
SvgDocument
))
foreach
(
var
element
in
elem
.
Children
)
{
element
.
ApplyRecursive
(
action
);
}
}
}
}
...
...
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