[Libreoffice-commits] core.git: sfx2/source slideshow/source starmath/inc starmath/source

Noel Grandin noel.grandin at collabora.co.uk
Thu Oct 20 06:13:01 UTC 2016


 sfx2/source/doc/oleprops.hxx                                |    4 +---
 slideshow/source/engine/animationnodes/animationsetnode.cxx |    9 ++-------
 slideshow/source/engine/animationnodes/animationsetnode.hxx |    1 -
 slideshow/source/engine/shapes/drawinglayeranimation.cxx    |    8 ++------
 slideshow/source/engine/shapes/viewshape.cxx                |    2 +-
 slideshow/source/engine/shapes/viewshape.hxx                |    7 -------
 starmath/inc/parse.hxx                                      |    3 ---
 starmath/inc/rect.hxx                                       |    1 -
 starmath/inc/view.hxx                                       |    5 -----
 starmath/source/parse.cxx                                   |    4 ++--
 starmath/source/rect.cxx                                    |    2 +-
 starmath/source/view.cxx                                    |    2 +-
 12 files changed, 10 insertions(+), 38 deletions(-)

New commits:
commit 40fc2c1a0d2ebdf47131651045107c9d5abb850d
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Oct 19 10:24:57 2016 +0200

    loplugin:expandablemethodds in sfx2..starmath
    
    Change-Id: Ia4c411f5a9a68c2f344188ce6b6bc1815c89f993
    Reviewed-on: https://gerrit.libreoffice.org/30055
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sfx2/source/doc/oleprops.hxx b/sfx2/source/doc/oleprops.hxx
index a4190a2..dfadd52 100644
--- a/sfx2/source/doc/oleprops.hxx
+++ b/sfx2/source/doc/oleprops.hxx
@@ -170,8 +170,6 @@ public:
     inline explicit     SfxOleObjectBase() : mnErrCode( ERRCODE_NONE ) {}
     virtual             ~SfxOleObjectBase();
 
-    /** Returns true, if an error code (other than ERRCODE_NONE) is set. */
-    inline bool         HasError() const { return mnErrCode != ERRCODE_NONE; }
     /** Returns the current error code. */
     inline ErrCode      GetError() const { return mnErrCode; }
 
@@ -183,7 +181,7 @@ public:
 protected:
     /** Sets the passed error code. Will be returned by Load() and Save() functions.
         Always the first error code is stored. Multiple calls have no effect. */
-    inline void         SetError( ErrCode nErrCode ) { if( !HasError() ) mnErrCode = nErrCode; }
+    inline void         SetError( ErrCode nErrCode ) { if( mnErrCode == ERRCODE_NONE ) mnErrCode = nErrCode; }
     /** Loads the passed object from the stream. Sets returned error code as own error. */
     void                LoadObject( SvStream& rStrm, SfxOleObjectBase& rObj );
     /** Saves the passed object to the stream. Sets returned error code as own error. */
diff --git a/slideshow/source/engine/animationnodes/animationsetnode.cxx b/slideshow/source/engine/animationnodes/animationsetnode.cxx
index 0e19b7f..3770790 100644
--- a/slideshow/source/engine/animationnodes/animationsetnode.cxx
+++ b/slideshow/source/engine/animationnodes/animationsetnode.cxx
@@ -30,11 +30,6 @@ using namespace com::sun::star;
 namespace slideshow {
 namespace internal {
 
-void AnimationSetNode::implScheduleDeactivationEvent()
-{
-    scheduleDeactivationEvent();
-}
-
 AnimationActivitySharedPtr AnimationSetNode::createActivity() const
 {
     ActivitiesFactory::CommonParameters aParms( fillCommonParameters() );
@@ -61,8 +56,8 @@ AnimationActivitySharedPtr AnimationSetNode::createActivity() const
         ENSURE_OR_THROW(
             pSelf, "cannot cast getSelf() to my type!" );
         aParms.mpEndEvent = makeEvent(
-            [pSelf] () { pSelf->implScheduleDeactivationEvent(); },
-            "AnimationSetNode::implScheduleDeactivationEvent");
+            [pSelf] () { pSelf->scheduleDeactivationEvent(); },
+            "AnimationSetNode::scheduleDeactivationEvent");
     }
 
     switch (AnimationFactory::classifyAttributeName( attrName )) {
diff --git a/slideshow/source/engine/animationnodes/animationsetnode.hxx b/slideshow/source/engine/animationnodes/animationsetnode.hxx
index ee63b42..9c39377 100644
--- a/slideshow/source/engine/animationnodes/animationsetnode.hxx
+++ b/slideshow/source/engine/animationnodes/animationsetnode.hxx
@@ -39,7 +39,6 @@ public:
 
 private:
     virtual AnimationActivitySharedPtr createActivity() const override;
-    void implScheduleDeactivationEvent();
 };
 
 } // namespace internal
diff --git a/slideshow/source/engine/shapes/drawinglayeranimation.cxx b/slideshow/source/engine/shapes/drawinglayeranimation.cxx
index 41e3097..63d1787 100644
--- a/slideshow/source/engine/shapes/drawinglayeranimation.cxx
+++ b/slideshow/source/engine/shapes/drawinglayeranimation.cxx
@@ -156,10 +156,6 @@ private:
     void updateShapeAttributes( double fTime,
                                 basegfx::B2DRectangle const& parentBounds );
 
