Clipboard: code cleaning proposal

Bug #964852 reported by Codain on 2012-03-25
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Here is not a bug but a proposal after a discussion on the developper mailinglist.

After a deep overview, I've found 4 functions in ClipboardManagerImpl which are not dedicated to (but are used by) the clipboard and could, sometimes, duplicate some already existing functions.

Finally I will keep one of those 4 function in place (_copyNode) because moving it in the Node class creates two much warnings for the moment.

I will post a patch wich will does following things :

Function void ClipboardManagerImpl::_pasteDocument(SPDesktop *desktop, SPDocument *clipdoc, bool in_place)
will become sp_import_document(SPDocument *clipdoc) in file.cpp
(TODO: look for a merge with file_import() in same file)

Function void ClipboardManagerImpl::_pasteDefs(SPDesktop *desktop, SPDocument *clipdoc)
will become SPDocument::importDefs(SPDocument *source)
(no existing function found)

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

Codain (codain) on 2012-03-25
Changed in inkscape:
assignee: nobody → Romain (romain2boss)
Codain (codain) wrote :
Changed in inkscape:
status: New → In Progress
jazzynico (jazzynico) on 2012-03-26
tags: added: clipboard
Kris (kris-degussem) wrote :

Thanks for the patch, Romain.
Committed in trunk revision 11153.
If you wish to work further on the merge of sp_import_document, feel free to reopen this report and add the patch.

Changed in inkscape:
status: In Progress → Fix Committed
milestone: none → 0.49
Codain (codain) wrote :

Thanks Kris!

Bryce Harrington (bryce) on 2015-02-21
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers