[Libreoffice-commits] core.git: 2 commits - include/svx sc/source sd/source slideshow/source svx/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Oct 9 06:10:22 UTC 2018


 include/svx/svdundo.hxx                                        |    8 +-
 sc/source/core/data/drwlayer.cxx                               |    2 
 sc/source/ui/view/drawvie4.cxx                                 |    4 -
 sd/source/ui/view/sdview.cxx                                   |   11 +--
 slideshow/source/engine/animationfactory.cxx                   |    4 -
 slideshow/source/engine/animationnodes/animationbasenode.hxx   |    4 -
 slideshow/source/engine/expressionnodefactory.cxx              |    2 
 slideshow/source/engine/opengl/Operation.hxx                   |   34 +++++-----
 slideshow/source/engine/opengl/TransitionerImpl.cxx            |    6 -
 slideshow/source/engine/rehearsetimingsactivity.cxx            |    2 
 slideshow/source/engine/shapes/drawinglayeranimation.cxx       |   14 ++--
 slideshow/source/engine/shapes/drawshapesubsetting.cxx         |    6 -
 slideshow/source/engine/shapes/externalshapebase.hxx           |    2 
 slideshow/source/engine/shapes/gdimtftools.hxx                 |    4 -
 slideshow/source/engine/shapes/intrinsicanimationactivity.cxx  |    4 -
 slideshow/source/engine/shapes/viewappletshape.hxx             |    2 
 slideshow/source/engine/shapes/viewbackgroundshape.hxx         |    2 
 slideshow/source/engine/shapes/viewmediashape.hxx              |    2 
 slideshow/source/engine/shapes/viewshape.hxx                   |    2 
 slideshow/source/engine/slide/layer.hxx                        |    2 
 slideshow/source/engine/slide/layermanager.cxx                 |    2 
 slideshow/source/engine/slide/layermanager.hxx                 |    2 
 slideshow/source/engine/slide/slideanimations.hxx              |    2 
 slideshow/source/engine/slide/slideimpl.cxx                    |    2 
 slideshow/source/engine/slide/targetpropertiescreator.cxx      |    4 -
 slideshow/source/engine/slideshowimpl.cxx                      |    2 
 slideshow/source/engine/smilfunctionparser.cxx                 |    2 
 slideshow/source/engine/transitions/combtransition.hxx         |    2 
 slideshow/source/engine/transitions/ellipsewipe.hxx            |    2 
 slideshow/source/engine/transitions/pinwheelwipe.hxx           |    2 
 slideshow/source/engine/transitions/randomwipe.hxx             |    2 
 slideshow/source/engine/transitions/slidetransitionfactory.cxx |    6 -
 slideshow/source/engine/transitions/waterfallwipe.hxx          |    2 
 slideshow/source/inc/activitiesfactory.hxx                     |   10 +-
 slideshow/source/inc/animatedsprite.hxx                        |    4 -
 slideshow/source/inc/basenode.hxx                              |    4 -
 slideshow/source/inc/interruptabledelayevent.hxx               |    2 
 slideshow/source/inc/shapeimporter.hxx                         |    2 
 slideshow/source/inc/shapesubset.hxx                           |    4 -
 slideshow/source/inc/transitioninfo.hxx                        |   22 +++---
 svx/source/svdraw/svdmodel.cxx                                 |    2 
 svx/source/svdraw/svdundo.cxx                                  |   31 ++-------
 42 files changed, 109 insertions(+), 121 deletions(-)

New commits:
commit 56940b766e5d52cb1c17b4250e4c7e2c375b7b65
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Oct 8 10:28:45 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Oct 9 08:10:11 2018 +0200

    loplugin:constfields in slideshow
    
    Change-Id: Ieeda808ad8e7fe500a2142c779529ca190725f6a
    Reviewed-on: https://gerrit.libreoffice.org/61548
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/slideshow/source/engine/animationfactory.cxx b/slideshow/source/engine/animationfactory.cxx
index 6ce8ee14a2ba..2451a71bb2dd 100644
--- a/slideshow/source/engine/animationfactory.cxx
+++ b/slideshow/source/engine/animationfactory.cxx
@@ -347,7 +347,7 @@ namespace slideshow
                 ::basegfx::B2DPoint                maShapeOrig;
                 const int                          mnFlags;
                 bool                               mbAnimationStarted;
-                sal_Int16                          mnAdditive;
+                sal_Int16 const                    mnAdditive;
             };
 
 
@@ -625,7 +625,7 @@ namespace slideshow
                 }
 
             private:
-                double mnScale;
+                double const mnScale;
             };
 
             /** Overload for NumberAnimations which need scaling (width,height,x,y currently)
diff --git a/slideshow/source/engine/animationnodes/animationbasenode.hxx b/slideshow/source/engine/animationnodes/animationbasenode.hxx
index 84b3d5a82b5e..d8bbb09d8527 100644
--- a/slideshow/source/engine/animationnodes/animationbasenode.hxx
+++ b/slideshow/source/engine/animationnodes/animationbasenode.hxx
@@ -79,14 +79,14 @@ private:
 private:
     css::uno::Reference<css::animations::XAnimate>  mxAnimateNode;
     ShapeAttributeLayerHolder                       maAttributeLayerHolder;
-    ::basegfx::B2DVector                            maSlideSize;
+    ::basegfx::B2DVector const                      maSlideSize;
     AnimationActivitySharedPtr                      mpActivity;
 
     /// When valid, this node has a plain target shape
     AttributableShapeSharedPtr                      mpShape;
     /// When valid, this is a subsetted target shape
     ShapeSubsetSharedPtr                            mpShapeSubset;
-    SubsettableShapeManagerSharedPtr                mpSubsetManager;
+    SubsettableShapeManagerSharedPtr const          mpSubsetManager;
     bool                                            mbIsIndependentSubset;
 };
 
diff --git a/slideshow/source/engine/expressionnodefactory.cxx b/slideshow/source/engine/expressionnodefactory.cxx
index 5f185d378009..2be231aed327 100644
--- a/slideshow/source/engine/expressionnodefactory.cxx
+++ b/slideshow/source/engine/expressionnodefactory.cxx
@@ -54,7 +54,7 @@ namespace slideshow
                 }
 
             private:
-                double  maValue;
+                double const  maValue;
             };
 
             class TValueExpression : public ExpressionNode
diff --git a/slideshow/source/engine/opengl/Operation.hxx b/slideshow/source/engine/opengl/Operation.hxx
index 0ee818f24574..f26fd193f16d 100644
--- a/slideshow/source/engine/opengl/Operation.hxx
+++ b/slideshow/source/engine/opengl/Operation.hxx
@@ -45,15 +45,15 @@ public:
 protected:
     /** Should this operation be interpolated . If TRUE, the transform will smoothly move from making no difference from t = 0.0 to mnT0 to being completely transformed from t = mnT1 to 1. If FALSE, the transform will be ineffectual from t = 0 to mnT0, and completely transformed from t = mnT0 to 1.
     */
