Thanks Krzyszto. Because I can't commit on the trunk for the moment do not be afraid if you find bugs-reports/patches on Launchpad.

For your interest here is my plan, I will put it in my bug report:

Function Inkscape::XML::Node *ClipboardManagerImpl::_copyNode(Inkscape::XML::Node *node, Inkscape::XML::Document *target_doc, Inkscape::XML::Node *parent)
will become Inkscape::XML::Node::duplicate(Node* parent);
(Note there is already a Inkscape::XML::Node::duplicate(Document* doc) but having a second and complete method is also usefull)

Function void ClipboardManagerImpl::_pasteDocument(SPDesktop *desktop, SPDocument *clipdoc, bool in_place)
will be probably kept (for special clipboard features like in_place) but some code will probably moved to something like SPDesktop::import(SPDocument *clipdoc)
(TODO look for difference between this method and File > Import to avoid duplicate code)

Function void ClipboardManagerImpl::_pasteDefs(SPDesktop *desktop, SPDocument *clipdoc)
will become SPDocument::importDefs(SPDocument *source)
(because defs belongs to documents it's better to put this function in SPDocument an not SPDesktop)

Function SPCSSAttr *ClipboardManagerImpl::_parseColor(const Glib::ustring &text)
will become SPCSSAttr *sp_repr_css_attr_parse_color_to_fill() in xml/reps-css.cpp

@+


Romain de Bossoreille

Le 18/03/2012 18:37, Krzysztof Kosiński a écrit :
W dniu 17 marca 2012 21:55 użytkownik Romain de Bossoreille
<romain2boss@...48...> napisał:
Hi,

A 200% code question, thanks to the one (or two, or three... !) who will
give me an answer!

I'm looking very closely to the clipboard implementation to follow
understanding its behaviour (cf.
http://wiki.inkscape.org/wiki/index.php/Clipboard), an amazing work have
been done but I've a question (in src/ui/clipboard.cpp):

Inkscape::XML::Node *ClipboardManagerImpl::_copyNode(Inkscape::XML::Node
*node, Inkscape::XML::Document *target_doc, Inkscape::XML::Node *parent)
void ClipboardManagerImpl::_pasteDocument(SPDesktop *desktop, SPDocument
*clipdoc, bool in_place)
void ClipboardManagerImpl::_pasteDefs(SPDesktop *desktop, SPDocument
*clipdoc)
SPCSSAttr *ClipboardManagerImpl::_parseColor(const Glib::ustring &text)

On my understanding, those functions should not be implemented in the
Clipboard class because 1) they are not using any functions dedicated to the
Clipboard and so 2) they are codes that could be needed for other puposes
than clipboard (and I wonder whether some are duplicated elsewhere in the
project).
Yes, these functions could be moved to somewhere else and unified with
the code for importing (in file.cpp). I wrote this a long time ago
when I knew a lot less about Inkscape code, so it's not perfect.

Regards, Krzysztof