summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-01-11 09:32:20 +0000
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2017-11-28 00:13:25 -0500
commit5df3ec82798e3fff1ea1e71e64a23e501c89af22 (patch)
tree34ccb0b0c45e24ecd8562f7eaffd1ce21648dbda
parentdf86ef575bb68a0eced0226ba2e320d7503d5475 (diff)
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@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 4ff1b3589076f66c3d783c3ea6c5f1fd9b9337ed)
-rw-r--r--include/svtools/grfmgr.hxx1
-rw-r--r--svtools/source/graphic/grfmgr.cxx53
2 files changed, 21 insertions, 33 deletions
diff --git a/include/svtools/grfmgr.hxx b/include/svtools/grfmgr.hxx
index ac8bdea7f792..abd8b2928d0a 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 a42ab8fab207..ffaa93a0abc1 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();