-    bool mbInterpolate;
+    bool const mbInterpolate;
 
     /** time to begin the transformation
     */
-    double mnT0;
+    double const mnT0;
 
     /** time to finish the transformation
     */
-    double mnT1;
+    double const mnT1;
 public:
     /** this is the function that is called to give the Operation to OpenGL.
 
@@ -107,15 +107,15 @@ public:
 private:
     /** axis to rotate CCW about
     */
-    glm::vec3 axis;
+    glm::vec3 const axis;
 
     /** position that rotation axis runs through
     */
-    glm::vec3 origin;
+    glm::vec3 const origin;
 
     /** angle in degrees of CCW rotation
     */
-    double angle;
+    double const angle;
 };
 
 std::shared_ptr<SRotate>
@@ -149,8 +149,8 @@ public:
     */
     SScale(const glm::vec3& Scale, const glm::vec3& Origin,bool bInter, double T0, double T1);
 private:
-    glm::vec3 scale;
-    glm::vec3 origin;
+    glm::vec3 const scale;
+    glm::vec3 const origin;
 };
 
 std::shared_ptr<SScale>
@@ -182,7 +182,7 @@ public:
 private:
     /** vector to translate by
     */
-    glm::vec3 vector;
+    glm::vec3 const vector;
 };
 
 std::shared_ptr<STranslate>
@@ -234,10 +234,10 @@ public:
 
     RotateAndScaleDepthByWidth(const glm::vec3& Axis,const glm::vec3& Origin,double Angle, bool bScale, bool bInter, double T0, double T1);
 private:
-    glm::vec3 axis;
-    glm::vec3 origin;
-    double angle;
-    bool scale;
+    glm::vec3 const axis;
+    glm::vec3 const origin;
+    double const angle;
+    bool const scale;
 };
 
 std::shared_ptr<RotateAndScaleDepthByWidth>
@@ -252,10 +252,10 @@ public:
 
     RotateAndScaleDepthByHeight(const glm::vec3& Axis,const glm::vec3& Origin,double Angle, bool bScale, bool bInter, double T0, double T1);
 private:
-    glm::vec3 axis;
-    glm::vec3 origin;
-    double angle;
-    bool scale;
+    glm::vec3 const axis;
+    glm::vec3 const origin;
+    double const angle;
+    bool const scale;
 };
 
 std::shared_ptr<RotateAndScaleDepthByHeight>
