Skip to content

Commit

Permalink
filter objects to exclude duplicates during copy
Browse files Browse the repository at this point in the history
  • Loading branch information
usakhelo authored and wwmayer committed Jun 16, 2016
1 parent dc17dbf commit 8902e18
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Gui/MainWindow.cpp
Expand Up @@ -1318,10 +1318,12 @@ void MainWindow::dragEnterEvent (QDragEnterEvent * e)
QMimeData * MainWindow::createMimeDataFromSelection () const
{
std::vector<SelectionSingleton::SelObj> selobj = Selection().getCompleteSelection();
std::set<App::DocumentObject*> unique_objs;
std::map< App::Document*, std::vector<App::DocumentObject*> > objs;
for (std::vector<SelectionSingleton::SelObj>::iterator it = selobj.begin(); it != selobj.end(); ++it) {
if (it->pObject && it->pObject->getDocument()) {
objs[it->pObject->getDocument()].push_back(it->pObject);
if (unique_objs.insert(it->pObject).second)
objs[it->pObject->getDocument()].push_back(it->pObject);
}
}

Expand Down

0 comments on commit 8902e18

Please sign in to comment.