diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/sp-object.cpp | 5 | ||||
| -rw-r--r-- | src/sp-object.h | 4 | ||||
| -rw-r--r-- | src/ui/clipboard.cpp | 7 |
3 files changed, 9 insertions, 7 deletions
diff --git a/src/sp-object.cpp b/src/sp-object.cpp index 8d4c4f0d1..e9c60fc7d 100644 --- a/src/sp-object.cpp +++ b/src/sp-object.cpp @@ -112,9 +112,6 @@ public: } }; -static gchar *sp_object_get_unique_id(SPObject *object, - gchar const *defid); - /** * Constructor, sets all attributes to default values. */ @@ -1382,7 +1379,7 @@ bool SPObject::storeAsDouble( gchar const *key, double *val ) const } /** Helper */ -static gchar* +gchar * sp_object_get_unique_id(SPObject *object, gchar const *id) { diff --git a/src/sp-object.h b/src/sp-object.h index 355f837b5..7f3c77ee3 100644 --- a/src/sp-object.h +++ b/src/sp-object.h @@ -1,6 +1,8 @@ #ifndef SP_OBJECT_H_SEEN #define SP_OBJECT_H_SEEN +#include <glibmm/ustring.h> + /* * Authors: * Lauris Kaplinski <lauris@kaplinski.com> @@ -878,7 +880,7 @@ public: */ int sp_object_compare_position(SPObject const *first, SPObject const *second); bool sp_object_compare_position_bool(SPObject const *first, SPObject const *second); - +gchar * sp_object_get_unique_id(SPObject *object, gchar const *defid); #endif // SP_OBJECT_H_SEEN diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp index ef00e11b3..a8e708597 100644 --- a/src/ui/clipboard.cpp +++ b/src/ui/clipboard.cpp @@ -60,6 +60,7 @@ #include "sp-mask.h" #include "sp-textpath.h" #include "sp-rect.h" +#include "sp-object.h" #include "live_effects/lpeobject.h" #include "live_effects/lpeobject-reference.h" #include "live_effects/parameter/path.h" @@ -698,8 +699,10 @@ void ClipboardManagerImpl::_copySelection(ObjectSet *selection) LivePathEffectObject *lpeobj = (*it)->lpeobject; if (lpeobj) { Inkscape::XML::Node * lpeobjcopy = _copyNode(lpeobj->getRepr(), _doc, _defs); - lpeobjcopy->setAttribute("id",lpeobj->getRepr()->attribute("id")); - os << "#" << lpeobj->getRepr()->attribute("id") << ";"; + gchar *new_conflict_id = sp_object_get_unique_id(lpeobj, lpeobj->getAttribute("id")); + lpeobjcopy->setAttribute("id", new_conflict_id); + g_free(new_conflict_id); + os << "#" << lpeobjcopy->attribute("id") << ";"; } } } |