diff --git a/slideshow/source/engine/opengl/TransitionerImpl.cxx b/slideshow/source/engine/opengl/TransitionerImpl.cxx
index 663efa8a8710..6fe8c08772ee 100644
--- a/slideshow/source/engine/opengl/TransitionerImpl.cxx
+++ b/slideshow/source/engine/opengl/TransitionerImpl.cxx
@@ -109,9 +109,9 @@ private:
 
 struct OGLFormat
 {
-    GLint  nInternalFormat;
-    GLenum eFormat;
-    GLenum eType;
+    GLint const  nInternalFormat;
+    GLenum const eFormat;
+    GLenum const eType;
 };
 
 /* channel ordering: (0:rgba, 1:bgra, 2:argb, 3:abgr)
diff --git a/slideshow/source/engine/rehearsetimingsactivity.cxx b/slideshow/source/engine/rehearsetimingsactivity.cxx
index c4c3dc4ee9ea..ec1370f08784 100644
--- a/slideshow/source/engine/rehearsetimingsactivity.cxx
+++ b/slideshow/source/engine/rehearsetimingsactivity.cxx
@@ -103,7 +103,7 @@ public:
 private:
     ::canvas::tools::ElapsedTime    maTimer;
     double                          mnNextTime;
-    std::weak_ptr<Activity>       mpActivity;
+    std::weak_ptr<Activity> const   mpActivity;
     ActivitiesQueue&                mrActivityQueue;
 };
 
diff --git a/slideshow/source/engine/shapes/drawinglayeranimation.cxx b/slideshow/source/engine/shapes/drawinglayeranimation.cxx
index 899663dedb16..c2aa3a695765 100644
--- a/slideshow/source/engine/shapes/drawinglayeranimation.cxx
+++ b/slideshow/source/engine/shapes/drawinglayeranimation.cxx
@@ -64,13 +64,13 @@ namespace {
 
 class ScrollTextAnimNode
 {
-    sal_uInt32  mnDuration; // single duration
-    sal_uInt32  mnRepeat; // 0 -> endless
-    double      mfStart;
-    double      mfStop;
-    sal_uInt32  mnFrequency; // in ms
+    sal_uInt32 const  mnDuration; // single duration
+    sal_uInt32 const  mnRepeat; // 0 -> endless
+    double const      mfStart;
+    double const      mfStop;
+    sal_uInt32 const  mnFrequency; // in ms
     // forth and back change at mnRepeat%2:
-    bool        mbAlternate;
+    bool const        mbAlternate;
 
 public:
     ScrollTextAnimNode(
@@ -193,7 +193,7 @@ private:
     DrawShapeSharedPtr                          mpDrawShape;
     ShapeAttributeLayerHolder                   maShapeAttrLayer;
     GDIMetaFileSharedPtr                        mpMetaFile;
-    IntrinsicAnimationEventHandlerSharedPtr     mpListener;
+    IntrinsicAnimationEventHandlerSharedPtr const mpListener;
     canvas::tools::ElapsedTime                  maTimer;
     double                                      mfRotationAngle;
     bool                                        mbIsShapeAnimated;
diff --git a/slideshow/source/engine/shapes/drawshapesubsetting.cxx b/slideshow/source/engine/shapes/drawshapesubsetting.cxx
index 3bc64b7125ee..c7c9954316c1 100644
--- a/slideshow/source/engine/shapes/drawshapesubsetting.cxx
+++ b/slideshow/source/engine/shapes/drawshapesubsetting.cxx
@@ -648,7 +648,7 @@ namespace slideshow
                 }
 
             private:
-                DrawShapeSubsetting::IndexClassificator meClass;
+                DrawShapeSubsetting::IndexClassificator const meClass;
                 sal_Int32                               mnCurrCount;
             };
         }
@@ -723,10 +723,10 @@ namespace slideshow
                 }
 
             private:
-                sal_Int32                                                       mnNodeIndex;
+                sal_Int32 const                                                 mnNodeIndex;
                 DrawShapeSubsetting::IndexClassificatorVector::const_iterator&  mrLastBegin;
                 DrawShapeSubsetting::IndexClassificatorVector::const_iterator&  mrLastEnd;
-                DrawShapeSubsetting::IndexClassificator                         meClass;
+                DrawShapeSubsetting::IndexClassificator const                   meClass;
             };
 
             DocTreeNode makeTreeNode( const DrawShapeSubsetting::IndexClassificatorVector::const_iterator& rBegin,
diff --git a/slideshow/source/engine/shapes/externalshapebase.hxx b/slideshow/source/engine/shapes/externalshapebase.hxx
index bb393b1f7cc6..bdefea769408 100644
--- a/slideshow/source/engine/shapes/externalshapebase.hxx
+++ b/slideshow/source/engine/shapes/externalshapebase.hxx
@@ -126,7 +126,7 @@ namespace slideshow
 
             // The attributes of this Shape
             const double                                                            mnPriority;
-            ::basegfx::B2DRectangle                                                 maBounds;
+            ::basegfx::B2DRectangle const                                           maBounds;
         };
     }
 }
diff --git a/slideshow/source/engine/shapes/gdimtftools.hxx b/slideshow/source/engine/shapes/gdimtftools.hxx
index f33dcc93fa15..813c557bee81 100644
--- a/slideshow/source/engine/shapes/gdimtftools.hxx
+++ b/slideshow/source/engine/shapes/gdimtftools.hxx
@@ -73,8 +73,8 @@ namespace slideshow
                 return mnDuration;
             }
 
-            GDIMetaFileSharedPtr    mpMtf;
-            double                  mnDuration;
+            GDIMetaFileSharedPtr const    mpMtf;
+            double const                  mnDuration;
         };
 
         typedef ::std::vector< MtfAnimationFrame > VectorOfMtfAnimationFrames;
diff --git a/slideshow/source/engine/shapes/intrinsicanimationactivity.cxx b/slideshow/source/engine/shapes/intrinsicanimationactivity.cxx
index 895ea94b5812..5461299beb2e 100644
--- a/slideshow/source/engine/shapes/intrinsicanimationactivity.cxx
+++ b/slideshow/source/engine/shapes/intrinsicanimationactivity.cxx
@@ -82,10 +82,10 @@ namespace slideshow
             SlideShowContext                        maContext;
             std::weak_ptr<DrawShape>              mpDrawShape;
             WakeupEventSharedPtr                    mpWakeupEvent;
-            IntrinsicAnimationEventHandlerSharedPtr mpListener;
+            IntrinsicAnimationEventHandlerSharedPtr const mpListener;
             ::std::vector<double>                   maTimeouts;
             ::std::size_t                           mnCurrIndex;
-            ::std::size_t                           mnNumLoops;
+            ::std::size_t const                     mnNumLoops;
             ::std::size_t                           mnLoopCount;
             bool                                    mbIsActive;
         };
diff --git a/slideshow/source/engine/shapes/viewappletshape.hxx b/slideshow/source/engine/shapes/viewappletshape.hxx
index 2a3dafa00588..d54ad064a41e 100644
--- a/slideshow/source/engine/shapes/viewappletshape.hxx
+++ b/slideshow/source/engine/shapes/viewappletshape.hxx
@@ -140,7 +140,7 @@ namespace slideshow
 
         private:
 
-            ViewLayerSharedPtr                                    mpViewLayer;
+            ViewLayerSharedPtr const                 mpViewLayer;
 
             /// the actual viewer component for this applet
             css::uno::Reference<
diff --git a/slideshow/source/engine/shapes/viewbackgroundshape.hxx b/slideshow/source/engine/shapes/viewbackgroundshape.hxx
index 57598c15dad7..fa61459889d8 100644
--- a/slideshow/source/engine/shapes/viewbackgroundshape.hxx
+++ b/slideshow/source/engine/shapes/viewbackgroundshape.hxx
@@ -76,7 +76,7 @@ namespace slideshow
 
             /** The view layer this object is part of.
              */
-            ViewLayerSharedPtr                                  mpViewLayer;
+            ViewLayerSharedPtr const                            mpViewLayer;
 
             /// Generated content bitmap, already with correct output size
             mutable css::uno::Reference< css::rendering::XBitmap >  mxBitmap;
