summaryrefslogtreecommitdiffstats
path: root/src/ui/clipboard.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-03-27 23:02:23 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-03-27 23:02:23 +0000
commit1d5965fea00bedb49232c419c22382dbf6581309 (patch)
treeaff38e478e9a621178ab80bd87ba630e8e11dac1 /src/ui/clipboard.cpp
parentcomment #define BYPASS_GLIB_SPAWN 1 to fix build on windows (diff)
downloadinkscape-1d5965fea00bedb49232c419c22382dbf6581309.tar.gz
inkscape-1d5965fea00bedb49232c419c22382dbf6581309.zip
add linking to other paths to lpe-PathParam
(bzr r5209)
Diffstat (limited to 'src/ui/clipboard.cpp')
-rw-r--r--src/ui/clipboard.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp
index 31a943365..081657cf0 100644
--- a/src/ui/clipboard.cpp
+++ b/src/ui/clipboard.cpp
@@ -95,7 +95,7 @@ public:
virtual bool pasteSize(bool, bool, bool);
virtual bool pastePathEffect();
virtual Glib::ustring getPathParameter();
- virtual Glib::ustring getPathObjectId();
+ virtual Glib::ustring getShapeOrTextObjectId();
ClipboardManagerImpl();
~ClipboardManagerImpl();
@@ -439,25 +439,28 @@ Glib::ustring ClipboardManagerImpl::getPathParameter()
/**
- * @brief Get path object id from the clipboard
- * @return The retrieved path id string (contents of the id attribute), or "" if no path was found
+ * @brief Get object id of a shape or text item from the clipboard
+ * @return The retrieved id string (contents of the id attribute), or "" if no shape or text item was found
*/
-Glib::ustring ClipboardManagerImpl::getPathObjectId()
+Glib::ustring ClipboardManagerImpl::getShapeOrTextObjectId()
{
SPDocument *tempdoc = _retrieveClipboard(); // any target will do here
if ( tempdoc == NULL ) {
_userWarn(SP_ACTIVE_DESKTOP, _("Nothing on the clipboard."));
return "";
}
- Inkscape::XML::Node
- *root = sp_document_repr_root(tempdoc),
- *path = sp_repr_lookup_name(root, "svg:path", -1); // unlimited search depth
- if ( path == NULL ) {
+ Inkscape::XML::Node *root = sp_document_repr_root(tempdoc);
+
+ 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);
+
+ if ( repr == NULL ) {
_userWarn(SP_ACTIVE_DESKTOP, _("Clipboard does not contain a path."));
sp_document_unref(tempdoc);
return "";
}
- gchar const *svgd = path->attribute("id");
+ gchar const *svgd = repr->attribute("id");
return svgd;
}