Kaydet (Commit) 7b31e45e authored tarafından Eilidh McAdam's avatar Eilidh McAdam Kaydeden (comit) Matúš Kukan

Make Draw use paper size when printing - fdo#63905

Previously, Draw/Impress use the default size from the printer.
Now Draw uses the paper size (specified in page formatting).
Impress still uses the old method - not sure if this is correct
but printing handouts etc probably complicate print/paper size.

Change-Id: If90bae4ac59cd95dd50fcd8deb25fd900756193e
Reviewed-on: https://gerrit.libreoffice.org/9866Reviewed-by: 's avatarMatúš Kukan <matus.kukan@collabora.com>
Tested-by: 's avatarMatúš Kukan <matus.kukan@collabora.com>
üst 0c8c3a53
...@@ -1369,7 +1369,19 @@ private: ...@@ -1369,7 +1369,19 @@ private:
else if (rInfo.maPageSize.Width() < rInfo.maPageSize.Height()) else if (rInfo.maPageSize.Width() < rInfo.maPageSize.Height())
rInfo.meOrientation = ORIENTATION_LANDSCAPE; rInfo.meOrientation = ORIENTATION_LANDSCAPE;
const Size aPaperSize (rInfo.mpPrinter->GetPaperSize()); // Draw should abide by specified paper size
Size aPaperSize;
if (mpOptions->IsDraw())
{
aPaperSize.setWidth(rInfo.maPageSize.Width());
aPaperSize.setHeight(rInfo.maPageSize.Height());
}
else
{
aPaperSize.setWidth(rInfo.mpPrinter->GetPaperSize().Width());
aPaperSize.setHeight(rInfo.mpPrinter->GetPaperSize().Height());
}
if( (rInfo.meOrientation == ORIENTATION_LANDSCAPE && if( (rInfo.meOrientation == ORIENTATION_LANDSCAPE &&
(aPaperSize.Width() < aPaperSize.Height())) (aPaperSize.Width() < aPaperSize.Height()))
|| ||
...@@ -1432,10 +1444,21 @@ private: ...@@ -1432,10 +1444,21 @@ private:
if (mpOptions->IsTime()) if (mpOptions->IsTime())
aInfo.msTimeDate += GetSdrGlobalData().GetLocaleData()->getTime( Time( Time::SYSTEM ), false, false ); aInfo.msTimeDate += GetSdrGlobalData().GetLocaleData()->getTime( Time( Time::SYSTEM ), false, false );
aInfo.maPrintSize = aInfo.mpPrinter->GetOutputSize();
maPrintSize = awt::Size( // Draw should use specified paper size when printing
aInfo.mpPrinter->GetPaperSize().Width(), if (mpOptions->IsDraw())
aInfo.mpPrinter->GetPaperSize().Height()); {
aInfo.maPrintSize = mrBase.GetDocument()->GetSdPage(0, PK_STANDARD)->GetSize();
maPrintSize = awt::Size(aInfo.maPrintSize.Width(),
aInfo.maPrintSize.Height());
}
else
{
aInfo.maPrintSize = aInfo.mpPrinter->GetOutputSize();
maPrintSize = awt::Size(
aInfo.mpPrinter->GetPaperSize().Width(),
aInfo.mpPrinter->GetPaperSize().Height());
}
switch (mpOptions->GetOutputQuality()) switch (mpOptions->GetOutputQuality())
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment