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

Caolán McNamara caolanm at redhat.com
Wed Jan 11 16:15:08 UTC 2017


 include/svtools/grfmgr.hxx        |    1 
 svtools/source/graphic/grfmgr.cxx |   53 +++++++++++++++-----------------------
 2 files changed, 21 insertions(+), 33 deletions(-)

New commits:
commit 4ff1b3589076f66c3d783c3ea6c5f1fd9b9337ed
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jan 11 09:32:20 2017 +0000

    fold ImplConstruct into ctors and reduce to necessary
    
    ImplConstruct sets mnAnimationLoopCount, but is always followed by
    ImplAssignGraphicData which overwrites it so we can omit that
    
    ImplConstruct sets mnDataChangeTimeStamp, but is always
    followed by ImplAssignGraphicData which always calls
    ImplAfterDataChange which overwrites it so we can omit that
    
    Change-Id: I2304dc1ea590071a83ca30768426f721c1bd259c
    Reviewed-on: https://gerrit.libreoffice.org/32953
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/svtools/grfmgr.hxx b/include/svtools/grfmgr.hxx
index ac8bdea..abd8b29 100644
--- a/include/svtools/grfmgr.hxx
+++ b/include/svtools/grfmgr.hxx
@@ -199,7 +199,6 @@ private:
     bool                    mbIsInSwapOut   : 1;
     bool                    mbAlpha         : 1;
 
-    void                    SVT_DLLPRIVATE ImplConstruct();
     void                    SVT_DLLPRIVATE ImplAssignGraphicData();
     static void             SVT_DLLPRIVATE ImplEnsureGraphicManager();
     void                    SVT_DLLPRIVATE ImplAutoSwapIn();
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx
index a42ab8f..ffaa93a 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -70,48 +70,49 @@ void GraphicObject::ImplAfterDataChange()
     mpGlobalMgr->ImplCheckSizeOfSwappedInGraphics(this);
 }
 
-GraphicObject::GraphicObject() :
-    maLink      (),
-    maUserData  ()
+GraphicObject::GraphicObject()
+    : mbAutoSwapped(false)
+    , mbIsInSwapIn(false)
+    , mbIsInSwapOut(false)
 {
     ImplEnsureGraphicManager();
-    ImplConstruct();
     ImplAssignGraphicData();
     mpGlobalMgr->ImplRegisterObj(*this, maGraphic, nullptr, nullptr);
 }
 
-GraphicObject::GraphicObject( const Graphic& rGraphic ) :
-    maGraphic   ( rGraphic ),
-    maLink      (),
-    maUserData  ()
+GraphicObject::GraphicObject(const Graphic& rGraphic)
+    : maGraphic(rGraphic)
+    , mbAutoSwapped(false)
+    , mbIsInSwapIn(false)
+    , mbIsInSwapOut(false)
 {
     ImplEnsureGraphicManager();
-    ImplConstruct();
     ImplAssignGraphicData();
     mpGlobalMgr->ImplRegisterObj(*this, maGraphic, nullptr, nullptr);
 }
 
-GraphicObject::GraphicObject( const GraphicObject& rGraphicObj ) :
-    maGraphic   ( rGraphicObj.GetGraphic() ),
-    maAttr      ( rGraphicObj.maAttr ),
-    maLink      ( rGraphicObj.maLink ),
-    maUserData  ( rGraphicObj.maUserData )
+GraphicObject::GraphicObject(const GraphicObject& rGraphicObj)
+    : maGraphic(rGraphicObj.GetGraphic())
+    , maAttr(rGraphicObj.maAttr)
+    , maLink(rGraphicObj.maLink)
+    , maUserData(rGraphicObj.maUserData)
+    , mbAutoSwapped(false)
+    , mbIsInSwapIn(false)
+    , mbIsInSwapOut(false)
 {
-    ImplConstruct();
     ImplAssignGraphicData();
     mpGlobalMgr->ImplRegisterObj(*this, maGraphic, nullptr, &rGraphicObj);
     if( rGraphicObj.HasUserData() && rGraphicObj.IsSwappedOut() )
         SetSwapState();
 }
 
-GraphicObject::GraphicObject( const OString& rUniqueID ) :
-    maLink      (),
-    maUserData  ()
+GraphicObject::GraphicObject(const OString& rUniqueID)
+    : mbAutoSwapped(false)
+    , mbIsInSwapIn(false)
+    , mbIsInSwapOut(false)
 {
     ImplEnsureGraphicManager();
 
-    ImplConstruct();
-
     // assign default properties
     ImplAssignGraphicData();
 
@@ -132,18 +133,6 @@ GraphicObject::~GraphicObject()
     }
 }
 
-void GraphicObject::ImplConstruct()
-{
-    maSwapStreamHdl = Link<const GraphicObject*, SvStream*>();
-    mnAnimationLoopCount = 0;
-    mbAutoSwapped = false;
-    mbIsInSwapIn = false;
-    mbIsInSwapOut = false;
-
-    // Init with a unique, increasing ID
-    mnDataChangeTimeStamp = aIncrementingTimeOfLastDataChange++;
-}
-
 void GraphicObject::ImplAssignGraphicData()
 {
     maPrefSize = maGraphic.GetPrefSize();


More information about the Libreoffice-commits mailing list