summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorClément Lassieur <clement@lassieur.org>2014-12-21 17:14:34 +0100
committerKatarina Behrens <bubli@bubli.org>2015-03-31 20:19:45 +0000
commit3feb370bc82dedfd7dc281aecf8dd670176e52ff (patch)
tree05f668326ce66fa60c75edd7c0de8a1332333541 /sd
parent9f2e07aadbf721488aadf19b4891829b7ebedb97 (diff)
tdf#63905: fix regression by using paper size set in printer properties
Change-Id: I51407c4b7ebbe3782539e1cb6f3c8294ae29566e Reviewed-on: https://gerrit.libreoffice.org/13763 Reviewed-by: Katarina Behrens <bubli@bubli.org> Tested-by: Katarina Behrens <bubli@bubli.org>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/view/DocumentRenderer.cxx19
1 files changed, 11 insertions, 8 deletions
diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx
index a421de2bc64b..8802c7f2701c 100644
--- a/sd/source/ui/view/DocumentRenderer.cxx
+++ b/sd/source/ui/view/DocumentRenderer.cxx
@@ -161,6 +161,12 @@ namespace {
return GetBoolValue("PrintProspect", false);
}
+ bool IsPrinterPreferred(DocumentType eDocType) const
+ {
+ bool bIsDraw = eDocType == DOCUMENT_TYPE_DRAW;
+ return IsTilePage() || IsPageSize() || IsBooklet() || (!bIsDraw && !IsNotes());
+ }
+
bool IsPrintExcluded() const
{
return (IsNotes() || IsDraw() || IsHandout()) && IsHiddenPages();
@@ -1359,9 +1365,7 @@ private:
PrintInfo& rInfo)
{
SdDrawDocument* pDocument = mrBase.GetMainViewShell()->GetDoc();
- bool bIsDraw = pDocument->GetDocumentType() == DOCUMENT_TYPE_DRAW;
rInfo.meOrientation = ORIENTATION_PORTRAIT;
- bool bDoDodgyHeightWidthFit = mpOptions->IsBooklet() || (!bIsDraw && !mpOptions->IsNotes());
if( ! mpOptions->IsBooklet())
{
@@ -1370,10 +1374,9 @@ private:
else if (rInfo.maPageSize.Width() < rInfo.maPageSize.Height())
rInfo.meOrientation = ORIENTATION_LANDSCAPE;
- // Draw and Notes should abide by their specified paper size, except
- // for booklets
+ // Draw and Notes should usually abide by their specified paper size
Size aPaperSize;
- if (!bDoDodgyHeightWidthFit)
+ if (!mpOptions->IsPrinterPreferred(pDocument->GetDocumentType()))
{
aPaperSize.setWidth(rInfo.maPageSize.Width());
aPaperSize.setHeight(rInfo.maPageSize.Height());
@@ -1386,7 +1389,7 @@ private:
maPrintSize = awt::Size(aPaperSize.Width(), aPaperSize.Height());
- if (bDoDodgyHeightWidthFit)
+ if (mpOptions->IsPrinterPreferred(pDocument->GetDocumentType()))
{
if( (rInfo.meOrientation == ORIENTATION_LANDSCAPE &&
(aPaperSize.Width() < aPaperSize.Height()))
@@ -1448,8 +1451,8 @@ private:
if (mpOptions->IsTime())
aInfo.msTimeDate += GetSdrGlobalData().GetLocaleData()->getTime( ::tools::Time( ::tools::Time::SYSTEM ), false, false );
- // Draw should use specified paper size when printing, except for booklets
- if (!mpOptions->IsBooklet() && mrBase.GetDocShell()->GetDocumentType() == DOCUMENT_TYPE_DRAW)
+ // Draw and Notes should usually use specified paper size when printing
+ if (!mpOptions->IsPrinterPreferred(mrBase.GetDocShell()->GetDocumentType()))
{
aInfo.maPrintSize = mrBase.GetDocument()->GetSdPage(0, PK_STANDARD)->GetSize();
maPrintSize = awt::Size(aInfo.maPrintSize.Width(),