summaryrefslogtreecommitdiffstats
path: root/src/document.cpp
diff options
context:
space:
mode:
authorBen Scholzen 'DASPRiD <mail@dasprids.de>2015-05-29 17:21:52 +0000
committerBen Scholzen 'DASPRiD <mail@dasprids.de>2015-05-29 17:21:52 +0000
commitea3737623c19fa92b97ec6c3e228ea0f8db7a03b (patch)
tree2d5423399a5341808db808cecef571aa41773be6 /src/document.cpp
parentUse more fine-grain fallbacks for Poppler/Cairo PDF imports. (diff)
downloadinkscape-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.cpp9
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