Fixed issue #942. Save Layout mode ignores paper format for tiled PDF.

--HG--
branch : release
This commit is contained in:
Roman Telezhynskyi 2019-02-13 16:41:31 +02:00
parent d35488b91f
commit ced67250a7
4 changed files with 14 additions and 4 deletions

View File

@ -13,6 +13,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.

View File

@ -81,7 +81,7 @@ void VAbstractLayoutDialog::InitTemplates(QComboBox *comboBoxTemplates)
}
//---------------------------------------------------------------------------------------------------------------------
QSizeF VAbstractLayoutDialog::GetTemplateSize(const PaperSizeTemplate &tmpl, const Unit &unit) const
QSizeF VAbstractLayoutDialog::GetTemplateSize(const PaperSizeTemplate &tmpl, const Unit &unit)
{
qreal width = 0;
qreal height = 0;
@ -155,7 +155,7 @@ QSizeF VAbstractLayoutDialog::GetTemplateSize(const PaperSizeTemplate &tmpl, con
}
//---------------------------------------------------------------------------------------------------------------------
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;

View File

@ -56,13 +56,14 @@ public:
explicit VAbstractLayoutDialog(QWidget *parent = nullptr);
static QSizeF GetTemplateSize(const PaperSizeTemplate &tmpl, const Unit &unit);
protected:
typedef QStringList FormatsVector;
const static FormatsVector pageFormatNames;
typedef int VIndexType;
QSizeF GetTemplateSize(const PaperSizeTemplate &tmpl, const Unit &unit) const;
QSizeF RoundTemplateSize(qreal width, qreal height, Unit unit) const;
static QSizeF RoundTemplateSize(qreal width, qreal height, Unit unit);
void InitTemplates(QComboBox *comboBoxTemplates);
private:

View File

@ -1342,6 +1342,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);