| 106 | } |
| 107 | |
| 108 | bool MacroActionSequence::SetSequenceIndex() |
| 109 | { |
| 110 | auto macro = _macro.GetMacro(); |
| 111 | if (!macro) { |
| 112 | SetTempVarValue("nextMacro", ""); |
| 113 | return true; |
| 114 | } |
| 115 | |
| 116 | auto actions = GetMacroActions(macro.get()); |
| 117 | if (!actions) { |
| 118 | SetTempVarValue("nextMacro", ""); |
| 119 | return true; |
| 120 | } |
| 121 | |
| 122 | std::string nextMacroName; |
| 123 | for (const auto &action : *actions) { |
| 124 | if (action->GetId() != id) { |
| 125 | continue; |
| 126 | } |
| 127 | |
| 128 | auto sequenceAction = |
| 129 | dynamic_cast<MacroActionSequence *>(action.get()); |
| 130 | if (!sequenceAction) { |
| 131 | continue; |
| 132 | } |
| 133 | // -2 is needed since the _lastIndex starts at -1 and the reset |
| 134 | // index starts at 1 |
| 135 | sequenceAction->_lastIdx = _resetIndex - 2; |
| 136 | nextMacroName = GetMacroName( |
| 137 | sequenceAction->GetNextMacro(false).GetMacro().get()); |
| 138 | } |
| 139 | SetTempVarValue("nextMacro", nextMacroName); |
| 140 | return true; |
| 141 | } |
| 142 | |
| 143 | void MacroActionSequence::SetupTempVars() |
| 144 | { |
nothing calls this directly
no test coverage detected