You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libreoffice/0001-Resolves-fdo-80911-don...

108 lines
4.0 KiB

From 8e4c1db34025dff41f4576865e49f1e9f990aa9f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Thu, 18 Sep 2014 11:40:26 +0100
Subject: [PATCH] Resolves: fdo#80911 don't swap notes page width/height
IsDraw doesn't mean the app/page is Draw
it means a slide in impress.
commit 7b31e45ec7106d2cfbdbb7915d97667ba710f81c
Date: Mon Jun 23 20:55:21 2014 +0100
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.
suggests the intent is for this to not affect Impress and to only
affect Draw, so this does that
(cherry picked from commit f1f89f0202232635e7fbbd7ca47de51755b2bce0)
Conflicts:
sd/source/ui/view/DocumentRenderer.cxx
Change-Id: I481a824ef244fd837992c893f6de0c051af0a26b
(cherry picked from commit cca120ad92ecab741ca9683f3cf76d9e4fc81729)
Conflicts:
sd/source/ui/view/DocumentRenderer.cxx
Change-Id: I9826f69d03de85ea8d2b2c025121599877798852
---
sd/source/ui/view/DocumentRenderer.cxx | 31 +++++++++++++++++--------------
1 file changed, 17 insertions(+), 14 deletions(-)
diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx
index 7080e9d..8e1739c 100644
--- a/sd/source/ui/view/DocumentRenderer.cxx
+++ b/sd/source/ui/view/DocumentRenderer.cxx
@@ -1409,7 +1409,9 @@ private:
PrintInfo& rInfo)
{
SdDrawDocument* pDocument = mrBase.GetMainViewShell()->GetDoc();
+ bool bIsDraw = pDocument->GetDocumentType() == DOCUMENT_TYPE_DRAW;
rInfo.meOrientation = ORIENTATION_PORTRAIT;
+ bool bDoDodgyHeightWidthFit = !bIsDraw && !mpOptions->IsNotes();
if( ! mpOptions->IsBooklet())
{
@@ -1418,9 +1420,9 @@ private:
else if (rInfo.maPageSize.Width() < rInfo.maPageSize.Height())
rInfo.meOrientation = ORIENTATION_LANDSCAPE;
- // Draw should abide by specified paper size
+ // Draw and Notes should abide by their specified paper size
Size aPaperSize;
- if (mpOptions->IsDraw())
+ if (!bDoDodgyHeightWidthFit)
{
aPaperSize.setWidth(rInfo.maPageSize.Width());
aPaperSize.setHeight(rInfo.maPageSize.Height());
@@ -1431,18 +1433,19 @@ private:
aPaperSize.setHeight(rInfo.mpPrinter->GetPaperSize().Height());
}
- if( (rInfo.meOrientation == ORIENTATION_LANDSCAPE &&
- (aPaperSize.Width() < aPaperSize.Height()))
- ||
- (rInfo.meOrientation == ORIENTATION_PORTRAIT &&
- (aPaperSize.Width() > aPaperSize.Height()))
- )
- {
- maPrintSize = awt::Size(aPaperSize.Height(), aPaperSize.Width());
- }
- else
+ maPrintSize = awt::Size(aPaperSize.Width(), aPaperSize.Height());
+
+ if (bDoDodgyHeightWidthFit)
{
- maPrintSize = awt::Size(aPaperSize.Width(), aPaperSize.Height());
+ if( (rInfo.meOrientation == ORIENTATION_LANDSCAPE &&
+ (aPaperSize.Width() < aPaperSize.Height()))
+ ||
+ (rInfo.meOrientation == ORIENTATION_PORTRAIT &&
+ (aPaperSize.Width() > aPaperSize.Height()))
+ )
+ {
+ maPrintSize = awt::Size(aPaperSize.Height(), aPaperSize.Width());
+ }
}
return true;
@@ -1497,7 +1500,7 @@ private:
aInfo.msTimeDate += GetSdrGlobalData().GetLocaleData()->getTime( Time( Time::SYSTEM ), false, false );
// Draw should use specified paper size when printing
- if (mpOptions->IsDraw())
+ if (mrBase.GetDocShell()->GetDocumentType() == DOCUMENT_TYPE_DRAW)
{
aInfo.maPrintSize = mrBase.GetDocument()->GetSdPage(0, PK_STANDARD)->GetSize();
maPrintSize = awt::Size(aInfo.maPrintSize.Width(),
--
1.9.3