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

(grafted from 235a477541863a5ec59ee6115ebfdab5f746b8ff)

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2019-02-13 16:41:31 +02:00
parent 883d2c04f6
commit 170238ede7
4 changed files with 14 additions and 4 deletions

View File

@ -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.

View File

@ -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;

View File

@ -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:

View File

@ -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);