From 4ec454a9ef6ad0c5de5c60af30d5ca164b0d82fd Mon Sep 17 00:00:00 2001
From: Ronan Le Tiec <ronanletiec@gmail.com>
Date: Sun, 14 Mar 2021 16:57:20 +0100
Subject: [PATCH] export title with sheet name

---
 src/app/puzzle/vpmainwindow.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/app/puzzle/vpmainwindow.cpp b/src/app/puzzle/vpmainwindow.cpp
index cdef83834..9988ae8dd 100644
--- a/src/app/puzzle/vpmainwindow.cpp
+++ b/src/app/puzzle/vpmainwindow.cpp
@@ -784,7 +784,7 @@ void VPMainWindow::generateTiledPdf(QString fileName)
 
         printer->setOutputFileName(fileName);
         printer->setResolution(static_cast<int>(PrintDPI));
-        printer->setDocName("Test"); // FIXME
+        printer->setDocName(m_layout->GetFocusedSheet()->GetName());
 
         // -------------  Set up the painter
         QPainter painter;
@@ -1367,7 +1367,7 @@ void VPMainWindow::on_pushButtonSheetExport_clicked()
         generator.setFileName(fileName);
         generator.setSize(QSize(qFloor(s.width()),qFloor(s.height())));
         generator.setViewBox(r);
-        generator.setTitle(tr("Pattern"));
+        generator.setTitle(m_layout->GetFocusedSheet()->GetName());
         generator.setDescription(m_layout->GetDescription().toHtmlEscaped());
         generator.setResolution(static_cast<int>(PrintDPI));