[TD]fix templated autofill for sheet

This commit is contained in:
wandererfan
2024-04-06 09:21:20 -04:00
committed by WandererFan
parent 53e97bbba1
commit ebdc3c255d
4 changed files with 63 additions and 75 deletions

View File

@@ -136,9 +136,11 @@ QString DrawTemplate::getAutofillValue(const QString &id) const
std::vector<DocumentObject *> pages = getDocument()->getObjectsOfType(TechDraw::DrawPage::getClassTypeId());
std::vector<QString> pageNames;
for (auto page : pages) {
pageNames.push_back(QString::fromUtf8(page->Label.getValue()));
if (page->isAttachedToDocument() &&
!page->testStatus(App::ObjectStatus::Remove)) {
pageNames.push_back(QString::fromUtf8(page->Label.getValue()));
}
}
QCollator collator;
std::sort(pageNames.begin(), pageNames.end(), collator);