diff --git a/slideshow/source/engine/shapes/viewmediashape.hxx b/slideshow/source/engine/shapes/viewmediashape.hxx
index a3881b27936b..a95ba95e2080 100644
--- a/slideshow/source/engine/shapes/viewmediashape.hxx
+++ b/slideshow/source/engine/shapes/viewmediashape.hxx
@@ -146,7 +146,7 @@ namespace slideshow
             void implInitializePlayerWindow( const ::basegfx::B2DRectangle& rBounds,
                                              const css::uno::Sequence< css::uno::Any >& rVCLDeviceParams,
                                              const OUString& rMimeType );
-            ViewLayerSharedPtr                    mpViewLayer;
+            ViewLayerSharedPtr const              mpViewLayer;
             VclPtr< SystemChildWindow >           mpMediaWindow;
             VclPtr< vcl::Window >                 mpEventHandlerParent;
             mutable css::awt::Point               maWindowOffset;
diff --git a/slideshow/source/engine/shapes/viewshape.hxx b/slideshow/source/engine/shapes/viewshape.hxx
index 74eb3b9af6c2..3617dd39b756 100644
--- a/slideshow/source/engine/shapes/viewshape.hxx
+++ b/slideshow/source/engine/shapes/viewshape.hxx
@@ -300,7 +300,7 @@ namespace slideshow
 
                 Needed for sprite creation
             */
-            ViewLayerSharedPtr                          mpViewLayer;
+            ViewLayerSharedPtr const                    mpViewLayer;
 
             /// A set of cached mtf/canvas combinations
             mutable RendererCacheVector                 maRenderers;
diff --git a/slideshow/source/engine/slide/layer.hxx b/slideshow/source/engine/slide/layer.hxx
index 68792ee44884..ae2add70a5bf 100644
--- a/slideshow/source/engine/slide/layer.hxx
+++ b/slideshow/source/engine/slide/layer.hxx
@@ -248,7 +248,7 @@ namespace slideshow
             basegfx::B2DRange          maBounds;
             basegfx::B2DRange          maNewBounds;
             bool                       mbBoundsDirty;     // true, if view layers need resize
-            bool                       mbBackgroundLayer; // true, if this
+            bool const                 mbBackgroundLayer; // true, if this
                                                           // layer is the
                                                           // special
                                                           // background layer
diff --git a/slideshow/source/engine/slide/layermanager.cxx b/slideshow/source/engine/slide/layermanager.cxx
index 7667ce8c0194..b67e6fc08059 100644
--- a/slideshow/source/engine/slide/layermanager.cxx
+++ b/slideshow/source/engine/slide/layermanager.cxx
@@ -594,7 +594,7 @@ namespace slideshow
                 }
 
             private:
-                ::cppcanvas::CanvasSharedPtr mpCanvas;
+                ::cppcanvas::CanvasSharedPtr const mpCanvas;
             };
         }
 
diff --git a/slideshow/source/engine/slide/layermanager.hxx b/slideshow/source/engine/slide/layermanager.hxx
index f9ba7da23feb..9005cd9e96a8 100644
--- a/slideshow/source/engine/slide/layermanager.hxx
+++ b/slideshow/source/engine/slide/layermanager.hxx
@@ -344,7 +344,7 @@ namespace slideshow
                 is, no extra layers are created, and the slideshow runs
                 potentially faster.
              */
-            bool                     mbDisableAnimationZOrder;
+            bool const               mbDisableAnimationZOrder;
         };
 
         typedef ::std::shared_ptr< LayerManager > LayerManagerSharedPtr;
diff --git a/slideshow/source/engine/slide/slideanimations.hxx b/slideshow/source/engine/slide/slideanimations.hxx
index 72877197f4f5..e4739027395a 100644
--- a/slideshow/source/engine/slide/slideanimations.hxx
+++ b/slideshow/source/engine/slide/slideanimations.hxx
@@ -103,7 +103,7 @@ namespace slideshow
             void end();
 
         private:
-            SlideShowContext         maContext;
+            SlideShowContext const   maContext;
             const basegfx::B2DVector maSlideSize;
             AnimationNodeSharedPtr   mpRootNode;
         };
diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx
index 9fa0ba900ab6..ee119ce4549d 100644
--- a/slideshow/source/engine/slide/slideimpl.cxx
+++ b/slideshow/source/engine/slide/slideimpl.cxx
@@ -237,7 +237,7 @@ private:
     sal_Int16                                           mnCurrentCursor;
 
     /// True, when intrinsic shape animations are allowed
-    bool                                                mbIntrinsicAnimationsAllowed;
+    bool const                                          mbIntrinsicAnimationsAllowed;
 
     /// True, when user paint overlay is enabled
     bool                                                mbUserPaintOverlayEnabled;
diff --git a/slideshow/source/engine/slide/targetpropertiescreator.cxx b/slideshow/source/engine/slide/targetpropertiescreator.cxx
index a8423ec482e9..ac10b14d3b3e 100644
--- a/slideshow/source/engine/slide/targetpropertiescreator.cxx
+++ b/slideshow/source/engine/slide/targetpropertiescreator.cxx
@@ -321,10 +321,10 @@ namespace internal
         private:
             XShapeHash&                         mrShapeHash;
             uno::Reference< drawing::XShape >   mxTargetShape;
-            sal_Int16                           mnParagraphIndex;
+            sal_Int16 const                     mnParagraphIndex;
 
             // get initial or final state
-            bool                                mbInitial;
+            bool const                          mbInitial;
         };
     }
 
diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx
index 1d21ec44512d..31548c27af95 100644
--- a/slideshow/source/engine/slideshowimpl.cxx
+++ b/slideshow/source/engine/slideshowimpl.cxx
@@ -150,7 +150,7 @@ private:
         one used by SlideShowImpl: it is not paused or modified by
         animations.
     */
-    canvas::tools::ElapsedTime maTimer;
+    canvas::tools::ElapsedTime const maTimer;
     /** Time between the display of frames.  Enforced only when mbIsActive
         is <TRUE/>.
     */
