]> sigrok.org Git - pulseview.git/blobdiff - pv/view/rowitemowner.cpp
RowItemOwner: Added list_row_item_owners
[pulseview.git] / pv / view / rowitemowner.cpp
index 625620ed0dbe2d074d82764cd6bbd47f3f8e0fed..ba2e1f4838ab44874b831b7ad06d9b79c12dd70c 100644 (file)
@@ -27,6 +27,7 @@ using std::max;
 using std::make_pair;
 using std::min;
 using std::pair;
+using std::set;
 using std::shared_ptr;
 using std::vector;
 
@@ -92,9 +93,18 @@ RowItemOwner::const_iterator RowItemOwner::end() const
        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(0, 0);
+       pair<int, int> extents(INT_MAX, INT_MIN);
+
        for (const shared_ptr<RowItem> r : child_items()) {
                assert(r);
                if (!r->enabled())