summaryrefslogtreecommitdiffstats
path: root/src/ui/clipboard.cpp
diff options
context:
space:
mode:
authorLiam P. White <inkscapebrony@gmail.com>2014-07-30 15:27:34 +0000
committerLiam P. White <inkscapebrony@gmail.com>2014-07-30 15:27:34 +0000
commitf9ea5bd2c9c4fe4f2b0a867bfdf0a10519dce5fd (patch)
tree88c5361cf3890cdf5d1b8bfa833229e9c16ac2ad /src/ui/clipboard.cpp
parentRead CSS Text 3 'white-space' property, SVG 2 <text> 'width', 'height' attrib... (diff)
parentFix for 1346972 (freehand shape mode should pick stroke width from tool's act... (diff)
downloadinkscape-f9ea5bd2c9c4fe4f2b0a867bfdf0a10519dce5fd.tar.gz
inkscape-f9ea5bd2c9c4fe4f2b0a867bfdf0a10519dce5fd.zip
Update to trunk r13482
(bzr r13341.1.111)
Diffstat (limited to 'src/ui/clipboard.cpp')
-rw-r--r--src/ui/clipboard.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp
index 8e2502545..1209b19cd 100644
--- a/src/ui/clipboard.cpp
+++ b/src/ui/clipboard.cpp
@@ -601,6 +601,12 @@ Glib::ustring ClipboardManagerImpl::getPathParameter(SPDesktop* desktop)
*/
Glib::ustring ClipboardManagerImpl::getShapeOrTextObjectId(SPDesktop *desktop)
{
+ // https://bugs.launchpad.net/inkscape/+bug/1293979
+ // basically, when we do a depth-first search, we're stopping
+ // at the first object to be <svg:path> or <svg:text>.
+ // but that could then return the id of the object's
+ // clip path or mask, not the original path!
+
SPDocument *tempdoc = _retrieveClipboard(); // any target will do here
if ( tempdoc == NULL ) {
_userWarn(desktop, _("Nothing on the clipboard."));
@@ -608,6 +614,9 @@ Glib::ustring ClipboardManagerImpl::getShapeOrTextObjectId(SPDesktop *desktop)
}
Inkscape::XML::Node *root = tempdoc->getReprRoot();
+ // 1293979: strip out the defs of the document
+ root->removeChild(tempdoc->getDefs()->getRepr());
+
Inkscape::XML::Node *repr = sp_repr_lookup_name(root, "svg:path", -1); // unlimited search depth
if ( repr == NULL ) {
repr = sp_repr_lookup_name(root, "svg:text", -1);