diff --git a/slideshow/source/engine/smilfunctionparser.cxx b/slideshow/source/engine/smilfunctionparser.cxx
index a406590fb8ee..e029b83d8a2f 100644
--- a/slideshow/source/engine/smilfunctionparser.cxx
+++ b/slideshow/source/engine/smilfunctionparser.cxx
@@ -510,7 +510,7 @@ namespace slideshow
                 }
 
             private:
-                ParserContextSharedPtr  mpParserContext; // might get modified during parsing
+                ParserContextSharedPtr const  mpParserContext; // might get modified during parsing
             };
 
             const ParserContextSharedPtr& getParserContext()
diff --git a/slideshow/source/engine/transitions/combtransition.hxx b/slideshow/source/engine/transitions/combtransition.hxx
index d340565e12ae..1f1509a1c936 100644
--- a/slideshow/source/engine/transitions/combtransition.hxx
+++ b/slideshow/source/engine/transitions/combtransition.hxx
@@ -53,7 +53,7 @@ public:
 
 private:
     const ::basegfx::B2DVector maPushDirectionUnit;
-    sal_Int32                  mnNumStripes;
+    sal_Int32 const            mnNumStripes;
 
     void renderComb( double t, const ViewEntry& rViewEntry ) const;
 };
diff --git a/slideshow/source/engine/transitions/ellipsewipe.hxx b/slideshow/source/engine/transitions/ellipsewipe.hxx
index c8d991b509f8..ea0cf8944984 100644
--- a/slideshow/source/engine/transitions/ellipsewipe.hxx
+++ b/slideshow/source/engine/transitions/ellipsewipe.hxx
@@ -33,7 +33,7 @@ public:
     explicit EllipseWipe( sal_Int32 nSubType ): mnSubType( nSubType ) {}
     virtual ::basegfx::B2DPolyPolygon operator () ( double x ) override;
 private:
-    sal_Int32 mnSubType;
+    sal_Int32 const mnSubType;
 };
 
 }
diff --git a/slideshow/source/engine/transitions/pinwheelwipe.hxx b/slideshow/source/engine/transitions/pinwheelwipe.hxx
index b367ad868d69..1c7ee3216e72 100644
--- a/slideshow/source/engine/transitions/pinwheelwipe.hxx
+++ b/slideshow/source/engine/transitions/pinwheelwipe.hxx
@@ -34,7 +34,7 @@ public:
     explicit PinWheelWipe( sal_Int32 blades ) : m_blades(blades) {}
     virtual ::basegfx::B2DPolyPolygon operator () ( double t ) override;
 private:
-    sal_Int32 m_blades;
+    sal_Int32 const m_blades;
 };
 
 }
diff --git a/slideshow/source/engine/transitions/randomwipe.hxx b/slideshow/source/engine/transitions/randomwipe.hxx
index d287d8cb315f..237fa59d2882 100644
--- a/slideshow/source/engine/transitions/randomwipe.hxx
+++ b/slideshow/source/engine/transitions/randomwipe.hxx
@@ -40,7 +40,7 @@ public:
     virtual ::basegfx::B2DPolyPolygon operator () ( double t ) override;
 private:
     ::std::unique_ptr< ::basegfx::B2DPoint []> m_positions;
-    sal_Int32 m_nElements;
+    sal_Int32 const m_nElements;
     ::basegfx::B2DPolygon m_rect;
 };
 
diff --git a/slideshow/source/engine/transitions/slidetransitionfactory.cxx b/slideshow/source/engine/transitions/slidetransitionfactory.cxx
index b1ae953e4c01..5b6ae3f0c74e 100644
--- a/slideshow/source/engine/transitions/slidetransitionfactory.cxx
+++ b/slideshow/source/engine/transitions/slidetransitionfactory.cxx
@@ -257,8 +257,8 @@ private:
     // bool
     bool mbSuccess;
 
-    sal_Int16 mnTransitionType;
-    sal_Int16 mnTransitionSubType;
+    sal_Int16 const mnTransitionType;
+    sal_Int16 const mnTransitionSubType;
 
     uno::Reference<presentation::XTransitionFactory> mxFactory;
 };
@@ -474,7 +474,7 @@ public:
         double                                     t ) override;
 
 private:
-    RGBColor maFadeColor;
+    RGBColor const maFadeColor;
 };
 
 void CutSlideChange::prepareForRun(
diff --git a/slideshow/source/engine/transitions/waterfallwipe.hxx b/slideshow/source/engine/transitions/waterfallwipe.hxx
index 6f397058cd43..6d9957beb1e3 100644
--- a/slideshow/source/engine/transitions/waterfallwipe.hxx
+++ b/slideshow/source/engine/transitions/waterfallwipe.hxx
@@ -34,7 +34,7 @@ public:
     WaterfallWipe( sal_Int32 nElements, bool flipOnYAxis );
     virtual ::basegfx::B2DPolyPolygon operator () ( double t ) override;
 private:
-    bool m_flipOnYAxis;
+    bool const m_flipOnYAxis;
     ::basegfx::B2DPolygon m_waterfall;
 };
 
diff --git a/slideshow/source/inc/activitiesfactory.hxx b/slideshow/source/inc/activitiesfactory.hxx
index 8ed059d53a0e..ccf641dd7f82 100644
--- a/slideshow/source/inc/activitiesfactory.hxx
+++ b/slideshow/source/inc/activitiesfactory.hxx
@@ -90,7 +90,7 @@ namespace ActivitiesFactory
             (wouldn't have a clue, then, how to scale the
             animation over time).
         */
-        double                                          mnMinDuration;
+        double const                                    mnMinDuration;
 
         /** Minimal number of frames for this activity.
 
@@ -100,7 +100,7 @@ namespace ActivitiesFactory
             is over, the activity will be prolonged until
             mnMinNumberOfFrames are rendered.
         */
