From: Ian Gardner <ilgardner@ya...> - 2011-02-08 22:20:29
I've hit a small architectural hurdle implementing the idea of pasting clipboard contents as linked segments.
If I'm reading the code correctly, it would seem that copying segments to the clipboard makes deep copies in the clipboard, and thus any concept of which segment they were copied from is lost. So, when I come to paste into the composition as links, I don't know which composition segments to link to.
Do any bright ideas occur to anyone as to how to cope with this?
With my hacking hat on, the first idea which occurs is to change the Clipboard::m_segments multiset to take a std::pair<Segment *, Segment *> in place of the Segment * it has currently, to keep track of the original segment next to the deep copy, in case it's needed when pasting.
That's just the idea which occurs off the top of my head, I haven't thought it through hard enough to ascertain whether it's actually a good idea, or whether there's another route I can take which is better.
Anyway, the bottom line is when pasting from the clipboard, one of the things I need is an audit-trail back to the original segments so I can do the linking properly. All suggestions most gratefully received!