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

Noel Grandin noel.grandin at collabora.co.uk
Thu Feb 9 09:47:59 UTC 2017


 include/vcl/pdfwriter.hxx         |    5 ++---
 sd/source/ui/unoidl/unomodel.cxx  |   30 +++++++++++++++---------------
 vcl/source/gdi/pdfwriter_impl.cxx |   38 ++++++++++++++++----------------------
 3 files changed, 33 insertions(+), 40 deletions(-)

New commits:
commit 4ccdf7932e84bd78a366bb4ae2785c63e33a9403
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Feb 8 14:49:07 2017 +0200

    convert PDFWriter::PageTransition to scoped enum
    
    and drop some read-only enumerators
    
    Change-Id: I96380efec90abe02fa02c3f766f2b6180723da0d
    Reviewed-on: https://gerrit.libreoffice.org/34058
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx
index 29aecc7..75f1230 100644
--- a/include/vcl/pdfwriter.hxx
+++ b/include/vcl/pdfwriter.hxx
@@ -177,7 +177,7 @@ public:
         Disc, Circle, Square, Decimal, UpperRoman, LowerRoman, UpperAlpha, LowerAlpha
     };
 
-    enum PageTransition
+    enum class PageTransition
     {
         Regular,
         SplitHorizontalInward, SplitHorizontalOutward,
@@ -185,8 +185,7 @@ public:
         BlindsHorizontal, BlindsVertical,
         BoxInward, BoxOutward,
         WipeLeftToRight, WipeBottomToTop, WipeRightToLeft, WipeTopToBottom,
-        Dissolve,
-        GlitterLeftToRight, GlitterTopToBottom, GlitterTopLeftToBottomRight
+        Dissolve
     };
 
     enum WidgetType
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index ff7fce0..a7099f2 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2036,7 +2036,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r
                                                 }
                                             }
                                             presentation::FadeEffect eFe;
