~inkscape+alexander/inkscape/break

« back to all changes in this revision

Viewing changes to src/extension/implementation/script.cpp

  • Committer: Alexander Brock
  • Date: 2015-05-31 17:41:01 UTC
  • mfrom: (13749.1.441 Inkscape)
  • Revision ID: brock.alexander@web.de-20150531174101-2roftkxg6oy1oav5
MergeĀ lp:inkscape

Show diffs side-by-side

added added

removed removed

Lines of Context:
689
689
        return;
690
690
    }
691
691
 
692
 
    Inkscape::Util::GSListConstIterator<SPItem *> selected =
 
692
    std::vector<SPItem*> selected =
693
693
        desktop->getSelection()->itemList(); //desktop should not be NULL since doc was checked and desktop is a casted pointer
694
 
    while ( selected != NULL ) {
 
694
    for(std::vector<SPItem*>::const_iterator x = selected.begin(); x != selected.end(); x++){
695
695
        Glib::ustring selected_id;
696
696
        selected_id += "--id=";
697
 
        selected_id += (*selected)->getId();
 
697
        selected_id += (*x)->getId();
698
698
        params.insert(params.begin(), selected_id);
699
 
        ++selected;
700
699
    }
701
700
 
702
701
    file_listener fileout;
813
812
        }
814
813
    }
815
814
 
 
815
    if(!oldroot_namedview)
 
816
    {
 
817
        g_warning("Error on copy_doc: No namedview on destination document.");
 
818
        return;
 
819
    }
 
820
 
816
821
    // Unparent (delete)
817
822
    for (unsigned int i = 0; i < delete_list.size(); i++) {
818
823
        sp_repr_unparent(delete_list[i]);
824
829
            child = child->next()) {
825
830
        if (!strcmp("sodipodi:namedview", child->name())) {
826
831
            newroot_namedview = child;
827
 
            if (oldroot_namedview != NULL) {
828
 
                for (Inkscape::XML::Node * newroot_namedview_child = child->firstChild();
829
 
                        newroot_namedview_child != NULL;
830
 
                        newroot_namedview_child = newroot_namedview_child->next()) {
831
 
                    oldroot_namedview->appendChild(newroot_namedview_child->duplicate(oldroot->document()));
832
 
                }
 
832
            for (Inkscape::XML::Node * newroot_namedview_child = child->firstChild();
 
833
                    newroot_namedview_child != NULL;
 
834
                    newroot_namedview_child = newroot_namedview_child->next()) {
 
835
                oldroot_namedview->appendChild(newroot_namedview_child->duplicate(oldroot->document()));
833
836
            }
834
837
        } else {
835
838
            oldroot->appendChild(child->duplicate(oldroot->document()));
1027
1030
        return 0;
1028
1031
    }
1029
1032
 
1030
 
    _main_loop = Glib::MainLoop::create(false);
 
1033
    // Create a new MainContext for the loop so that the original context sources are not run here,
 
1034
    // this enforces that only the file_listeners should be read in this new MainLoop
 
1035
    Glib::RefPtr<Glib::MainContext> _main_context = Glib::MainContext::create();
 
1036
    _main_loop = Glib::MainLoop::create(_main_context, false);
1031
1037
 
1032
1038
    file_listener fileerr;
1033
1039
    fileout.init(stdout_pipe, _main_loop);