-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Expand file tree
/
Copy pathset_layer_name.cpp
More file actions
39 lines (31 loc) · 760 Bytes
/
set_layer_name.cpp
File metadata and controls
39 lines (31 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Aseprite
// Copyright (C) 2001-2015 David Capello
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation.
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "app/cmd/set_layer_name.h"
#include "doc/layer.h"
namespace app {
namespace cmd {
SetLayerName::SetLayerName(Layer* layer, const std::string& name)
: WithLayer(layer)
, m_oldName(layer->name())
, m_newName(name)
{
}
void SetLayerName::onExecute()
{
layer()->setName(m_newName);
layer()->incrementVersion();
}
void SetLayerName::onUndo()
{
layer()->setName(m_oldName);
layer()->incrementVersion();
}
} // namespace cmd
} // namespace app