-                                            vcl::PDFWriter::PageTransition eType = vcl::PDFWriter::Regular;
+                                            vcl::PDFWriter::PageTransition eType = vcl::PDFWriter::PageTransition::Regular;
                                             if ( xPagePropSet->getPropertySetInfo( )->hasPropertyByName( sEffect ) )
                                             {
                                                 aAny = xPagePropSet->getPropertyValue( sEffect );
@@ -2046,11 +2046,11 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r
                                                     {
                                                         case presentation::FadeEffect_HORIZONTAL_LINES :
                                                         case presentation::FadeEffect_HORIZONTAL_CHECKERBOARD :
-                                                        case presentation::FadeEffect_HORIZONTAL_STRIPES : eType = vcl::PDFWriter::BlindsHorizontal; break;
+                                                        case presentation::FadeEffect_HORIZONTAL_STRIPES : eType = vcl::PDFWriter::PageTransition::BlindsHorizontal; break;
 
                                                         case presentation::FadeEffect_VERTICAL_LINES :
                                                         case presentation::FadeEffect_VERTICAL_CHECKERBOARD :
-                                                        case presentation::FadeEffect_VERTICAL_STRIPES : eType = vcl::PDFWriter::BlindsVertical; break;
+                                                        case presentation::FadeEffect_VERTICAL_STRIPES : eType = vcl::PDFWriter::PageTransition::BlindsVertical; break;
 
                                                         case presentation::FadeEffect_UNCOVER_TO_RIGHT :
                                                         case presentation::FadeEffect_UNCOVER_TO_UPPERRIGHT :
@@ -2058,7 +2058,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r
                                                         case presentation::FadeEffect_FADE_FROM_UPPERLEFT :
                                                         case presentation::FadeEffect_MOVE_FROM_UPPERLEFT :
                                                         case presentation::FadeEffect_FADE_FROM_LEFT :
-                                                        case presentation::FadeEffect_MOVE_FROM_LEFT : eType = vcl::PDFWriter::WipeLeftToRight; break;
+                                                        case presentation::FadeEffect_MOVE_FROM_LEFT : eType = vcl::PDFWriter::PageTransition::WipeLeftToRight; break;
 
                                                         case presentation::FadeEffect_UNCOVER_TO_BOTTOM :
                                                         case presentation::FadeEffect_UNCOVER_TO_LOWERRIGHT :
@@ -2066,7 +2066,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r
                                                         case presentation::FadeEffect_FADE_FROM_UPPERRIGHT :
                                                         case presentation::FadeEffect_MOVE_FROM_UPPERRIGHT :
                                                         case presentation::FadeEffect_FADE_FROM_TOP :
-                                                        case presentation::FadeEffect_MOVE_FROM_TOP : eType = vcl::PDFWriter::WipeTopToBottom; break;
+                                                        case presentation::FadeEffect_MOVE_FROM_TOP : eType = vcl::PDFWriter::PageTransition::WipeTopToBottom; break;
 
                                                         case presentation::FadeEffect_UNCOVER_TO_LEFT :
                                                         case presentation::FadeEffect_UNCOVER_TO_LOWERLEFT :
@@ -2075,7 +2075,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r
                                                         case presentation::FadeEffect_FADE_FROM_LOWERRIGHT :
                                                         case presentation::FadeEffect_MOVE_FROM_LOWERRIGHT :
                                                         case presentation::FadeEffect_FADE_FROM_RIGHT :
-                                                        case presentation::FadeEffect_MOVE_FROM_RIGHT : eType = vcl::PDFWriter::WipeRightToLeft; break;
+                                                        case presentation::FadeEffect_MOVE_FROM_RIGHT : eType = vcl::PDFWriter::PageTransition::WipeRightToLeft; break;
 
                                                         case presentation::FadeEffect_UNCOVER_TO_TOP :
                                                         case presentation::FadeEffect_UNCOVER_TO_UPPERLEFT :
@@ -2083,22 +2083,22 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r
                                                         case presentation::FadeEffect_FADE_FROM_LOWERLEFT :
                                                         case presentation::FadeEffect_MOVE_FROM_LOWERLEFT :
                                                         case presentation::FadeEffect_FADE_FROM_BOTTOM :
-                                                        case presentation::FadeEffect_MOVE_FROM_BOTTOM : eType = vcl::PDFWriter::WipeBottomToTop; break;
+                                                        case presentation::FadeEffect_MOVE_FROM_BOTTOM : eType = vcl::PDFWriter::PageTransition::WipeBottomToTop; break;
 
-                                                        case presentation::FadeEffect_OPEN_VERTICAL : eType = vcl::PDFWriter::SplitHorizontalInward; break;
-                                                        case presentation::FadeEffect_CLOSE_HORIZONTAL : eType = vcl::PDFWriter::SplitHorizontalOutward; break;
+                                                        case presentation::FadeEffect_OPEN_VERTICAL : eType = vcl::PDFWriter::PageTransition::SplitHorizontalInward; break;
+                                                        case presentation::FadeEffect_CLOSE_HORIZONTAL : eType = vcl::PDFWriter::PageTransition::SplitHorizontalOutward; break;
 
-                                                        case presentation::FadeEffect_OPEN_HORIZONTAL : eType = vcl::PDFWriter::SplitVerticalInward; break;
-                                                        case presentation::FadeEffect_CLOSE_VERTICAL : eType = vcl::PDFWriter::SplitVerticalOutward; break;
+                                                        case presentation::FadeEffect_OPEN_HORIZONTAL : eType = vcl::PDFWriter::PageTransition::SplitVerticalInward; break;
+                                                        case presentation::FadeEffect_CLOSE_VERTICAL : eType = vcl::PDFWriter::PageTransition::SplitVerticalOutward; break;
 
-                                                        case presentation::FadeEffect_FADE_TO_CENTER : eType = vcl::PDFWriter::BoxInward; break;
-                                                        case presentation::FadeEffect_FADE_FROM_CENTER : eType = vcl::PDFWriter::BoxOutward; break;
+                                                        case presentation::FadeEffect_FADE_TO_CENTER : eType = vcl::PDFWriter::PageTransition::BoxInward; break;
+                                                        case presentation::FadeEffect_FADE_FROM_CENTER : eType = vcl::PDFWriter::PageTransition::BoxOutward; break;
 
-                                                        case presentation::FadeEffect_NONE : eType = vcl::PDFWriter::Regular; break;
+                                                        case presentation::FadeEffect_NONE : eType = vcl::PDFWriter::PageTransition::Regular; break;
 
                                                         case presentation::FadeEffect_RANDOM :
                                                         case presentation::FadeEffect_DISSOLVE :
-                                                        default: eType = vcl::PDFWriter::Dissolve; break;
+                                                        default: eType = vcl::PDFWriter::PageTransition::Dissolve; break;
                                                     }
                                                 }
                                             }
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 0c4be9b..646c79a 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -1129,7 +1129,7 @@ PDFWriterImpl::PDFPage::PDFPage( PDFWriterImpl* pWriter, sal_Int32 nPageWidth, s
         m_nPageIndex( -1 ), // invalid index
         m_nStreamLengthObject( 0 ),
         m_nBeginStreamPos( 0 ),
-        m_eTransition( PDFWriter::Regular ),
+        m_eTransition( PDFWriter::PageTransition::Regular ),
         m_nTransTime( 0 ),
         m_nDuration( 0 ),
         m_bHasWidgets( false )
@@ -1270,7 +1270,7 @@ bool PDFWriterImpl::PDFPage::emit(sal_Int32 nParentObject )
         aLine.append( (sal_Int32)m_nDuration );
         aLine.append( "\n" );
     }
