summaryrefslogtreecommitdiff
path: root/svx/source/svdraw
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-07-10 13:48:36 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-07-10 14:13:58 -0400
commiteda334eb1da4ddfe67f1d88d0ba85f86cfbddd87 (patch)
treeae6216416d41edb49e3d1c0ff4d49374c7ca6aa9 /svx/source/svdraw
parent4ce9e4a68f0776842ca8a2ce6ac3e0891ba00fea (diff)
Move Graphic member to the impl class.
Change-Id: Iee58a6c9b7081a2aa00f6f050574a5827840286b
Diffstat (limited to 'svx/source/svdraw')
-rw-r--r--svx/source/svdraw/svdoole2.cxx41
1 files changed, 22 insertions, 19 deletions
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index d801b3787abe..0ae1e16ddbf7 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -670,6 +670,7 @@ class SdrOle2ObjImpl
public:
svt::EmbeddedObjectRef mxObjRef;
+ Graphic* mpGraphic;
// TODO/LATER: do we really need this pointer?
GraphicObject* pGraphicObject;
OUString aPersistName; // name of object in persist
@@ -683,6 +684,7 @@ public:
OUString maLinkURL;
SdrOle2ObjImpl() :
+ mpGraphic(NULL),
pGraphicObject(NULL),
pLightClient (NULL),
mbLoadingOLEObjectFailed(false),
@@ -694,6 +696,7 @@ public:
SdrOle2ObjImpl( const svt::EmbeddedObjectRef& rObjRef ) :
mxObjRef(rObjRef),
+ mpGraphic(NULL),
pGraphicObject(NULL),
pLightClient (NULL),
mbLoadingOLEObjectFailed(false),
@@ -702,6 +705,12 @@ public:
{
mxObjRef.Lock(true);
}
+
+ ~SdrOle2ObjImpl()
+ {
+ delete mpGraphic;
+ delete pGraphicObject;
+ }
};
@@ -750,7 +759,6 @@ TYPEINIT1(SdrOle2Obj,SdrRectObj);
SdrOle2Obj::SdrOle2Obj( bool bFrame_ ) :
mpImpl(new SdrOle2ObjImpl),
- pGraphic(NULL),
bFrame(bFrame_),
bInDestruction(false),
mbSuppressSetVisAreaSize(false),
@@ -763,7 +771,6 @@ SdrOle2Obj::SdrOle2Obj( bool bFrame_ ) :
SdrOle2Obj::SdrOle2Obj( const svt::EmbeddedObjectRef& rNewObjRef, const OUString& rNewObjName, const Rectangle& rNewRect, bool bFrame_ ) :
SdrRectObj(rNewRect),
mpImpl(new SdrOle2ObjImpl(rNewObjRef)),
- pGraphic(NULL),
bFrame(bFrame_),
bInDestruction(false),
mbSuppressSetVisAreaSize(false),
@@ -799,10 +806,6 @@ SdrOle2Obj::~SdrOle2Obj()
if ( mpImpl->mbConnected )
Disconnect();
- delete pGraphic;
-
- delete mpImpl->pGraphicObject;
-
if(pModifyListener)
{
pModifyListener->invalidate();
@@ -848,18 +851,18 @@ bool SdrOle2Obj::isUiActive() const
void SdrOle2Obj::SetGraphic_Impl(const Graphic* pGrf)
{
- if ( pGraphic )
+ if (mpImpl->mpGraphic)
{
- delete pGraphic;
- pGraphic = NULL;
+ delete mpImpl->mpGraphic;
+ mpImpl->mpGraphic = NULL;
delete mpImpl->pGraphicObject;
mpImpl->pGraphicObject = NULL;
}
- if (pGrf!=NULL)
+ if (pGrf)
{
- pGraphic = new Graphic(*pGrf);
- mpImpl->pGraphicObject = new GraphicObject( *pGraphic );
+ mpImpl->mpGraphic = new Graphic(*pGrf);
+ mpImpl->pGraphicObject = new GraphicObject(*mpImpl->mpGraphic);
}
SetChanged();
@@ -1510,7 +1513,7 @@ void SdrOle2Obj::SetObjRef( const com::sun::star::uno::Reference < com::sun::sta
if ( mpImpl->mxObjRef.is() )
{
- DELETEZ( pGraphic );
+ DELETEZ(mpImpl->mpGraphic);
if ( (mpImpl->mxObjRef->getStatus( GetAspect() ) & embed::EmbedMisc::EMBED_NEVERRESIZE ) )
SetResizeProtect(true);
@@ -1666,16 +1669,16 @@ SdrOle2Obj& SdrOle2Obj::assignFrom(
aProgName = rOle2Obj.aProgName;
bFrame = rOle2Obj.bFrame;
- if( rOle2Obj.pGraphic )
+ if (rOle2Obj.mpImpl->mpGraphic)
{
- if( pGraphic )
+ if (mpImpl->mpGraphic)
{
- delete pGraphic;
+ delete mpImpl->mpGraphic;
delete mpImpl->pGraphicObject;
}
- pGraphic = new Graphic( *rOle2Obj.pGraphic );
- mpImpl->pGraphicObject = new GraphicObject( *pGraphic );
+ mpImpl->mpGraphic = new Graphic(*rOle2Obj.mpImpl->mpGraphic);
+ mpImpl->pGraphicObject = new GraphicObject(*mpImpl->mpGraphic);
}
if( pModel && rObj.GetModel() && !IsEmptyPresObj() )
@@ -1905,7 +1908,7 @@ const Graphic* SdrOle2Obj::GetGraphic() const
{
if ( mpImpl->mxObjRef.is() )
return mpImpl->mxObjRef.GetGraphic();
- return pGraphic;
+ return mpImpl->mpGraphic;
}
void SdrOle2Obj::GetNewReplacement()