summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEilidh McAdam <eilidh@lanedo.com>2014-06-23 20:55:21 +0100
committerMatúš Kukan <matus.kukan@collabora.com>2014-08-19 03:34:34 -0500
commit7b31e45ec7106d2cfbdbb7915d97667ba710f81c (patch)
treee02c127290282dc30a6714040f802a06f6d1e38a
parent0c8c3a536b07d3adb8cd558debd0d409cabb8b9e (diff)
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/9866 Reviewed-by: Matúš Kukan <matus.kukan@collabora.com> Tested-by: Matúš Kukan <matus.kukan@collabora.com>
-rw-r--r--sd/source/ui/view/DocumentRenderer.cxx33
1 files changed, 28 insertions, 5 deletions
diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx
index ba5445d600eb..c370a69530c2 100644
--- a/sd/source/ui/view/DocumentRenderer.cxx
+++ b/sd/source/ui/view/DocumentRenderer.cxx
@@ -1369,7 +1369,19 @@ private:
else if (rInfo.maPageSize.Width() < rInfo.maPageSize.Height())
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 &&
(aPaperSize.Width() < aPaperSize.Height()))
||
@@ -1432,10 +1444,21 @@ private:
if (mpOptions->IsTime())
aInfo.msTimeDate += GetSdrGlobalData().GetLocaleData()->getTime( Time( Time::SYSTEM ), false, false );
- aInfo.maPrintSize = aInfo.mpPrinter->GetOutputSize();
- maPrintSize = awt::Size(
- aInfo.mpPrinter->GetPaperSize().Width(),
- aInfo.mpPrinter->GetPaperSize().Height());
+
+ // Draw should use specified paper size when printing
+ if (mpOptions->IsDraw())
+ {
+ 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())
{