- vc->layer_type = sel->type;
- if ( vik_layer_get_interface(vc->layer_type)->copy_item) {
- vc->subtype = vik_treeview_item_get_data(sel->vt, &iter);
- vik_layer_get_interface(vc->layer_type)->copy_item(sel, vc->subtype, vik_treeview_item_get_pointer(sel->vt, &iter), &data, &len );
- vc->type = DATA_SUBLAYER;
- }
+ type = VIK_CLIPBOARD_DATA_SUBLAYER;
+ if ( vik_layer_get_interface(layer_type)->copy_item) {
+ subtype = vik_treeview_item_get_data(sel->vt, &iter);
+ vik_layer_get_interface(layer_type)->copy_item(sel, subtype, vik_treeview_item_get_pointer(sel->vt, &iter), &data, &len );
+ // This name is used in setting the text representation of the item on the clipboard.
+ name = vik_treeview_item_get_name(sel->vt, &iter);
+ }