[libreoffice/f20] Resolves: fdo#80911 toggle fallback paper sizes

Caolán McNamara caolanm at fedoraproject.org
Fri Jul 4 12:36:27 UTC 2014


commit 9b104faa862213e24ed9735697dfe52caa48fff4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jul 4 13:36:20 2014 +0100

    Resolves: fdo#80911 toggle fallback paper sizes

 ...o-80911-toggle-original-page-orientation-.patch |   88 ++++++++++++++++++++
 libreoffice.spec                                   |    5 +-
 2 files changed, 92 insertions(+), 1 deletions(-)
---
diff --git a/0001-Resolves-fdo-80911-toggle-original-page-orientation-.patch b/0001-Resolves-fdo-80911-toggle-original-page-orientation-.patch
new file mode 100644
index 0000000..3592b8c
--- /dev/null
+++ b/0001-Resolves-fdo-80911-toggle-original-page-orientation-.patch
@@ -0,0 +1,88 @@
+From 1c6bd2c40fd03ec735fd6dbec01520f10ee1d55a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm at redhat.com>
+Date: Fri, 4 Jul 2014 13:28:08 +0100
+Subject: [PATCH] Resolves: fdo#80911 toggle original page orientation on paper
+ fallback
+
+User defined page sizes which match rotated paper sizes available to the
+printer don't work correctly when they are already in landscape mode.  i.e. the
+orientation should be toggled, not overwritten.
+
+Change-Id: I30dca5f988ad72319410a03f47eccff277be8640
+---
+ vcl/source/gdi/print.cxx | 18 ++++++++++++------
+ 1 file changed, 12 insertions(+), 6 deletions(-)
+
+diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
+index 6c8bdc4..ded7ebc 100644
+--- a/vcl/source/gdi/print.cxx
++++ b/vcl/source/gdi/print.cxx
+@@ -1352,6 +1352,7 @@ void Printer::ImplFindPaperFormatForUserSize( JobSetup& aJobSetup, bool bMatchNe
+     int     nLandscapeAngle = GetLandscapeAngle();
+     int     nPaperCount     = GetPaperInfoCount();
+     bool    bFound = false;
++    bool    bToggleOrient = false;
+ 
+     PaperInfo aInfo(pSetupData->mnPaperWidth, pSetupData->mnPaperHeight);
+ 
+@@ -1364,7 +1365,6 @@ void Printer::ImplFindPaperFormatForUserSize( JobSetup& aJobSetup, bool bMatchNe
+         {
+             pSetupData->mePaperFormat = ImplGetPaperFormat( rPaperInfo.getWidth(),
+                                                             rPaperInfo.getHeight() );
+-            pSetupData->meOrientation = ORIENTATION_PORTRAIT;
+             bFound = true;
+             break;
+         }
+@@ -1388,8 +1388,8 @@ void Printer::ImplFindPaperFormatForUserSize( JobSetup& aJobSetup, bool bMatchNe
+             {
+                 pSetupData->mePaperFormat = ImplGetPaperFormat( rPaperInfo.getWidth(),
+                                                                 rPaperInfo.getHeight() );
+-                pSetupData->meOrientation = ORIENTATION_LANDSCAPE;
+                 bFound = true;
++                bToggleOrient = true;
+                 break;
+             }
+         }
+@@ -1399,7 +1399,6 @@ void Printer::ImplFindPaperFormatForUserSize( JobSetup& aJobSetup, bool bMatchNe
+     {
+          sal_Int64 nBestMatch = SAL_MAX_INT64;
+          int nBestIndex = 0;
+-         Orientation eBestOrientation = ORIENTATION_PORTRAIT;
+          for( int i = 0; i < nPaperCount; i++ )
+          {
+              const PaperInfo& rPaperInfo = GetPaperInfo( i );
+@@ -1412,7 +1411,7 @@ void Printer::ImplFindPaperFormatForUserSize( JobSetup& aJobSetup, bool bMatchNe
+              {
+                  nBestMatch = nMatch;
+                  nBestIndex = i;
+-                 eBestOrientation = ORIENTATION_PORTRAIT;
++                 bToggleOrient = false;
+              }
+ 
+              // check landscape match
+@@ -1423,13 +1422,20 @@ void Printer::ImplFindPaperFormatForUserSize( JobSetup& aJobSetup, bool bMatchNe
+              {
+                  nBestMatch = nMatch;
+                  nBestIndex = i;
+-                 eBestOrientation = ORIENTATION_LANDSCAPE;
++                 bToggleOrient = true;
+              }
+          }
+          const PaperInfo& rBestInfo = GetPaperInfo( nBestIndex );
+          pSetupData->mePaperFormat = ImplGetPaperFormat( rBestInfo.getWidth(),
+                                                          rBestInfo.getHeight() );
+-         pSetupData->meOrientation = eBestOrientation;
++    }
++
++    if (bToggleOrient)
++    {
++        if (pSetupData->meOrientation == ORIENTATION_PORTRAIT)
++            pSetupData->meOrientation = ORIENTATION_LANDSCAPE;
++        else
++            pSetupData->meOrientation = ORIENTATION_PORTRAIT;
+     }
+ }
+ 
+-- 
+1.9.3
+
diff --git a/libreoffice.spec b/libreoffice.spec
index f8361ff..08da8d8 100644
--- a/libreoffice.spec
+++ b/libreoffice.spec
@@ -301,6 +301,7 @@ Patch43: 0001-Check-for-empty-before-calling-top.patch
 Patch44: 0002-Don-t-go-further-and-pop-the-stack-if-it-s-empty.patch
 Patch45: 0003-Use-a-new-fast-parser-instance-for-each-XML-fragment.patch
 Patch46: 0001-allow-build-with-icu-4.2.patch
+Patch47: 0001-Resolves-fdo-80911-toggle-original-page-orientation-.patch
 
 %define instdir %{_libdir}
 %define baseinstdir %{instdir}/libreoffice
@@ -2251,9 +2252,11 @@ update-desktop-database %{_datadir}/applications &> /dev/null || :
 %endif
 
 %changelog
-* Wed Jul 02 2014 Caolán McNamara <caolanm at redhat.com> - 1:4.2.5.2-3-UNBUILT
+* Fri Jul 04 2014 Caolán McNamara <caolanm at redhat.com> - 1:4.2.5.2-3
 - Resolves: rhbz#1089207 crash in OOXML import
 - allow building with icu 4.2
+- Resolves: fdo#80911 toggle fallback paper sizes when they are already
+  in landscape mode
 
 * Tue Jul 01 2014 Caolán McNamara <caolanm at redhat.com> - 1:4.2.5.2-2
 - fix detection of salesforce html pretending to be .xls by stripping


More information about the scm-commits mailing list