| 1353 | } |
| 1354 | |
| 1355 | void MacroTree::Down(std::shared_ptr<Macro> item) const |
| 1356 | { |
| 1357 | auto lock = LockContext(); |
| 1358 | auto below = GetModel()->Neighbor(item, false); |
| 1359 | if (!below) { |
| 1360 | return; |
| 1361 | } |
| 1362 | |
| 1363 | if (item->IsSubitem()) { |
| 1364 | // Nowhere to move to, when the item below is a group or |
| 1365 | // regular entry |
| 1366 | if (!below->IsSubitem()) { |
| 1367 | return; |
| 1368 | } |
| 1369 | |
| 1370 | MoveItemAfter(item, below); |
| 1371 | return; |
| 1372 | } |
| 1373 | |
| 1374 | if (item->IsGroup()) { |
| 1375 | if (below->IsSubitem()) { |
| 1376 | below = GetModel()->FindEndOfGroup(below, false); |
| 1377 | |
| 1378 | // Nowhere to move group to |
| 1379 | if (GetModel()->IsLastItem(below)) { |
| 1380 | return; |
| 1381 | } |
| 1382 | |
| 1383 | below = GetModel()->Neighbor(below, false); |
| 1384 | } |
| 1385 | MoveItemAfter(item, below); |
| 1386 | return; |
| 1387 | } |
| 1388 | |
| 1389 | MoveItemAfter(item, below); |
| 1390 | } |
| 1391 | |
| 1392 | void MacroTree::GroupSelectedItems() |
| 1393 | { |
nothing calls this directly
no test coverage detected