Use replaceStockImage() in Undoable::setImgType() to avoid duplicated code.

This commit is contained in:
David Capello 2010-10-10 18:54:30 -03:00
parent 8b7367a1bb
commit 3917892a16

View File

@ -217,11 +217,7 @@ void Undoable::setImgType(int new_imgtype, int dithering_method)
return; /* TODO error handling: not enough memory! return; /* TODO error handling: not enough memory!
we should undo all work done */ we should undo all work done */
if (isEnabled()) this->replaceStockImage(c, new_image);
m_sprite->getUndo()->undo_replace_image(m_sprite->getStock(), c);
image_free(old_image);
m_sprite->getStock()->replaceImage(c, new_image);
} }
/* change "sprite.imgtype" field */ /* change "sprite.imgtype" field */