12#include <klocalizedstring.h>
26 Q_FOREACH (
KoShape *shape, shapes)
40 d->shapes.append(shape);
41 d->oldParents.append(shape->
parent());
52 Q_FOREACH (
KoShape *shape,
d->shapes) {
53 d->oldParents.append(shape->
parent());
70 for (
int i = 0; i <
d->shapes.count(); i++) {
71 if (
d->oldParents.at(i)) {
72 d->oldParents.at(i)->removeShape(
d->shapes[i]);
75 d->deleteShapes =
true;
84 for (
int i = 0; i <
d->shapes.count(); i++) {
85 if (
d->oldParents.at(i)) {
86 d->oldParents.at(i)->addShape(
d->shapes[i]);
89 d->deleteShapes =
false;
void setText(const KUndo2MagicString &text)
The undo / redo command for deleting shapes.
bool deleteShapes
shows if shapes should be deleted when deleting the command
KoShapeControllerBase * controller
the shape controller to use for removing/readding
Private(KoShapeControllerBase *c)
~KoShapeDeleteCommand() override
KoShapeDeleteCommand(KoShapeControllerBase *controller, KoShape *shape, KUndo2Command *parent=0)
QList< KoShape * > shapes
the list of shapes to delete
void undo() override
revert the actions done in redo
void redo() override
redo the command
QList< KoShapeContainer * > oldParents
the old parents of the shapes
KoShapeContainer * parent() const
KUndo2MagicString kundo2_i18nc(const char *ctxt, const char *text)
KUndo2MagicString kundo2_i18np(const char *sing, const char *plur, const A1 &a1)