[Libreoffice-commits] core.git: include/vcl vcl/source vcl/unx

Noel Grandin noel.grandin at collabora.co.uk
Fri Feb 10 06:05:20 UTC 2017


 include/vcl/pdfwriter.hxx           |    4 ++--
 vcl/source/gdi/pdfwriter_impl.cxx   |    9 ++-------
 vcl/unx/generic/print/genprnpsp.cxx |    2 +-
 3 files changed, 5 insertions(+), 10 deletions(-)

New commits:
commit b3b2f2b95070f1a385c51f432a52b9c84470913f
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Feb 8 15:13:54 2017 +0200

    convert Orientation to scoped enum
    
    and drop unused enumerators
    
    Change-Id: I2f42f0f441cf9ce96338d40382acb6d75ea1e1a0
    Reviewed-on: https://gerrit.libreoffice.org/34061
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx
index c8cfdba..c660f16 100644
--- a/include/vcl/pdfwriter.hxx
+++ b/include/vcl/pdfwriter.hxx
@@ -101,7 +101,7 @@ public:
         {}
     };
 
-    enum Orientation { Portrait, Landscape, Seascape, Inherit };
+    enum class Orientation { Portrait, Inherit };
 
     // in case the below enum is added PDF_1_6 PDF_1_7, please add them just after PDF_1_5
     enum class PDFVersion { PDF_1_2, PDF_1_3, PDF_1_4, PDF_1_5, PDF_A_1 };//i59651, PDF/A-1b & -1a, only -1b implemented for now
@@ -685,7 +685,7 @@ The following structure describes the permissions used in PDF security
         Colors and other state information MUST
         be set again or are undefined.
     */
-    void NewPage( sal_Int32 nPageWidth, sal_Int32 nPageHeight, Orientation eOrientation = Inherit );
+    void NewPage( sal_Int32 nPageWidth, sal_Int32 nPageHeight, Orientation eOrientation = Orientation::Inherit );
     /** Play a metafile like an outputdevice would do
     */
     struct PlayMetafileContext
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 8fbf043..5c3aede 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -1226,13 +1226,8 @@ bool PDFWriterImpl::PDFPage::emit(sal_Int32 nParentObject )
     }
     switch( m_eOrientation )
     {
-        case PDFWriter::Landscape: aLine.append( "/Rotate 90\n" );break;
-        case PDFWriter::Seascape:  aLine.append( "/Rotate -90\n" );break;
-        case PDFWriter::Portrait:  aLine.append( "/Rotate 0\n" );break;
-
-        case PDFWriter::Inherit:
-        default:
-            break;
+        case PDFWriter::Orientation::Portrait: aLine.append( "/Rotate 0\n" );break;
+        case PDFWriter::Orientation::Inherit:  break;
     }
     int nAnnots = m_aAnnotations.size();
     if( nAnnots > 0 )
diff --git a/vcl/unx/generic/print/genprnpsp.cxx b/vcl/unx/generic/print/genprnpsp.cxx
index 2fefc7e..25bc3a1 100644
--- a/vcl/unx/generic/print/genprnpsp.cxx
+++ b/vcl/unx/generic/print/genprnpsp.cxx
@@ -1135,7 +1135,7 @@ bool PspSalPrinter::StartJob( const OUString* i_pFileName, const OUString& i_rJo
 
             xWriter->NewPage( TenMuToPt( aNewParm.maPageSize.Width() ),
                               TenMuToPt( aNewParm.maPageSize.Height() ),
-                              vcl::PDFWriter::Portrait );
+                              vcl::PDFWriter::Orientation::Portrait );
 
             xWriter->PlayMetafile( aPageFile, aMtfContext );
         }


More information about the Libreoffice-commits mailing list