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

Method FindEndOfGroup

lib/macro/macro-tree.cpp:605–630  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

603}
604
605std::shared_ptr<Macro>
606MacroTreeModel::FindEndOfGroup(const std::shared_ptr<Macro> &m,
607 bool above) const
608{
609 auto endOfGroup = Neighbor(m, above);
610 if (!endOfGroup) {
611 return m;
612 }
613
614 if (above) {
615 while (!endOfGroup->IsGroup()) {
616 endOfGroup = Neighbor(endOfGroup, above);
617 }
618 } else {
619 while (endOfGroup->IsSubitem() &&
620 GetItemMacroIndex(endOfGroup) + 1 !=
621 (int)_macros.size()) {
622 endOfGroup = Neighbor(endOfGroup, above);
623 }
624 if (!endOfGroup->IsSubitem()) {
625 endOfGroup = Neighbor(endOfGroup, !above);
626 }
627 }
628
629 return endOfGroup;
630}
631
632std::shared_ptr<Macro> MacroTreeModel::GetCurrentMacro() const
633{

Callers 2

UpMethod · 0.80
DownMethod · 0.80

Calls 3

IsGroupMethod · 0.80
IsSubitemMethod · 0.80
sizeMethod · 0.80

Tested by

no test coverage detected