| 44 | } |
| 45 | |
| 46 | void AddCel::onUndo() |
| 47 | { |
| 48 | Layer* layer = this->layer(); |
| 49 | auto cel = this->cel(); |
| 50 | |
| 51 | // Save the CelData only if the cel isn't linked |
| 52 | bool has_data = (cel->links() == 0); |
| 53 | write8(m_stream, has_data ? 1: 0); |
| 54 | if (has_data) { |
| 55 | write_image(m_stream, cel->image()); |
| 56 | write_celdata(m_stream, cel->data()); |
| 57 | } |
| 58 | write_cel(m_stream, cel.get()); |
| 59 | m_size = size_t(m_stream.tellp()); |
| 60 | |
| 61 | removeCel(layer, cel); |
| 62 | } |
| 63 | |
| 64 | void AddCel::onRedo() |
| 65 | { |
nothing calls this directly
no test coverage detected