Text can be flown into shapes (via the shape-inside style property), and
these need special attention during duplicate/copy. These shapes need to
be duplicated/copied in addition to the text, in case they are not
included in the dupe/copy selection already.
For duplication -- if a text object references shapes via
shape-inside/shape-subtract they are added to the duplicate selection
(if not present).
For layer duplication -- if a text in the duplicated layer references
shapes outside of its layer, these shapes are duplicated and brought
into the new layer.
For copy -- if a text object references shapes they are added to the
generated clipboard document (if not selected already). After the
clipboard is pasted, some ids might need change (to prevent clashes), so
the existing id clash prevention logic is augmented to mind text shapes
as well.
Rough edges (not directly related to copy/duplicate):
- explicit shape-inside is not well handled in the UI
- shape might end up on top of text
- Select & Transform tool changes the relative position of the text
and its shapes
- during paste shift logic (so pasted stuff is not on top of
original), the transformation on text object causes it to jump
outside of the shape (and it might be too far off / not visible) --
bad UX.
- shape and text being on separate layers doesn't fire update
text layout when shape is changed, but somehow snaps text into shape
when a text transform is applied
- shape-subtract handling is not implemented at all
- basic-shapes are not handled in shape-inside
(cherry picked from commit 95f17f34521466fb2f329c07c3289eaa20348605)
- Revisit `Inkscape::XML::Node::setAttribute` and `SPObject::setAttribute`
- New `Inkscape::Util::const_char_ptr` absorbs all diversity of strings zoo
- New `setAttributeOrRemoveIfEmpty` method
- New `removeAttribute` method
- Simplification of call sites of `setAttribute`