-    if( m_eTransition != PDFWriter::Regular && m_nTransTime > 0 )
+    if( m_eTransition != PDFWriter::PageTransition::Regular && m_nTransTime > 0 )
     {
         // transition duration
         aLine.append( "/Trans<</D " );
@@ -1279,39 +1279,33 @@ bool PDFWriterImpl::PDFPage::emit(sal_Int32 nParentObject )
         const char *pStyle = nullptr, *pDm = nullptr, *pM = nullptr, *pDi = nullptr;
         switch( m_eTransition )
         {
-            case PDFWriter::SplitHorizontalInward:
+            case PDFWriter::PageTransition::SplitHorizontalInward:
                 pStyle = "Split"; pDm = "H"; pM = "I"; break;
-            case PDFWriter::SplitHorizontalOutward:
+            case PDFWriter::PageTransition::SplitHorizontalOutward:
                 pStyle = "Split"; pDm = "H"; pM = "O"; break;
-            case PDFWriter::SplitVerticalInward:
+            case PDFWriter::PageTransition::SplitVerticalInward:
                 pStyle = "Split"; pDm = "V"; pM = "I"; break;
-            case PDFWriter::SplitVerticalOutward:
+            case PDFWriter::PageTransition::SplitVerticalOutward:
                 pStyle = "Split"; pDm = "V"; pM = "O"; break;
-            case PDFWriter::BlindsHorizontal:
+            case PDFWriter::PageTransition::BlindsHorizontal:
                 pStyle = "Blinds"; pDm = "H"; break;
-            case PDFWriter::BlindsVertical:
+            case PDFWriter::PageTransition::BlindsVertical:
                 pStyle = "Blinds"; pDm = "V"; break;
-            case PDFWriter::BoxInward:
+            case PDFWriter::PageTransition::BoxInward:
                 pStyle = "Box"; pM = "I"; break;
-            case PDFWriter::BoxOutward:
+            case PDFWriter::PageTransition::BoxOutward:
                 pStyle = "Box"; pM = "O"; break;
-            case PDFWriter::WipeLeftToRight:
+            case PDFWriter::PageTransition::WipeLeftToRight:
                 pStyle = "Wipe"; pDi = "0"; break;
-            case PDFWriter::WipeBottomToTop:
+            case PDFWriter::PageTransition::WipeBottomToTop:
                 pStyle = "Wipe"; pDi = "90"; break;
-            case PDFWriter::WipeRightToLeft:
+            case PDFWriter::PageTransition::WipeRightToLeft:
                 pStyle = "Wipe"; pDi = "180"; break;
-            case PDFWriter::WipeTopToBottom:
+            case PDFWriter::PageTransition::WipeTopToBottom:
                 pStyle = "Wipe"; pDi = "270"; break;
-            case PDFWriter::Dissolve:
+            case PDFWriter::PageTransition::Dissolve:
                 pStyle = "Dissolve"; break;
-            case PDFWriter::GlitterLeftToRight:
-                pStyle = "Glitter"; pDi = "0"; break;
-            case PDFWriter::GlitterTopToBottom:
-                pStyle = "Glitter"; pDi = "270"; break;
-            case PDFWriter::GlitterTopLeftToBottomRight:
-                pStyle = "Glitter"; pDi = "315"; break;
-            case PDFWriter::Regular:
+            case PDFWriter::PageTransition::Regular:
                 break;
         }
         // transition style


More information about the Libreoffice-commits mailing list