diff --git a/src/document/UBDocumentController.cpp b/src/document/UBDocumentController.cpp index 523b87da..93680e16 100644 --- a/src/document/UBDocumentController.cpp +++ b/src/document/UBDocumentController.cpp @@ -1780,7 +1780,16 @@ void UBDocumentController::createNewDocument() QDateTime now = QDateTime::currentDateTime(); - QString documentName = docModel->adjustNameForParentIndex(now.toString(Qt::SystemLocaleShortDate), selectedIndex.parent()); + QString documentName = ""; + if (docModel->isCatalog(selectedIndex)) + { + documentName = docModel->adjustNameForParentIndex(now.toString(Qt::SystemLocaleShortDate), selectedIndex); + } + else + { + documentName = docModel->adjustNameForParentIndex(now.toString(Qt::SystemLocaleShortDate), selectedIndex.parent()); + } + UBDocumentProxy *document = pManager->createDocument(groupName, documentName);