Blame SOURCES/0001-Resolves-fdo-80911-don-t-swap-notes-page-width-heigh.patch

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