| 928 | } |
| 929 | |
| 930 | void Map::deleteSelectedObjects() |
| 931 | { |
| 932 | auto obj = selectedObjectsBegin(); |
| 933 | auto end = selectedObjectsEnd(); |
| 934 | if (obj != end) |
| 935 | { |
| 936 | // FIXME: this is not ready for multiple map parts. |
| 937 | auto undo_step = new AddObjectsUndoStep(this); |
| 938 | MapPart* part = getCurrentPart(); |
| 939 | |
| 940 | for (; obj != end; ++obj) |
| 941 | { |
| 942 | int index = part->findObjectIndex(*obj); |
| 943 | if (index >= 0) |
| 944 | { |
| 945 | undo_step->addObject(index, *obj); |
| 946 | part->releaseObject(index); |
| 947 | } |
| 948 | else |
| 949 | { |
| 950 | qDebug() << this << "::deleteSelectedObjects(): Object" << *obj << "not found in current map part."; |
| 951 | } |
| 952 | } |
| 953 | |
| 954 | setObjectsDirty(); |
| 955 | clearObjectSelection(true); |
| 956 | push(undo_step); |
| 957 | } |
| 958 | } |
| 959 | |
| 960 | void Map::includeSelectionRect(QRectF& rect) const |
| 961 | { |
no test coverage detected