Merge pull request #5013 from mwganson/techdraw

[TechDraw] prevent crash where user duplicates page without also dupl…
This commit is contained in:
Yorik van Havre
2021-09-07 12:47:53 +02:00
committed by GitHub
3 changed files with 26 additions and 1 deletions

View File

@@ -481,7 +481,11 @@ void MDIViewPage::fixOrphans(bool force)
m_view->removeQView(qv);
} else {
TechDraw::DrawPage* pp = qv->getViewObject()->findParentPage();
if (thisPage != pp) {
/** avoid crash where a view might have more than one parent page
* if the user duplicated the page without duplicating dependencies
*/
int numParentPages = qv->getViewObject()->countParentPages();
if (thisPage != pp && numParentPages == 1) {
m_view->removeQView(qv);
}
}