-    // Access to VisibleWhenSTarted flags
-    bool IsVisibleWhenStarted() const { return mbVisibleWhenStarted; }
-    bool IsVisibleWhenStopped() const { return mbVisibleWhenStopped; }
-
     // scroll horizontal? if sal_False, scroll is vertical.
     bool ScrollHorizontal() const {
         return (drawing::TextAnimationDirection_LEFT == meDirection ||
@@ -418,7 +414,7 @@ void ActivityImpl::ImpForceScrollTextAnimNodes()
             fOneRelative = 1.0;
         }
 
-        if(IsVisibleWhenStarted())
+        if(mbVisibleWhenStarted)
         {
             double fRelativeStartValue, fRelativeEndValue,fRelativeDistance;
 
@@ -496,7 +492,7 @@ void ActivityImpl::ImpForceScrollTextAnimNodes()
             }
         }
 
-        if(IsVisibleWhenStopped())
+        if(mbVisibleWhenStopped)
         {
             double fRelativeStartValue, fRelativeEndValue, fRelativeDistance;
 
diff --git a/slideshow/source/engine/shapes/viewshape.cxx b/slideshow/source/engine/shapes/viewshape.cxx
index 2acc75f..7ea7bcc 100644
--- a/slideshow/source/engine/shapes/viewshape.cxx
+++ b/slideshow/source/engine/shapes/viewshape.cxx
@@ -838,7 +838,7 @@ namespace slideshow
             ENSURE_OR_RETURN_FALSE( mpViewLayer->getCanvas(), "ViewShape::update(): Invalid layer canvas" );
 
             // Shall we render to a sprite, or to a plain canvas?
-            if( isBackgroundDetached() )
+            if( mbAnimationMode )
                 return renderSprite( mpViewLayer,
                                      rMtf,
                                      rArgs.maOrigBounds,
diff --git a/slideshow/source/engine/shapes/viewshape.hxx b/slideshow/source/engine/shapes/viewshape.hxx
index 9f6d46c..4eb2f7c 100644
--- a/slideshow/source/engine/shapes/viewshape.hxx
+++ b/slideshow/source/engine/shapes/viewshape.hxx
@@ -95,13 +95,6 @@ namespace slideshow
              */
             void leaveAnimationMode();
 
-            /** Query whether the ViewShape is currently animated
-
-                This method checks whether the ViewShape is currently in
-                animation mode.
-             */
-            bool isBackgroundDetached() const { return mbAnimationMode; }
-
 
             // render methods
 
diff --git a/starmath/inc/parse.hxx b/starmath/inc/parse.hxx
index 7d67931..d22a426 100644
--- a/starmath/inc/parse.hxx
+++ b/starmath/inc/parse.hxx
@@ -92,9 +92,6 @@ class SmParser
 
     void    Error(SmParseError Error);
 
-    void    ClearUsedSymbols()                              { m_aUsedSymbols.clear(); }
-    void    AddToUsedSymbols( const OUString &rSymbolName ) { m_aUsedSymbols.insert( rSymbolName ); }
-
 public:
                  SmParser();
 
diff --git a/starmath/inc/rect.hxx b/starmath/inc/rect.hxx
index 1c8f3e3..c28e1d2 100644
--- a/starmath/inc/rect.hxx
+++ b/starmath/inc/rect.hxx
@@ -114,7 +114,6 @@ protected:
             void Init(const OutputDevice &rDev, const SmFormat *pFormat,
                       const OUString &rText, sal_uInt16 nBorderWidth);
 
-            void ClearBaseline()    { bHasBaseline = false; };
     inline  void CopyMBL(const SmRect& rRect);
             void CopyAlignInfo(const SmRect& rRect);
 
diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx
index d17919e..e6bf323 100644
--- a/starmath/inc/view.hxx
+++ b/starmath/inc/view.hxx
@@ -80,11 +80,6 @@ private:
     sal_uInt16 nZoom;
 
 protected:
-    void SetFormulaDrawPos(const Point &rPos)
-    {
-        aFormulaDrawPos = rPos;
-    }
-
     virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle&) override;
     virtual void KeyInput(const KeyEvent& rKEvt) override;
     virtual void Command(const CommandEvent& rCEvt) override;
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 56023ad..f33a942 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -2255,7 +2255,7 @@ void SmParser::DoSpecial()
     // add symbol name to list of used symbols
     const OUString aSymbolName(m_aCurToken.aText.copy(1));
     if (!aSymbolName.isEmpty())
-        AddToUsedSymbols( aSymbolName );
+        m_aUsedSymbols.insert( aSymbolName );
 
     m_aNodeStack.push_front(o3tl::make_unique<SmSpecialNode>(m_aCurToken));
     NextToken();
@@ -2301,7 +2301,7 @@ SmParser::SmParser()
 
 SmTableNode *SmParser::Parse(const OUString &rBuffer)
 {
-    ClearUsedSymbols();
+    m_aUsedSymbols.clear();
 
     m_aBufferString = convertLineEnd(rBuffer, LINEEND_LF);
     m_nBufferIndex  = 0;
diff --git a/starmath/source/rect.cxx b/starmath/source/rect.cxx
index 550cd24..63798c6 100644
--- a/starmath/source/rect.cxx
+++ b/starmath/source/rect.cxx
@@ -462,7 +462,7 @@ SmRect & SmRect::ExtendBy(const SmRect &rRect, RectCopyMBL eCopyMode)
                 CopyMBL(rRect);
                 break;
             case RectCopyMBL::None:
-                ClearBaseline();
+                bHasBaseline = false;
                 nAlignM = (nAlignT + nAlignB) / 2;
                 break;
             case RectCopyMBL::Xor:
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 3bd645a..47f15e6 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -379,7 +379,7 @@ void SmGraphicWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle&
 
     rDoc.DrawFormula(rRenderContext, aPoint, true);  //! modifies aPoint to be the topleft
                                 //! corner of the formula
-    SetFormulaDrawPos(aPoint);
+    aFormulaDrawPos = aPoint;
     if (IsInlineEditEnabled())
     {
         //Draw cursor if any...


More information about the Libreoffice-commits mailing list