diff options
| author | Ben Scholzen 'DASPRiD <mail@dasprids.de> | 2015-05-29 17:21:52 +0000 |
|---|---|---|
| committer | Ben Scholzen 'DASPRiD <mail@dasprids.de> | 2015-05-29 17:21:52 +0000 |
| commit | ea3737623c19fa92b97ec6c3e228ea0f8db7a03b (patch) | |
| tree | 2d5423399a5341808db808cecef571aa41773be6 /src/document.cpp | |
| parent | Use more fine-grain fallbacks for Poppler/Cairo PDF imports. (diff) | |
| download | inkscape-ea3737623c19fa92b97ec6c3e228ea0f8db7a03b.tar.gz inkscape-ea3737623c19fa92b97ec6c3e228ea0f8db7a03b.zip | |
Import all defs from clipboard or imported files
Fixed bugs:
- https://launchpad.net/bugs/1460057
(bzr r14185)
Diffstat (limited to 'src/document.cpp')
| -rw-r--r-- | src/document.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/document.cpp b/src/document.cpp index 741e7c812..ebf5d312f 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -1634,11 +1634,18 @@ void SPDocument::setModifiedSinceSave(bool modified) { void SPDocument::importDefs(SPDocument *source) { Inkscape::XML::Node *root = source->getReprRoot(); - Inkscape::XML::Node *defs = sp_repr_lookup_name(root, "svg:defs", 1); Inkscape::XML::Node *target_defs = this->getDefs()->getRepr(); + std::vector<Inkscape::XML::Node const *> defsNodes = sp_repr_lookup_name_many(root, "svg:defs"); prevent_id_clashes(source, this); + for (std::vector<Inkscape::XML::Node const *>::iterator defs = defsNodes.begin(); defs != defsNodes.end(); ++defs) { + importDefsNode(source, const_cast<Inkscape::XML::Node *>(*defs), target_defs); + } +} + +void SPDocument::importDefsNode(SPDocument *source, Inkscape::XML::Node *defs, Inkscape::XML::Node *target_defs) +{ int stagger=0; /* Note, "clipboard" throughout the comments means "the document that is either the clipboard |
