diff --git a/src/app/puzzle/vpmainwindow.cpp b/src/app/puzzle/vpmainwindow.cpp index fc2627055..82a35ba90 100644 --- a/src/app/puzzle/vpmainwindow.cpp +++ b/src/app/puzzle/vpmainwindow.cpp @@ -4049,13 +4049,21 @@ void VPMainWindow::on_ExportLayout() return; } - DialogSaveManualLayout dialog(sheets.size(), false, m_layout->LayoutSettings().GetTitle(), this); + const QString layoutTitle = m_layout->LayoutSettings().GetTitle(); + const QString fileName = layoutTitle.isEmpty() ? QFileInfo(curFile).baseName() : layoutTitle; + + DialogSaveManualLayout dialog(sheets.size(), false, fileName, this); if (dialog.exec() == QDialog::Rejected) { return; } + if (dialog.FileName().isEmpty()) + { + return; + } + VPExportData data; data.format = dialog.Format(); data.path = dialog.Path(); @@ -4149,13 +4157,21 @@ void VPMainWindow::on_ExportSheet() } } - DialogSaveManualLayout dialog(1, false, sheet->GetName(), this); + const QString sheetTitle = sheet->GetName(); + const QString fileName = sheetTitle.isEmpty() ? QFileInfo(curFile).baseName() : sheetTitle; + + DialogSaveManualLayout dialog(1, false, fileName, this); if (dialog.exec() == QDialog::Rejected) { return; } + if (dialog.FileName().isEmpty()) + { + return; + } + VPExportData data; data.format = dialog.Format(); data.path = dialog.Path();