-        sal_uInt32                                      mnMinNumberOfFrames;
+        sal_uInt32 const                                mnMinNumberOfFrames;
 
         /** Number of repeats for the simple duration
 
@@ -113,10 +113,10 @@ namespace ActivitiesFactory
         ::boost::optional<double> const                 maRepeats;
 
         /// Fraction of simple time to accelerate animation
-        double                                          mnAcceleration;
+        double const                                    mnAcceleration;
 
         /// Fraction of simple time to decelerate animation
-        double                                          mnDeceleration;
+        double const                                    mnDeceleration;
 
         /// Shape, to get bounds from
         ShapeSharedPtr                                  mpShape;
@@ -125,7 +125,7 @@ namespace ActivitiesFactory
         ::basegfx::B2DVector                            maSlideBounds;
 
         /// When true, activity is played reversed after mnDuration.
-        bool                                            mbAutoReverse;
+        bool const                                      mbAutoReverse;
     };
 
     /** Create an activity from an XAnimate node.
diff --git a/slideshow/source/inc/animatedsprite.hxx b/slideshow/source/inc/animatedsprite.hxx
index 8a49f831b3cc..7f4b16401cfc 100644
--- a/slideshow/source/inc/animatedsprite.hxx
+++ b/slideshow/source/inc/animatedsprite.hxx
@@ -140,13 +140,13 @@ namespace slideshow
             void transform( const ::basegfx::B2DHomMatrix& rTransform );
 
         private:
-            ViewLayerSharedPtr                                          mpViewLayer;
+            ViewLayerSharedPtr const                                    mpViewLayer;
 
             ::cppcanvas::CustomSpriteSharedPtr                          mpSprite;
             ::basegfx::B2DSize                                          maEffectiveSpriteSizePixel;
             ::basegfx::B2DSize                                          maContentPixelOffset;
 
-            double                                                      mnSpritePrio;
+            double const                                                mnSpritePrio;
             double                                                      mnAlpha;
             ::boost::optional< ::basegfx::B2DPoint >                    maPosPixel;
             ::boost::optional< ::basegfx::B2DPolyPolygon >              maClip;
diff --git a/slideshow/source/inc/basenode.hxx b/slideshow/source/inc/basenode.hxx
index 96291176ff55..ff146a8b5a29 100644
--- a/slideshow/source/inc/basenode.hxx
+++ b/slideshow/source/inc/basenode.hxx
@@ -52,10 +52,10 @@ struct NodeContext
         {}
 
     /// Context as passed to createAnimationNode()
-    SlideShowContext                 maContext;
+    SlideShowContext const           maContext;
 
     /// Size in user coordinate space of the corresponding slide
-    ::basegfx::B2DVector             maSlideSize;
+    ::basegfx::B2DVector const       maSlideSize;
 
     /// Shape to be used (provided by parent, e.g. for iterations)
     ShapeSubsetSharedPtr             mpMasterShapeSubset;
diff --git a/slideshow/source/inc/interruptabledelayevent.hxx b/slideshow/source/inc/interruptabledelayevent.hxx
index f3cdd6c67cfa..2d79625ee897 100644
--- a/slideshow/source/inc/interruptabledelayevent.hxx
+++ b/slideshow/source/inc/interruptabledelayevent.hxx
@@ -79,7 +79,7 @@ namespace slideshow
 
         private:
             EventSharedPtr  mpEvent;
-            double          mnTimeout;
+            double const    mnTimeout;
         };
 
         /// Return value for makeInterruptableDelay()
diff --git a/slideshow/source/inc/shapeimporter.hxx b/slideshow/source/inc/shapeimporter.hxx
index 5c0afa917b5c..584b40941f37 100644
--- a/slideshow/source/inc/shapeimporter.hxx
+++ b/slideshow/source/inc/shapeimporter.hxx
@@ -129,7 +129,7 @@ private:
     PolyPolygonVector                         maPolygons;
     ::std::stack<XShapesEntry>                maShapesStack;
     double                                    mnAscendingPrio;
-    bool                                      mbConvertingMasterPage;
+    bool const                                mbConvertingMasterPage;
 };
 
 } // namespace internal
diff --git a/slideshow/source/inc/shapesubset.hxx b/slideshow/source/inc/shapesubset.hxx
index 0929658b0f30..b2464778ef57 100644
--- a/slideshow/source/inc/shapesubset.hxx
+++ b/slideshow/source/inc/shapesubset.hxx
@@ -135,9 +135,9 @@ namespace slideshow
             //ShapeSubset(const ShapeSubset&);
             //ShapeSubset& operator=( const ShapeSubset& );
 
-            AttributableShapeSharedPtr       mpOriginalShape;
+            AttributableShapeSharedPtr const mpOriginalShape;
             AttributableShapeSharedPtr       mpSubsetShape;
-            DocTreeNode                      maTreeNode;
+            DocTreeNode const                maTreeNode;
             SubsettableShapeManagerSharedPtr mpShapeManager;
         };
     }
diff --git a/slideshow/source/inc/transitioninfo.hxx b/slideshow/source/inc/transitioninfo.hxx
index 241771bec5f9..cf3529476b26 100644
--- a/slideshow/source/inc/transitioninfo.hxx
+++ b/slideshow/source/inc/transitioninfo.hxx
@@ -33,8 +33,8 @@ struct TransitionInfo
 
     // {
 
-    sal_Int16       mnTransitionType;
-    sal_Int16       mnTransitionSubType;
+    sal_Int16 const       mnTransitionType;
+    sal_Int16 const       mnTransitionSubType;
 
     // }
 
@@ -54,16 +54,16 @@ struct TransitionInfo
     };
 
     /// class of effect handling
-    TransitionClass meTransitionClass;
+    TransitionClass const meTransitionClass;
 
     /// Rotation angle of clip polygon
-    double          mnRotationAngle;
+    double const          mnRotationAngle;
 
     /// X scaling of clip polygon (negative values mirror)
-    double          mnScaleX;
+    double const          mnScaleX;
 
     /// Y scaling of clip polygon (negative values mirror)
-    double          mnScaleY;
+    double const          mnScaleY;
 
     /** This enum determines the method how to reverse
         a parametric clip polygon transition.
@@ -102,7 +102,7 @@ struct TransitionInfo
 
         @see ReverseMethod
     */
