[TD]fix parent page counting

- was returning inflated counts of owning page
This commit is contained in:
wandererfan
2022-12-06 08:09:23 -05:00
committed by WandererFan
parent da40295e0a
commit fbc458df66

View File

@@ -323,12 +323,7 @@ std::vector<DrawPage*> DrawView::findAllParentPages() const
DrawViewCollection *collection = nullptr;
std::vector<App::DocumentObject*> parentsAll = getInList();
//prune the duplicates
std::sort(parentsAll.begin(), parentsAll.end());
auto last = std::unique(parentsAll.begin(), parentsAll.end());
parentsAll.erase(last, parentsAll.end());
for (auto& parent : parentsAll) {
for (auto& parent : parentsAll) {
if (parent->getTypeId().isDerivedFrom(DrawPage::getClassTypeId())) {
page = static_cast<TechDraw::DrawPage*>(parent);
} else if (parent->getTypeId().isDerivedFrom(DrawViewCollection::getClassTypeId())) {
@@ -341,10 +336,14 @@ std::vector<DrawPage*> DrawView::findAllParentPages() const
}
}
//prune the duplicates
std::sort(result.begin(), result.end());
auto last = std::unique(result.begin(), result.end());
result.erase(last, result.end());
return result;
}
bool DrawView::isInClip()
{
std::vector<App::DocumentObject*> parent = getInList();