Better ID handling on object copy

Bug #170308 reported by Jerkfm
4
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Wishlist
Unassigned

Bug Description

When graphic-nodes are copied, PLEASE leave the id the
same with an appended extra numeric suffix (hexadecimal
would be more compact). This would improve productivity
in xml editor a lot.

Tags: svg
Revision history for this message
A-b-users (a-b-users) wrote :

This seems to be a feature request, and as such, it belongs
there.
http://sf.net/tracker/?group_id=93438&atid=604309

Revision history for this message
Buliabyak-users (buliabyak-users) wrote :

Moving to RFEs.

Changed in inkscape:
importance: Medium → Wishlist
status: New → Confirmed
Revision history for this message
khiraly (khiraly123) wrote :

This "feature" is still lacking in current inkscape (tested on dec 20 nightly build).

The real problem about it is, when an object copied, or pasted from an another document, it cant be predicted what the
object id will be.

The problem is more serious with groups, when not only the group id is changed, but each and every element inside the group
got a random id.

This prevent to write extensions, which are dealing with objects in inkscape.
(and prevent to create librarys, because when a graphics is imported from this library, all the id's is screwed up.

I would like to reconsider this as a bug and not as a feature request. What others think about it?

Revision history for this message
shawnhcorey (shawn-corey) wrote :

I'm thinking that you can do something like this with the inkscape:label (Object->Object Properties... dialog). Two this would needed be added: a way to place the same label on multiple objects and groups; and a Edit->Select by Label... menu item.

The problem I see with just adding a suffix it that what happens when there a multiple imports. That is, if you import a SVG, save it, then import the new file in another.

Example:

In the first file the object's ID is path1776. It is imported into a second, becoming path1776-1. If this second file is imported into a third, is it path1776-1-1.

Of course, if keeping the object's import history is not important, I suggest you promote the use of the inkscape:label. Adding a suffix to the ID would mean, at the very least, that all the ID handling code would have to be examined to make sure nothing will break. The inkscape:label code is small and relatively untouched.

jazzynico (jazzynico)
tags: added: svg
removed: svg-xml
Revision history for this message
sas (sas-sas) wrote :

This is fixed in Inkscape 0.47. I fixed it in the course of fixing bug 165936, but I didn't realise there was a request for it.

The problem was not in copying (which does not change IDs), but in pasting. The new behaviour when an ID needs changing during pasting or importing is to append a hyphen followed a random digit (or more than one random digit, if there is still an ID clash).

Note that the old behaviour still applies when duplicating - if you care about the IDs, use copy and paste-in-place instead.

Changed in inkscape:
status: Confirmed → Fix Released
jazzynico (jazzynico)
Changed in inkscape:
milestone: none → 0.47
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.