-    ReverseMethod   meReverseMethod;
+    ReverseMethod const   meReverseMethod;
 
     /** When true, transition 'out' effects are realized
         by inverting the parameter sweep direction (1->0
@@ -110,20 +110,20 @@ struct TransitionInfo
         realized by changing inside and outside areas of
         the parametric poly-polygon.
     */
-    bool            mbOutInvertsSweep;
+    bool const            mbOutInvertsSweep;
 
     /** when true, scale clip polygon isotropically to
         target size.  when false, scale is
         anisotropically.
     */
-    bool            mbScaleIsotrophically;
+    bool const            mbScaleIsotrophically;
 
 
     /// Compare against type and subtype
     class Comparator
     {
-        sal_Int16 mnTransitionType;
-        sal_Int16 mnTransitionSubType;
+        sal_Int16 const mnTransitionType;
+        sal_Int16 const mnTransitionSubType;
     public:
         Comparator( sal_Int16 nTransitionType,
                     sal_Int16 nTransitionSubType )
commit e9a3b06f4e2b22f26006e0df730ad23d715ecbb6
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Oct 8 13:04:21 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Oct 9 08:09:58 2018 +0200

    use unique_ptr in SdrUndoGroup
    
    Change-Id: I569c56b6114e07b2a227ad0f906c1a5188a94af4
    Reviewed-on: https://gerrit.libreoffice.org/61528
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/svx/svdundo.hxx b/include/svx/svdundo.hxx
index 7a0d9b7f9041..c134fb986590 100644
--- a/include/svx/svdundo.hxx
+++ b/include/svx/svdundo.hxx
@@ -85,7 +85,7 @@ public:
 
 class SVX_DLLPUBLIC SdrUndoGroup final : public SdrUndoAction
 {
-    std::vector<SdrUndoAction*> aBuf;
+    std::vector<std::unique_ptr<SdrUndoAction>> maActions;
 
     // No expanded description of the Action (contains %O)
     OUString                    aComment;
@@ -98,9 +98,9 @@ public:
     virtual ~SdrUndoGroup() override;
 
     void Clear();
-    sal_Int32 GetActionCount() const { return aBuf.size(); }
-    SdrUndoAction* GetAction(sal_Int32 nNum) const { return aBuf[nNum]; }
-    void AddAction(SdrUndoAction* pAct);
+    sal_Int32 GetActionCount() const { return maActions.size(); }
+    SdrUndoAction* GetAction(sal_Int32 nNum) const { return maActions[nNum].get(); }
+    void AddAction(std::unique_ptr<SdrUndoAction> pAct);
 
     void SetComment(const OUString& rStr) { aComment=rStr; }
     void SetObjDescription(const OUString& rStr) { aObjDescription=rStr; }
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 1e97aa0600f8..adf396026221 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -1193,7 +1193,7 @@ void ScDrawLayer::AddCalcUndo( std::unique_ptr<SdrUndoAction> pUndo )
         if (!pUndoGroup)
             pUndoGroup.reset(new SdrUndoGroup(*this));
 
-        pUndoGroup->AddAction( pUndo.release() );
+        pUndoGroup->AddAction( std::move(pUndo) );
     }
 }
 
diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx
index ae640d7f1708..f884429f6ad1 100644
--- a/sc/source/ui/view/drawvie4.cxx
+++ b/sc/source/ui/view/drawvie4.cxx
@@ -518,7 +518,7 @@ void ScDrawView::SetMarkedOriginalSize()
         {
             tools::Rectangle aDrawRect = pObj->GetLogicRect();
 
-            pUndoGroup->AddAction( new SdrUndoGeoObj( *pObj ) );
+            pUndoGroup->AddAction( o3tl::make_unique<SdrUndoGeoObj>( *pObj ) );
             pObj->Resize( aDrawRect.TopLeft(), Fraction( aOriginalSize.Width(), aDrawRect.GetWidth() ),
                                                  Fraction( aOriginalSize.Height(), aDrawRect.GetHeight() ) );
             ++nDone;
@@ -581,7 +581,7 @@ void ScDrawView::FitToCellSize()
         aCellRect.setHeight(static_cast<double>(aGraphicRect.GetHeight()) * fScaleMin);
     }
 
-    pUndoGroup->AddAction( new SdrUndoGeoObj( *pObj ) );
+    pUndoGroup->AddAction( o3tl::make_unique<SdrUndoGeoObj>( *pObj ) );
 
     pObj->SetSnapRect(aCellRect);
 
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index 5d753fe4aaa5..bd5411a88157 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -886,7 +886,7 @@ void View::SetMarkedOriginalSize()
                     {
                         ::tools::Rectangle   aDrawRect( pObj->GetLogicRect() );
 
-                        pUndoGroup->AddAction( mrDoc.GetSdrUndoFactory().CreateUndoGeoObject( *pObj ) );
+                        pUndoGroup->AddAction( std::unique_ptr<SdrUndoAction>(mrDoc.GetSdrUndoFactory().CreateUndoGeoObject( *pObj )) );
                         pObj->Resize( aDrawRect.TopLeft(), Fraction( aOleSize.Width(), aDrawRect.GetWidth() ),
                                                            Fraction( aOleSize.Height(), aDrawRect.GetHeight() ) );
                     }
@@ -896,7 +896,7 @@ void View::SetMarkedOriginalSize()
             {
                 const SdrGrafObj* pSdrGrafObj = static_cast< const SdrGrafObj* >(pObj);
                 const Size aSize = pSdrGrafObj->getOriginalSize( );
-                pUndoGroup->AddAction( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj ) );
+                pUndoGroup->AddAction( std::unique_ptr<SdrUndoAction>(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj )) );
                 ::tools::Rectangle aRect( pObj->GetLogicRect() );
                 aRect.SetSize( aSize );
                 pObj->SetLogicRect( aRect );
