MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / Up

Method Up

lib/macro/macro-tree.cpp:1329–1353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1327}
1328
1329void MacroTree::Up(std::shared_ptr<Macro> item) const
1330{
1331 auto lock = LockContext();
1332 auto above = GetModel()->Neighbor(item, true);
1333 if (!above) {
1334 return;
1335 }
1336
1337 if (item->IsSubitem()) {
1338 // Nowhere to move to, when the item above is a group or
1339 // regular entry
1340 if (!above->IsSubitem()) {
1341 return;
1342 }
1343
1344 MoveItemBefore(item, above);
1345 return;
1346 }
1347
1348 if (above->IsSubitem()) {
1349 above = GetModel()->FindEndOfGroup(above, true);
1350 }
1351
1352 MoveItemBefore(item, above);
1353}
1354
1355void MacroTree::Down(std::shared_ptr<Macro> item) const
1356{

Callers

nothing calls this directly

Calls 4

LockContextFunction · 0.85
NeighborMethod · 0.80
IsSubitemMethod · 0.80
FindEndOfGroupMethod · 0.80

Tested by

no test coverage detected