From fbc458df660f23c58c94b75d6d189f61ecb6f52e Mon Sep 17 00:00:00 2001 From: wandererfan Date: Tue, 6 Dec 2022 08:09:23 -0500 Subject: [PATCH] [TD]fix parent page counting - was returning inflated counts of owning page --- src/Mod/TechDraw/App/DrawView.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Mod/TechDraw/App/DrawView.cpp b/src/Mod/TechDraw/App/DrawView.cpp index 2abda6ef84..f8d4c46bb0 100644 --- a/src/Mod/TechDraw/App/DrawView.cpp +++ b/src/Mod/TechDraw/App/DrawView.cpp @@ -323,12 +323,7 @@ std::vector DrawView::findAllParentPages() const DrawViewCollection *collection = nullptr; std::vector 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(parent); } else if (parent->getTypeId().isDerivedFrom(DrawViewCollection::getClassTypeId())) { @@ -341,10 +336,14 @@ std::vector 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 parent = getInList();