@@ -1334,8 +1334,7 @@ void View::ChangeMarkedObjectsBulletsNumbering(
                     pOutliner->SetText(*(pText->GetOutlinerParaObject()));
                     if (bUndoEnabled)
                     {
-                        SdrUndoObjSetText* pTxtUndo = dynamic_cast< SdrUndoObjSetText* >(pSdrModel->GetSdrUndoFactory().CreateUndoObjectSetText(*pTextObj, nCellIndex));
-                        pUndoGroup->AddAction(pTxtUndo);
+                        pUndoGroup->AddAction(std::unique_ptr<SdrUndoAction>(pSdrModel->GetSdrUndoFactory().CreateUndoObjectSetText(*pTextObj, nCellIndex)));
                     }
                     if ( !bToggleOn )
                     {
@@ -1365,8 +1364,8 @@ void View::ChangeMarkedObjectsBulletsNumbering(
             pOutliner->SetText(*pParaObj);
             if (bUndoEnabled)
             {
-                SdrUndoObjSetText* pTxtUndo = dynamic_cast< SdrUndoObjSetText* >(pSdrModel->GetSdrUndoFactory().CreateUndoObjectSetText(*pTextObj, 0));
-                pUndoGroup->AddAction(pTxtUndo);
+                pUndoGroup->AddAction(
+                    std::unique_ptr<SdrUndoAction>(pSdrModel->GetSdrUndoFactory().CreateUndoObjectSetText(*pTextObj, 0)));
             }
             if ( !bToggleOn )
             {
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 2c1576d4988a..9f83988fc7b6 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -574,7 +574,7 @@ void SdrModel::AddUndo(SdrUndoAction* pUndo)
     {
         if (pCurrentUndoGroup)
         {
-            pCurrentUndoGroup->AddAction(pUndo);
+            pCurrentUndoGroup->AddAction(std::unique_ptr<SdrUndoAction>(pUndo));
         }
         else
         {
diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx
index d990914a8e6a..e4b18f3c269e 100644
--- a/svx/source/svdraw/svdundo.cxx
+++ b/svx/source/svdraw/svdundo.cxx
@@ -110,44 +110,33 @@ ViewShellId SdrUndoAction::GetViewShellId() const
 
 SdrUndoGroup::SdrUndoGroup(SdrModel& rNewMod)
 :   SdrUndoAction(rNewMod),
-    aBuf(),
     eFunction(SdrRepeatFunc::NONE)
 {}
 
 SdrUndoGroup::~SdrUndoGroup()
 {
-    Clear();
 }
 
 void SdrUndoGroup::Clear()
 {
-    for (sal_Int32 nu=0; nu<GetActionCount(); nu++) {
-        SdrUndoAction* pAct=GetAction(nu);
-        delete pAct;
-    }
-    aBuf.clear();
+    maActions.clear();
 }
 
-void SdrUndoGroup::AddAction(SdrUndoAction* pAct)
+void SdrUndoGroup::AddAction(std::unique_ptr<SdrUndoAction> pAct)
 {
-    aBuf.push_back(pAct);
+    maActions.push_back(std::move(pAct));
 }
 
 void SdrUndoGroup::Undo()
 {
-    for (sal_Int32 nu=GetActionCount(); nu>0;) {
-        nu--;
-        SdrUndoAction* pAct=GetAction(nu);
-        pAct->Undo();
-    }
+    for (auto it = maActions.rbegin(); it != maActions.rend(); ++it)
+        (*it)->Undo();
 }
 
 void SdrUndoGroup::Redo()
 {
-    for (sal_Int32 nu=0; nu<GetActionCount(); nu++) {
-        SdrUndoAction* pAct=GetAction(nu);
-        pAct->Redo();
-    }
+    for (std::unique_ptr<SdrUndoAction> & pAction : maActions)
+        pAction->Redo();
 }
 
 OUString SdrUndoGroup::GetComment() const
@@ -282,7 +271,7 @@ SdrUndoAttrObj::SdrUndoAttrObj(SdrObject& rNewObj, bool bStyleSheet1, bool bSave
         for(size_t nObjNum = 0; nObjNum < nObjCount; ++nObjNum)
         {
             pUndoGroup->AddAction(
-                new SdrUndoAttrObj(*pOL->GetObj(nObjNum), bStyleSheet1));
+                o3tl::make_unique<SdrUndoAttrObj>(*pOL->GetObj(nObjNum), bStyleSheet1));
         }
     }
 
@@ -585,7 +574,7 @@ SdrUndoGeoObj::SdrUndoGeoObj(SdrObject& rNewObj)
         pUndoGroup.reset(new SdrUndoGroup(pObj->getSdrModelFromSdrObject()));
         const size_t nObjCount = pOL->GetObjCount();
         for (size_t nObjNum = 0; nObjNum<nObjCount; ++nObjNum) {
-            pUndoGroup->AddAction(new SdrUndoGeoObj(*pOL->GetObj(nObjNum)));
+            pUndoGroup->AddAction(o3tl::make_unique<SdrUndoGeoObj>(*pOL->GetObj(nObjNum)));
         }
     }
     else
@@ -1431,7 +1420,7 @@ SdrUndoDelPage::SdrUndoDelPage(SdrPage& rNewPg)
                         pUndoGroup.reset( new SdrUndoGroup(rMod) );
                     }
 
-                    pUndoGroup->AddAction(rMod.GetSdrUndoFactory().CreateUndoPageRemoveMasterPage(*pDrawPage));
+                    pUndoGroup->AddAction(std::unique_ptr<SdrUndoAction>(rMod.GetSdrUndoFactory().CreateUndoPageRemoveMasterPage(*pDrawPage)));
                 }
             }
         }


More information about the Libreoffice-commits mailing list