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>
This commit is contained in:
Caolán McNamara
2017-01-11 09:32:20 +00:00
parent 05d509482c
commit 4ff1b35890
2 changed files with 21 additions and 33 deletions

View File

@@ -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();

View File

@@ -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();