Copy and paste between two documents with colliding xlink:href yield wrong result

Bug #1121421 reported by Dov Grobgeld
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Confirmed
Undecided
Unassigned

Bug Description

When pasting a selection containing xlink:href references into another document that have the same reference id's but with different symbol contents, the copied selections href's are not copied and renamed as expected. Instead the copy suddenly gets attached to the destination symbols.

To illustrate this consider the following short python program that generates two svg files by cairo, ab.svg and bc.svg, each containing two characters:

import cairo

WIDTH=HEIGHT=128
for text,r,g,b in (('ab',1,0,0),
                   ('bc',0,1,0)):
  surface = cairo.SVGSurface (text + '.svg', WIDTH, HEIGHT)
  cr = cairo.Context (surface)
  cr.rectangle(0,0,WIDTH,HEIGHT)
  # Darkblue
  cr.set_source_rgb(0,0,0.5)
  cr.fill()

  cr.set_source_rgba(r,g,b,0.9)
  cr.move_to(10,100)
  cr.scale(8,8)
  cr.show_text(text)

The resulting images are attached as ab.svg and bc.svg .

To reproduce the bug do:

1. Run inkscape with both files

inkscape ab.svg bc.svg

2. in bc.svg do Ctrl-A to select the drawing.

3. Paste into ab.svg

Result: The pasted text turns into 'ab' while it was 'bc' in the original.

Tested with Inkscape 0.48.4 r9939

Revision history for this message
Dov Grobgeld (dov-grobgeld) wrote :
Revision history for this message
Dov Grobgeld (dov-grobgeld) wrote :

Second svg file that will be changed if pasted into the first ab.svg .

summary: - Copy past between two documents with colliding xlink:href yield wrong
- result
+ Copy and paste between two documents with colliding xlink:href yield
+ wrong result
description: updated
Revision history for this message
jazzynico (jazzynico) wrote :

Reproduced on Windows XP, Inkscape trunk revision 12387.
The group is correctly copied, but the linked symbol (defined in the defs) not.

tags: added: clipboard symbols
Changed in inkscape:
status: New → Confirmed
Revision history for this message
su_v (suv-lp) wrote :

Likely a duplicate of
- Bug #220521 “Group element in <defs> section lost during copy/paste between inkscape windows”
  <https://bugs.launchpad.net/inkscape/+bug/220521>

The underlying issue AFAIU is related to
- Bug #167907 (sf1540808) “Copying cloned objects between files fails”
  <https://bugs.launchpad.net/inkscape/+bug/167907>
based on slightly modified test case:

- Paste the content of 'bc.svg' into a new document instead of 'ab.svg': the clones (aka <use> objects aka instances of <symbol> objects) are pasted without the original definition, thus not rendered anymore (-> status line message: "Orphaned clone in layer …").

The same behavior (referenced original objects of <use> instances are not included in the clipboard transfer) results in the reported behavior: if objects with the same id already exist in the current document, those definitions are reused by the pasted clones (aka <use> objects).

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.