using std::make_pair;
using std::min;
using std::pair;
+using std::set;
using std::shared_ptr;
using std::vector;
return const_iterator(this);
}
+set< RowItemOwner* > RowItemOwner::list_row_item_owners()
+{
+ set< RowItemOwner* > owners;
+ for (const auto &r : *this)
+ owners.insert(r->owner());
+ return owners;
+}
+
pair<int, int> RowItemOwner::v_extents() const
{
pair<int, int> extents(INT_MAX, INT_MIN);
*/
const_iterator end() const;
+ /**
+ * Makes a list of row item owners of all the row items that are
+ * decendants of this item.
+ */
+ std::set< RowItemOwner* > list_row_item_owners();
+
/**
* Computes the vertical extents of the contents of this row item owner.
* @return A pair containing the minimum and maximum y-values.
void View::restack_all_row_items()
{
- // Make a set of owners
- unordered_set< RowItemOwner* > owners;
- for (const auto &r : *this)
- owners.insert(r->owner());
-
- // Make a list that is sorted from deepest first
+ // Make a list of owners that is sorted from deepest first
+ const auto owners = list_row_item_owners();
vector< RowItemOwner* > sorted_owners(owners.begin(), owners.end());
sort(sorted_owners.begin(), sorted_owners.end(),
[](const RowItemOwner* a, const RowItemOwner *b) {