Mercurial > hg > svcore
comparison base/Command.cpp @ 1429:48e9f538e6e9
Untabify
author | Chris Cannam |
---|---|
date | Thu, 01 Mar 2018 18:02:22 +0000 |
parents | cc27f35aa75c |
children |
comparison
equal
deleted
inserted
replaced
1428:87ae75da6527 | 1429:48e9f538e6e9 |
---|---|
22 } | 22 } |
23 | 23 |
24 MacroCommand::~MacroCommand() | 24 MacroCommand::~MacroCommand() |
25 { | 25 { |
26 for (size_t i = 0; i < m_commands.size(); ++i) { | 26 for (size_t i = 0; i < m_commands.size(); ++i) { |
27 delete m_commands[i]; | 27 delete m_commands[i]; |
28 } | 28 } |
29 } | 29 } |
30 | 30 |
31 void | 31 void |
32 MacroCommand::addCommand(Command *command) | 32 MacroCommand::addCommand(Command *command) |
36 | 36 |
37 void | 37 void |
38 MacroCommand::deleteCommand(Command *command) | 38 MacroCommand::deleteCommand(Command *command) |
39 { | 39 { |
40 for (std::vector<Command *>::iterator i = m_commands.begin(); | 40 for (std::vector<Command *>::iterator i = m_commands.begin(); |
41 i != m_commands.end(); ++i) { | 41 i != m_commands.end(); ++i) { |
42 | 42 |
43 if (*i == command) { | 43 if (*i == command) { |
44 m_commands.erase(i); | 44 m_commands.erase(i); |
45 delete command; | 45 delete command; |
46 return; | 46 return; |
47 } | 47 } |
48 } | 48 } |
49 } | 49 } |
50 | 50 |
51 bool | 51 bool |
52 MacroCommand::haveCommands() const | 52 MacroCommand::haveCommands() const |
56 | 56 |
57 void | 57 void |
58 MacroCommand::execute() | 58 MacroCommand::execute() |
59 { | 59 { |
60 for (size_t i = 0; i < m_commands.size(); ++i) { | 60 for (size_t i = 0; i < m_commands.size(); ++i) { |
61 m_commands[i]->execute(); | 61 m_commands[i]->execute(); |
62 } | 62 } |
63 } | 63 } |
64 | 64 |
65 void | 65 void |
66 MacroCommand::unexecute() | 66 MacroCommand::unexecute() |
67 { | 67 { |
68 for (size_t i = 0; i < m_commands.size(); ++i) { | 68 for (size_t i = 0; i < m_commands.size(); ++i) { |
69 m_commands[m_commands.size() - i - 1]->unexecute(); | 69 m_commands[m_commands.size() - i - 1]->unexecute(); |
70 } | 70 } |
71 } | 71 } |
72 | 72 |
73 QString | 73 QString |
74 MacroCommand::getName() const | 74 MacroCommand::getName() const |