From 4b7a90318a8a57b7e5f3a03fd59ead3f6256723c Mon Sep 17 00:00:00 2001 From: David Capello Date: Fri, 19 May 2017 11:10:56 -0300 Subject: [PATCH] Remove DocumentApi::flattenLayers() --- src/app/commands/cmd_flatten_layers.cpp | 9 ++++----- src/app/document_api.cpp | 6 ------ src/app/document_api.h | 1 - 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/app/commands/cmd_flatten_layers.cpp b/src/app/commands/cmd_flatten_layers.cpp index 90eff4c58..453d18abe 100644 --- a/src/app/commands/cmd_flatten_layers.cpp +++ b/src/app/commands/cmd_flatten_layers.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2001-2015 David Capello +// Copyright (C) 2001-2017 David Capello // // This program is distributed under the terms of // the End-User License Agreement for Aseprite. @@ -8,12 +8,12 @@ #include "config.h" #endif +#include "app/cmd/flatten_layers.h" #include "app/commands/command.h" #include "app/context_access.h" -#include "app/document_api.h" #include "app/modules/gui.h" -#include "app/ui/color_bar.h" #include "app/transaction.h" +#include "app/ui/color_bar.h" #include "doc/sprite.h" namespace app { @@ -43,11 +43,10 @@ bool FlattenLayersCommand::onEnabled(Context* context) void FlattenLayersCommand::onExecute(Context* context) { ContextWriter writer(context); - Document* document = writer.document(); Sprite* sprite = writer.sprite(); { Transaction transaction(writer.context(), "Flatten Layers"); - document->getApi(transaction).flattenLayers(sprite); + transaction.execute(new cmd::FlattenLayers(sprite)); transaction.commit(); } update_screen_for_document(writer.document()); diff --git a/src/app/document_api.cpp b/src/app/document_api.cpp index abcf2d896..7f323424c 100644 --- a/src/app/document_api.cpp +++ b/src/app/document_api.cpp @@ -18,7 +18,6 @@ #include "app/cmd/clear_image.h" #include "app/cmd/copy_cel.h" #include "app/cmd/copy_frame.h" -#include "app/cmd/flatten_layers.h" #include "app/cmd/flip_image.h" #include "app/cmd/layer_from_background.h" #include "app/cmd/move_cel.h" @@ -480,11 +479,6 @@ void DocumentApi::layerFromBackground(Layer* layer) m_transaction.execute(new cmd::LayerFromBackground(layer)); } -void DocumentApi::flattenLayers(Sprite* sprite) -{ - m_transaction.execute(new cmd::FlattenLayers(sprite)); -} - Layer* DocumentApi::duplicateLayerAfter(Layer* sourceLayer, LayerGroup* parent, Layer* afterLayer) { ASSERT(parent); diff --git a/src/app/document_api.h b/src/app/document_api.h index ea199a07e..eea3fb783 100644 --- a/src/app/document_api.h +++ b/src/app/document_api.h @@ -84,7 +84,6 @@ namespace app { void restackLayerBefore(Layer* layer, LayerGroup* parent, Layer* beforeThis); void backgroundFromLayer(Layer* layer); void layerFromBackground(Layer* layer); - void flattenLayers(Sprite* sprite); Layer* duplicateLayerAfter(Layer* sourceLayer, LayerGroup* parent, Layer* afterLayer); Layer* duplicateLayerBefore(Layer* sourceLayer, LayerGroup* parent, Layer* beforeLayer);