ce7a23d
From 8e4c1db34025dff41f4576865e49f1e9f990aa9f Mon Sep 17 00:00:00 2001
ea1e04f
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
ce7a23d
Date: Thu, 18 Sep 2014 11:40:26 +0100
ea1e04f
Subject: [PATCH] Resolves: fdo#80911 don't swap notes page width/height
ea1e04f
ce7a23d
IsDraw doesn't mean the app/page is Draw
ce7a23d
ce7a23d
it means a slide in impress.
ce7a23d
ce7a23d
commit 7b31e45ec7106d2cfbdbb7915d97667ba710f81c
ce7a23d
Date:   Mon Jun 23 20:55:21 2014 +0100
ce7a23d
    Make Draw use paper size when printing - fdo#63905
ce7a23d
ce7a23d
    Previously, Draw/Impress use the default size from the printer.
ce7a23d
    Now Draw uses the paper size (specified in page formatting).
ce7a23d
    Impress still uses the old method - not sure if this is correct
ce7a23d
    but printing handouts etc probably complicate print/paper size.
ce7a23d
ce7a23d
suggests the intent is for this to not affect Impress and to only
ce7a23d
affect Draw, so this does that
ce7a23d
ce7a23d
(cherry picked from commit f1f89f0202232635e7fbbd7ca47de51755b2bce0)
ce7a23d
ce7a23d
Conflicts:
ce7a23d
	sd/source/ui/view/DocumentRenderer.cxx
ce7a23d
ce7a23d
Change-Id: I481a824ef244fd837992c893f6de0c051af0a26b
ce7a23d
ea1e04f
(cherry picked from commit cca120ad92ecab741ca9683f3cf76d9e4fc81729)
ce7a23d
ce7a23d
Conflicts:
ce7a23d
	sd/source/ui/view/DocumentRenderer.cxx
ce7a23d
ce7a23d
Change-Id: I9826f69d03de85ea8d2b2c025121599877798852
ea1e04f
---
ce7a23d
 sd/source/ui/view/DocumentRenderer.cxx | 31 +++++++++++++++++--------------
ce7a23d
 1 file changed, 17 insertions(+), 14 deletions(-)
ea1e04f
ea1e04f
diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx
ce7a23d
index 7080e9d..8e1739c 100644
ea1e04f
--- a/sd/source/ui/view/DocumentRenderer.cxx
ea1e04f
+++ b/sd/source/ui/view/DocumentRenderer.cxx
daaa2f4
@@ -1409,6 +1409,7 @@ private:
ea1e04f
         SdDrawDocument* pDocument = mrBase.GetMainViewShell()->GetDoc();
daaa2f4
         bool bIsDraw = pDocument->GetDocumentType() == DOCUMENT_TYPE_DRAW;
ea1e04f
         rInfo.meOrientation = ORIENTATION_PORTRAIT;
2168af3
+        bool bDoDodgyHeightWidthFit = !bIsDraw && !mpOptions->IsNotes();
ea1e04f
 
ea1e04f
         if( ! mpOptions->IsBooklet())
ea1e04f
         {
ce7a23d
@@ -1418,9 +1420,9 @@ private:
ea1e04f
         else if (rInfo.maPageSize.Width() < rInfo.maPageSize.Height())
ea1e04f
             rInfo.meOrientation = ORIENTATION_LANDSCAPE;
ea1e04f
 
ea1e04f
-        // Draw should abide by specified paper size
ea1e04f
+        // Draw and Notes should abide by their specified paper size
ea1e04f
         Size aPaperSize;
daaa2f4
-        if (bIsDraw)
ea1e04f
+        if (!bDoDodgyHeightWidthFit)
ea1e04f
         {
ea1e04f
             aPaperSize.setWidth(rInfo.maPageSize.Width());
ea1e04f
             aPaperSize.setHeight(rInfo.maPageSize.Height());
ce7a23d
@@ -1431,18 +1433,19 @@ private:
ea1e04f
             aPaperSize.setHeight(rInfo.mpPrinter->GetPaperSize().Height());
ea1e04f
         }
ea1e04f
 
ea1e04f
-        if( (rInfo.meOrientation == ORIENTATION_LANDSCAPE &&
ea1e04f
-              (aPaperSize.Width() < aPaperSize.Height()))
ea1e04f
-           ||
ea1e04f
-            (rInfo.meOrientation == ORIENTATION_PORTRAIT &&
ea1e04f
-              (aPaperSize.Width() > aPaperSize.Height()))
ea1e04f
-          )
ea1e04f
-        {
ea1e04f
-            maPrintSize = awt::Size(aPaperSize.Height(), aPaperSize.Width());
ea1e04f
-        }
ea1e04f
-        else
ea1e04f
+        maPrintSize = awt::Size(aPaperSize.Width(), aPaperSize.Height());
ea1e04f
+
ea1e04f
+        if (bDoDodgyHeightWidthFit)
ea1e04f
         {
ea1e04f
-            maPrintSize = awt::Size(aPaperSize.Width(), aPaperSize.Height());
ea1e04f
+            if( (rInfo.meOrientation == ORIENTATION_LANDSCAPE &&
ea1e04f
+                  (aPaperSize.Width() < aPaperSize.Height()))
ea1e04f
+               ||
ea1e04f
+                (rInfo.meOrientation == ORIENTATION_PORTRAIT &&
ea1e04f
+                  (aPaperSize.Width() > aPaperSize.Height()))
ea1e04f
+              )
ea1e04f
+            {
ea1e04f
+                maPrintSize = awt::Size(aPaperSize.Height(), aPaperSize.Width());
ea1e04f
+            }
ea1e04f
         }
ea1e04f
 
ea1e04f
         return true;
ea1e04f
-- 
ea1e04f
1.9.3
ea1e04f