diff --git a/ChangeLog.txt b/ChangeLog.txt index c6e40eaed..0cdbcf44c 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -26,6 +26,7 @@ - [#938] Dialog Seam Allowance doesn't block user from saving broken formula. - [#939] Calling Formula Wizard through property explorer doesn't refresh formula. - [#937] Wrong symmetrical seam corners on pieces. +- [#942] Save Layout mode ignores paper format for tiled PDF. # Version 0.6.1 October 23, 2018 - [#885] Regression. Broken support for multi size measurements. diff --git a/src/app/valentina/dialogs/vabstractlayoutdialog.cpp b/src/app/valentina/dialogs/vabstractlayoutdialog.cpp index 89a555f02..40d67ea51 100644 --- a/src/app/valentina/dialogs/vabstractlayoutdialog.cpp +++ b/src/app/valentina/dialogs/vabstractlayoutdialog.cpp @@ -81,7 +81,7 @@ void VAbstractLayoutDialog::InitTemplates(QComboBox *comboBoxTemplates) } //--------------------------------------------------------------------------------------------------------------------- -QSizeF VAbstractLayoutDialog::GetTemplateSize(PaperSizeTemplate tmpl, Unit unit) const +QSizeF VAbstractLayoutDialog::GetTemplateSize(PaperSizeTemplate tmpl, Unit unit) { qreal width = 0; qreal height = 0; @@ -155,7 +155,7 @@ QSizeF VAbstractLayoutDialog::GetTemplateSize(PaperSizeTemplate tmpl, Unit unit) } //--------------------------------------------------------------------------------------------------------------------- -QSizeF VAbstractLayoutDialog::RoundTemplateSize(qreal width, qreal height, Unit unit) const +QSizeF VAbstractLayoutDialog::RoundTemplateSize(qreal width, qreal height, Unit unit) { qreal w = 0; qreal h = 0; diff --git a/src/app/valentina/dialogs/vabstractlayoutdialog.h b/src/app/valentina/dialogs/vabstractlayoutdialog.h index d2f1f4712..3f1615a80 100644 --- a/src/app/valentina/dialogs/vabstractlayoutdialog.h +++ b/src/app/valentina/dialogs/vabstractlayoutdialog.h @@ -55,14 +55,15 @@ public: Custom = 15}; explicit VAbstractLayoutDialog(QWidget *parent = nullptr); - QSizeF GetTemplateSize(PaperSizeTemplate tmpl, Unit unit) const; + + static QSizeF GetTemplateSize(PaperSizeTemplate tmpl, Unit unit); protected: typedef QStringList FormatsVector; const static FormatsVector pageFormatNames; typedef int VIndexType; - QSizeF RoundTemplateSize(qreal width, qreal height, Unit unit) const; + static QSizeF RoundTemplateSize(qreal width, qreal height, Unit unit); void InitTemplates(QComboBox *comboBoxTemplates); private: diff --git a/src/app/valentina/mainwindowsnogui.cpp b/src/app/valentina/mainwindowsnogui.cpp index f85b8297e..f2c888ffd 100644 --- a/src/app/valentina/mainwindowsnogui.cpp +++ b/src/app/valentina/mainwindowsnogui.cpp @@ -1381,6 +1381,14 @@ void MainWindowsNoGUI::SetPrinterSettings(QPrinter *printer, const PrintType &pr printer->setPaperSize (pSZ); } } + else + { + if (not m_dialogSaveLayout.isNull()) + { + VAbstractLayoutDialog::PaperSizeTemplate tiledFormat = m_dialogSaveLayout->GetTiledPageFormat(); + printer->setPaperSize (m_dialogSaveLayout->GetTemplateSize(tiledFormat, Unit::Mm), QPrinter::Millimeter); + } + } printer->setFullPage(ignorePrinterFields);