[Libreoffice-commits] core.git: 9 commits - filter/source include/svx reportdesign/source sc/source sd/source svx/source

Kohei Yoshida kohei.yoshida at collabora.com
Thu Jul 10 11:14:14 PDT 2014


 filter/source/msfilter/msdffimp.cxx                      |    1 
 filter/source/msfilter/svdfppt.cxx                       |    2 
 include/svx/svdoole2.hxx                                 |   65 --
 reportdesign/source/core/sdr/RptObject.cxx               |    1 
 sc/source/core/data/documen5.cxx                         |    1 
 sc/source/core/tool/charthelper.cxx                      |    1 
 sc/source/filter/excel/xeescher.cxx                      |    1 
 sc/source/filter/excel/xiescher.cxx                      |    1 
 sc/source/filter/starcalc/scfobj.cxx                     |    1 
 sc/source/ui/drawfunc/fuins2.cxx                         |    1 
 sc/source/ui/unoobj/chartuno.cxx                         |    1 
 sc/source/ui/view/viewfun7.cxx                           |    1 
 sd/source/ui/func/fuinsert.cxx                           |    1 
 sd/source/ui/view/sdview3.cxx                            |    1 
 sd/source/ui/view/sdview4.cxx                            |    1 
 svx/source/sdr/contact/viewcontactofsdrole2obj.cxx       |    2 
 svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx |    2 
 svx/source/svdraw/svdetc.cxx                             |    8 
 svx/source/svdraw/svdoole2.cxx                           |  442 +++++++--------
 svx/source/unodraw/unoshap4.cxx                          |    2 
 20 files changed, 277 insertions(+), 259 deletions(-)

New commits:
commit de66e122af3fb5ccd13ed38b28b5e04ab1433b43
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Thu Jul 10 14:11:02 2014 -0400

    Move the rest of the members to the impl class.
    
    Change-Id: I80186a617c751420954b27e070559cc8487c7fd9

diff --git a/include/svx/svdoole2.hxx b/include/svx/svdoole2.hxx
index 9fad1a3..9922f4c 100644
--- a/include/svx/svdoole2.hxx
+++ b/include/svx/svdoole2.hxx
@@ -42,10 +42,12 @@ namespace svt { class EmbeddedObjectRef; }
 class SvxUnoShapeModifyListener;
 class SdrOle2ObjImpl;
 
-class SVX_DLLPUBLIC SdrOle2Obj :  public SdrRectObj
+class SVX_DLLPUBLIC SdrOle2Obj : public SdrRectObj
 {
 private:
+    SdrOle2ObjImpl* mpImpl;
 
+private:
     SVX_DLLPRIVATE void Connect_Impl();
     SVX_DLLPRIVATE void Disconnect_Impl();
     SVX_DLLPRIVATE void Reconnect_Impl();
@@ -56,29 +58,13 @@ private:
     SVX_DLLPRIVATE void SetGraphic_Impl(const Graphic* pGrf);
 
     // #i118485# helper added
-    SdrObject* createSdrGrafObjReplacement(bool bAddText, bool bUseHCGraphic) const;
+    SVX_DLLPRIVATE SdrObject* createSdrGrafObjReplacement(bool bAddText, bool bUseHCGraphic) const;
+    SVX_DLLPRIVATE void ImpSetVisAreaSize();
 
 protected:
     virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() SAL_OVERRIDE;
     virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() SAL_OVERRIDE;
 
-private:
-    SdrOle2ObjImpl*             mpImpl;
-
-    // Due to compatibility at SdrTextObj for now
-    bool                        bFrame:1;
-    bool                        bInDestruction:1;
-    // #i118524#
-    bool                        mbSuppressSetVisAreaSize:1;
-    mutable bool                m_bTypeAsked:1;
-    mutable bool                m_bChart:1;
-
-    SvxUnoShapeModifyListener*  pModifyListener;
-
-private:
-
-    void ImpSetVisAreaSize();
-
 public:
     OUString GetStyleString();
     TYPEINFO_OVERRIDE();
@@ -106,7 +92,7 @@ public:
 
     // #i118524# Allow suppress SetVisAreaSize in changing methods when call
     // comes from OLE client
-    void setSuppressSetVisAreaSize(bool bNew) { mbSuppressSetVisAreaSize = bNew; }
+    void setSuppressSetVisAreaSize( bool bNew );
 
     // OLE object has got a separate PersistName member now;
     // !!! use ::SetPersistName( ... ) only, if you know what you do !!!
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index 0206b06..bcb7b76 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -677,32 +677,50 @@ public:
     OUString        aPersistName;       // name of object in persist
     SdrLightEmbeddedClient_Impl* pLightClient; // must be registered as client only using AddOwnLightClient() call
 
-    // New local var to avoid repeated loading if load of OLE2 fails
-    bool            mbLoadingOLEObjectFailed;
-    bool            mbConnected;
+    bool mbFrame:1; // Due to compatibility at SdrTextObj for now
+    bool mbInDestruction:1;
+    bool mbSuppressSetVisAreaSize:1; // #i118524#
+    mutable bool mbTypeAsked:1;
+    mutable bool mbIsChart:1;
+    bool mbLoadingOLEObjectFailed:1; // New local var to avoid repeated loading if load of OLE2 fails
+    bool mbConnected:1;
 
     SdrEmbedObjectLink* mpObjectLink;
     OUString maLinkURL;
 
-    SdrOle2ObjImpl() :
+    SvxUnoShapeModifyListener* mpModifyListener;
+
+    SdrOle2ObjImpl( bool bFrame ) :
         mpGraphic(NULL),
         mpGraphicObject(NULL),
         pLightClient (NULL),
+        mbFrame(bFrame),
+        mbInDestruction(false),
+        mbSuppressSetVisAreaSize(false),
+        mbTypeAsked(false),
+        mbIsChart(false),
         mbLoadingOLEObjectFailed(false),
         mbConnected(false),
-        mpObjectLink(NULL)
+        mpObjectLink(NULL),
+        mpModifyListener(NULL)
     {
         mxObjRef.Lock(true);
     }
 
-    SdrOle2ObjImpl( const svt::EmbeddedObjectRef& rObjRef ) :
+    SdrOle2ObjImpl( bool bFrame, const svt::EmbeddedObjectRef& rObjRef ) :
         mxObjRef(rObjRef),
         mpGraphic(NULL),
         mpGraphicObject(NULL),
         pLightClient (NULL),
+        mbFrame(bFrame),
+        mbInDestruction(false),
+        mbSuppressSetVisAreaSize(false),
+        mbTypeAsked(false),
+        mbIsChart(false),
         mbLoadingOLEObjectFailed(false),
         mbConnected(false),
-        mpObjectLink(NULL)
+        mpObjectLink(NULL),
+        mpModifyListener(NULL)
     {
         mxObjRef.Lock(true);
     }
@@ -711,6 +729,12 @@ public:
     {
         delete mpGraphic;
         delete mpGraphicObject;
+
+        if (mpModifyListener)
+        {
+            mpModifyListener->invalidate();
+            mpModifyListener->release();
+        }
     }
 };
 
@@ -759,25 +783,13 @@ sdr::contact::ViewContact* SdrOle2Obj::CreateObjectSpecificViewContact()
 TYPEINIT1(SdrOle2Obj,SdrRectObj);
 
 SdrOle2Obj::SdrOle2Obj( bool bFrame_ ) :
-    mpImpl(new SdrOle2ObjImpl),
-    bFrame(bFrame_),
-    bInDestruction(false),
-    mbSuppressSetVisAreaSize(false),
-    m_bTypeAsked(false),
-    m_bChart(false),
-    pModifyListener(NULL)
+    mpImpl(new SdrOle2ObjImpl(bFrame_))
 {
 }
 
 SdrOle2Obj::SdrOle2Obj( const svt::EmbeddedObjectRef&  rNewObjRef, const OUString& rNewObjName, const Rectangle& rNewRect, bool bFrame_ ) :
     SdrRectObj(rNewRect),
-    mpImpl(new SdrOle2ObjImpl(rNewObjRef)),
-    bFrame(bFrame_),
-    bInDestruction(false),
-    mbSuppressSetVisAreaSize(false),
-    m_bTypeAsked(false),
-    m_bChart(false),
-    pModifyListener(NULL)
+    mpImpl(new SdrOle2ObjImpl(bFrame_, rNewObjRef))
 {
     mpImpl->aPersistName = rNewObjName;
 
@@ -802,17 +814,11 @@ OUString SdrOle2Obj::GetStyleString()
 
 SdrOle2Obj::~SdrOle2Obj()
 {
-    bInDestruction = true;
+    mpImpl->mbInDestruction = true;
 
     if ( mpImpl->mbConnected )
         Disconnect();
 
-    if(pModifyListener)
-    {
-        pModifyListener->invalidate();
-        pModifyListener->release();
-    }
-
     DisconnectFileLink_Impl();
 
     if ( mpImpl->pLightClient )
@@ -1088,7 +1094,7 @@ void SdrOle2Obj::Connect_Impl()
                 else if ( !mpImpl->mxObjRef.is() )
                 {
                     mpImpl->mxObjRef.Assign( rContainer.GetEmbeddedObject( mpImpl->aPersistName ), mpImpl->mxObjRef.GetViewAspect() );
-                    m_bTypeAsked = false;
+                    mpImpl->mbTypeAsked = false;
                 }
 
                 if ( mpImpl->mxObjRef.GetObject().is() )
@@ -1163,16 +1169,16 @@ void SdrOle2Obj::AddListeners_Impl()
     if( mpImpl->mxObjRef.is() && mpImpl->mxObjRef->getCurrentState() != embed::EmbedStates::LOADED )
     {
         // register modify listener
-        if( !pModifyListener )
+        if (!mpImpl->mpModifyListener)
         {
-            ((SdrOle2Obj*)this)->pModifyListener = new SvxUnoShapeModifyListener( (SdrOle2Obj*)this );
-            pModifyListener->acquire();
+            mpImpl->mpModifyListener = new SvxUnoShapeModifyListener(this);
+            mpImpl->mpModifyListener->acquire();
         }
 
         uno::Reference< util::XModifyBroadcaster > xBC( getXModel(), uno::UNO_QUERY );
-        if( xBC.is() && pModifyListener )
+        if (xBC.is() && mpImpl->mpModifyListener)
         {
-            uno::Reference< util::XModifyListener > xListener( pModifyListener );
+            uno::Reference<util::XModifyListener> xListener(mpImpl->mpModifyListener);
             xBC->addModifyListener( xListener );
         }
     }
@@ -1205,9 +1211,9 @@ void SdrOle2Obj::RemoveListeners_Impl()
             if ( nState != embed::EmbedStates::LOADED )
             {
                 uno::Reference< util::XModifyBroadcaster > xBC( getXModel(), uno::UNO_QUERY );
-                if( xBC.is() && pModifyListener )
+                if (xBC.is() && mpImpl->mpModifyListener)
                 {
-                    uno::Reference< util::XModifyListener > xListener( pModifyListener );
+                    uno::Reference<util::XModifyListener> xListener(mpImpl->mpModifyListener);
                     xBC->removeModifyListener( xListener );
                 }
             }
@@ -1518,7 +1524,7 @@ void SdrOle2Obj::SetObjRef( const com::sun::star::uno::Reference < com::sun::sta
         Disconnect();
 
     mpImpl->mxObjRef.Assign( rNewObjRef, GetAspect() );
-    m_bTypeAsked = false;
+    mpImpl->mbTypeAsked = false;
 
     if ( mpImpl->mxObjRef.is() )
     {
@@ -1607,14 +1613,14 @@ void SdrOle2Obj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
 
 sal_uInt16 SdrOle2Obj::GetObjIdentifier() const
 {
-    return bFrame ? sal_uInt16(OBJ_FRAME) : sal_uInt16(OBJ_OLE2);
+    return mpImpl->mbFrame ? sal_uInt16(OBJ_FRAME) : sal_uInt16(OBJ_OLE2);
 }
 
 
 
 OUString SdrOle2Obj::TakeObjNameSingul() const
 {
-    OUStringBuffer sName(ImpGetResStr(bFrame ? STR_ObjNameSingulFrame : STR_ObjNameSingulOLE2));
+    OUStringBuffer sName(ImpGetResStr(mpImpl->mbFrame ? STR_ObjNameSingulFrame : STR_ObjNameSingulOLE2));
 
     const OUString aName(GetName());
 
@@ -1632,7 +1638,7 @@ OUString SdrOle2Obj::TakeObjNameSingul() const
 
 OUString SdrOle2Obj::TakeObjNamePlural() const
 {
-    return ImpGetResStr(bFrame ? STR_ObjNamePluralFrame : STR_ObjNamePluralOLE2);
+    return ImpGetResStr(mpImpl->mbFrame ? STR_ObjNamePluralFrame : STR_ObjNamePluralOLE2);
 }
 
 
@@ -1676,7 +1682,7 @@ SdrOle2Obj& SdrOle2Obj::assignFrom(
 
         mpImpl->aPersistName = rOle2Obj.mpImpl->aPersistName;
         mpImpl->maProgName = rOle2Obj.mpImpl->maProgName;
-        bFrame = rOle2Obj.bFrame;
+        mpImpl->mbFrame = rOle2Obj.mpImpl->mbFrame;
 
         if (rOle2Obj.mpImpl->mpGraphic)
         {
@@ -1704,7 +1710,7 @@ SdrOle2Obj& SdrOle2Obj::assignFrom(
                     OUString aTmp;
                     mpImpl->mxObjRef.Assign( pDestPers->getEmbeddedObjectContainer().CopyAndGetEmbeddedObject(
                         rContainer, xObj, aTmp, rSrcShellID, rDestShellID), rOle2Obj.GetAspect());
-                    m_bTypeAsked = false;
+                    mpImpl->mbTypeAsked = false;
                     mpImpl->aPersistName = aTmp;
                     CheckFileLink_Impl();
                 }
@@ -1724,7 +1730,7 @@ SdrOle2Obj& SdrOle2Obj::operator=(const SdrOle2Obj& rObj)
 void SdrOle2Obj::ImpSetVisAreaSize()
 {
     // #i118524# do not again set VisAreaSize when the call comes from OLE client (e.g. ObjectAreaChanged)
-    if(mbSuppressSetVisAreaSize)
+    if (mpImpl->mbSuppressSetVisAreaSize)
         return;
 
     // currently there is no need to recalculate scaling for iconified objects
@@ -1933,7 +1939,10 @@ Size SdrOle2Obj::GetOrigObjSize( MapMode* pTargetMapMode ) const
     return mpImpl->mxObjRef.GetSize( pTargetMapMode );
 }
 
-
+void SdrOle2Obj::setSuppressSetVisAreaSize( bool bNew )
+{
+    mpImpl->mbSuppressSetVisAreaSize = bNew;
+}
 
 void SdrOle2Obj::NbcMove(const Size& rSize)
 {
@@ -2031,7 +2040,7 @@ void SdrOle2Obj::GetObjRef_Impl()
         if(!mpImpl->mbLoadingOLEObjectFailed)
         {
             mpImpl->mxObjRef.Assign( pModel->GetPersist()->getEmbeddedObjectContainer().GetEmbeddedObject( mpImpl->aPersistName ), GetAspect() );
-            m_bTypeAsked = false;
+            mpImpl->mbTypeAsked = false;
             CheckFileLink_Impl();
 
             // If loading of OLE object failed, remember that to not invoke a endless
@@ -2073,7 +2082,7 @@ void SdrOle2Obj::GetObjRef_Impl()
                 if (pModel && pModel->GetRefDevice() &&
                     pModel->GetRefDevice()->GetOutDevType() == OUTDEV_PRINTER)
                 {
-                    if(!bInDestruction)
+                    if (!mpImpl->mbInDestruction)
                     {
                         //TODO/LATER: printerchange notification
                         /*
@@ -2128,12 +2137,12 @@ uno::Reference< frame::XModel > SdrOle2Obj::getXModel() const
 
 bool SdrOle2Obj::IsChart() const
 {
-    if ( !m_bTypeAsked )
+    if (!mpImpl->mbTypeAsked)
     {
-        m_bChart = ChartHelper::IsChart(mpImpl->mxObjRef);
-        m_bTypeAsked = true;
+        mpImpl->mbIsChart = ChartHelper::IsChart(mpImpl->mxObjRef);
+        mpImpl->mbTypeAsked = true;
     }
-    return m_bChart;
+    return mpImpl->mbIsChart;
 }
 
 
commit 11c682057550b6551940e762d3b403586e1f5ea8
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Thu Jul 10 13:53:37 2014 -0400

    Move "prog name" (whatever it is) to the impl class.
    
    Change-Id: Ifa4f2f2f923d4800cf5fd540631204492ace1936

diff --git a/include/svx/svdoole2.hxx b/include/svx/svdoole2.hxx
index 5ddf315..9fad1a3 100644
--- a/include/svx/svdoole2.hxx
+++ b/include/svx/svdoole2.hxx
@@ -65,8 +65,6 @@ protected:
 private:
     SdrOle2ObjImpl*             mpImpl;
 
-    OUString                    aProgName;
-
     // Due to compatibility at SdrTextObj for now
     bool                        bFrame:1;
     bool                        bInDestruction:1;
@@ -117,8 +115,8 @@ public:
 
     // One can add an application name to a SdrOle2Obj, which can be queried for
     // later on (SD needs this for presentation objects).
-    void SetProgName(const OUString& rNam) { aProgName=rNam; }
-    const OUString& GetProgName() const { return aProgName; }
+    void SetProgName( const OUString& rName );
+    const OUString& GetProgName() const;
     bool IsEmpty() const;
 
     void SetObjRef(const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject >& rNewObjRef);
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index 69f327f..0206b06 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -673,6 +673,7 @@ public:
     Graphic* mpGraphic;
     // TODO/LATER: do we really need this pointer?
     GraphicObject* mpGraphicObject;
+    OUString maProgName;
     OUString        aPersistName;       // name of object in persist
     SdrLightEmbeddedClient_Impl* pLightClient; // must be registered as client only using AddOwnLightClient() call
 
@@ -875,7 +876,15 @@ void SdrOle2Obj::SetGraphic(const Graphic* pGrf)
     SetGraphic_Impl( pGrf );
 }
 
+void SdrOle2Obj::SetProgName( const OUString& rName )
+{
+    mpImpl->maProgName = rName;
+}
 
+const OUString& SdrOle2Obj::GetProgName() const
+{
+    return mpImpl->maProgName;
+}
 
 bool SdrOle2Obj::IsEmpty() const
 {
@@ -1666,7 +1675,7 @@ SdrOle2Obj& SdrOle2Obj::assignFrom(
         SetClosedObj( rObj.IsClosedObj() );
 
         mpImpl->aPersistName = rOle2Obj.mpImpl->aPersistName;
-        aProgName = rOle2Obj.aProgName;
+        mpImpl->maProgName = rOle2Obj.mpImpl->maProgName;
         bFrame = rOle2Obj.bFrame;
 
         if (rOle2Obj.mpImpl->mpGraphic)
commit cf470718ca5e906ae4c6da3fad3698872f97ee6f
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Thu Jul 10 13:49:37 2014 -0400

    pGraphicObject -> mpGraphicObject
    
    Change-Id: I8b396ff1018fb54eecd44624a11bc2e405bb7f84

diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index 0ae1e16..69f327f 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -672,7 +672,7 @@ public:
 
     Graphic* mpGraphic;
     // TODO/LATER: do we really need this pointer?
-    GraphicObject*  pGraphicObject;
+    GraphicObject* mpGraphicObject;
     OUString        aPersistName;       // name of object in persist
     SdrLightEmbeddedClient_Impl* pLightClient; // must be registered as client only using AddOwnLightClient() call
 
@@ -685,7 +685,7 @@ public:
 
     SdrOle2ObjImpl() :
         mpGraphic(NULL),
-        pGraphicObject(NULL),
+        mpGraphicObject(NULL),
         pLightClient (NULL),
         mbLoadingOLEObjectFailed(false),
         mbConnected(false),
@@ -697,7 +697,7 @@ public:
     SdrOle2ObjImpl( const svt::EmbeddedObjectRef& rObjRef ) :
         mxObjRef(rObjRef),
         mpGraphic(NULL),
-        pGraphicObject(NULL),
+        mpGraphicObject(NULL),
         pLightClient (NULL),
         mbLoadingOLEObjectFailed(false),
         mbConnected(false),
@@ -709,7 +709,7 @@ public:
     ~SdrOle2ObjImpl()
     {
         delete mpGraphic;
-        delete pGraphicObject;
+        delete mpGraphicObject;
     }
 };
 
@@ -855,14 +855,14 @@ void SdrOle2Obj::SetGraphic_Impl(const Graphic* pGrf)
     {
         delete mpImpl->mpGraphic;
         mpImpl->mpGraphic = NULL;
-        delete mpImpl->pGraphicObject;
-        mpImpl->pGraphicObject = NULL;
+        delete mpImpl->mpGraphicObject;
+        mpImpl->mpGraphicObject = NULL;
     }
 
     if (pGrf)
     {
         mpImpl->mpGraphic = new Graphic(*pGrf);
-        mpImpl->pGraphicObject = new GraphicObject(*mpImpl->mpGraphic);
+        mpImpl->mpGraphicObject = new GraphicObject(*mpImpl->mpGraphic);
     }
 
     SetChanged();
@@ -1674,11 +1674,11 @@ SdrOle2Obj& SdrOle2Obj::assignFrom(
             if (mpImpl->mpGraphic)
             {
                 delete mpImpl->mpGraphic;
-                delete mpImpl->pGraphicObject;
+                delete mpImpl->mpGraphicObject;
             }
 
             mpImpl->mpGraphic = new Graphic(*rOle2Obj.mpImpl->mpGraphic);
-            mpImpl->pGraphicObject = new GraphicObject(*mpImpl->mpGraphic);
+            mpImpl->mpGraphicObject = new GraphicObject(*mpImpl->mpGraphic);
         }
 
         if( pModel && rObj.GetModel() && !IsEmptyPresObj() )
commit eda334eb1da4ddfe67f1d88d0ba85f86cfbddd87
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Thu Jul 10 13:48:36 2014 -0400

    Move Graphic member to the impl class.
    
    Change-Id: Iee58a6c9b7081a2aa00f6f050574a5827840286b

diff --git a/include/svx/svdoole2.hxx b/include/svx/svdoole2.hxx
index ad60e56..5ddf315 100644
--- a/include/svx/svdoole2.hxx
+++ b/include/svx/svdoole2.hxx
@@ -39,7 +39,6 @@ namespace frame { class XModel; }
 
 namespace svt { class EmbeddedObjectRef; }
 
-class Graphic;
 class SvxUnoShapeModifyListener;
 class SdrOle2ObjImpl;
 
@@ -66,7 +65,6 @@ protected:
 private:
     SdrOle2ObjImpl*             mpImpl;
 
-    Graphic*                    pGraphic;
     OUString                    aProgName;
 
     // Due to compatibility at SdrTextObj for now
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index d801b37..0ae1e16 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()
commit 4ce9e4a68f0776842ca8a2ce6ac3e0891ba00fea
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Thu Jul 10 13:33:32 2014 -0400

    Head cleanup - use forward declarations.
    
    Change-Id: Icc4fa0acad77d61200eb77cc70e21866590b658e

diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 350d4d5..66e49fd 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -135,6 +135,7 @@
 #include <svx/xbitmap.hxx>
 #include <rtl/strbuf.hxx>
 #include <rtl/ustring.hxx>
+#include <svtools/embedhlp.hxx>
 #include <boost/scoped_array.hpp>
 #include <boost/scoped_ptr.hpp>
 
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 17d4e71..3fba7da 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -115,6 +115,8 @@
 #include <com/sun/star/table/BorderLine2.hpp>
 #include <com/sun/star/table/BorderLineStyle.hpp>
 #include <vcl/virdev.hxx>
+#include <svtools/embedhlp.hxx>
+
 #include <algorithm>
 #include <set>
 #include <rtl/strbuf.hxx>
diff --git a/include/svx/svdoole2.hxx b/include/svx/svdoole2.hxx
index 7384662..ad60e56 100644
--- a/include/svx/svdoole2.hxx
+++ b/include/svx/svdoole2.hxx
@@ -20,28 +20,26 @@
 #ifndef INCLUDED_SVX_SVDOOLE2_HXX
 #define INCLUDED_SVX_SVDOOLE2_HXX
 
-#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/datatransfer/XTransferable.hpp>
-#include <com/sun/star/awt/XWindow.hpp>
 #include <svx/svdorect.hxx>
-#include <vcl/graph.hxx>
-#include <vcl/gdimtf.hxx>
-#include <sot/storage.hxx>
 #include <svx/svxdllapi.h>
 
-namespace com { namespace sun { namespace star { namespace embed {
+#include <com/sun/star/uno/Reference.h>
+
+namespace com { namespace sun { namespace star {
+
+namespace awt { class XWindow; }
 
-class XEmbeddedObject;
+namespace datatransfer { class XTransferable; }
 
-}}}}
+namespace embed { class XEmbeddedObject; }
 
-namespace svt {
+namespace frame { class XModel; }
 
-class EmbeddedObjectRef;
+}}}
 
-}
+namespace svt { class EmbeddedObjectRef; }
 
+class Graphic;
 class SvxUnoShapeModifyListener;
 class SdrOle2ObjImpl;
 
diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx
index 45ade69..0d76ae2 100644
--- a/reportdesign/source/core/sdr/RptObject.cxx
+++ b/reportdesign/source/core/sdr/RptObject.cxx
@@ -39,6 +39,7 @@
 #include <svx/sderitm.hxx>
 #include <svx/xlnwtit.hxx>
 #include <svx/xlntrit.hxx>
+#include <svtools/embedhlp.hxx>
 #include <com/sun/star/style/XStyle.hpp>
 #include <com/sun/star/awt/XTabControllerModel.hpp>
 #include <com/sun/star/awt/XUnoControlContainer.hpp>
diff --git a/sc/source/core/data/documen5.cxx b/sc/source/core/data/documen5.cxx
index 85fa413..b902979 100644
--- a/sc/source/core/data/documen5.cxx
+++ b/sc/source/core/data/documen5.cxx
@@ -29,6 +29,7 @@
 #include <svx/svditer.hxx>
 #include <svx/svdoole2.hxx>
 #include <svx/svdpage.hxx>
+#include <svtools/embedhlp.hxx>
 
 #include "document.hxx"
 #include "table.hxx"
diff --git a/sc/source/core/tool/charthelper.cxx b/sc/source/core/tool/charthelper.cxx
index c003148..012eb87 100644
--- a/sc/source/core/tool/charthelper.cxx
+++ b/sc/source/core/tool/charthelper.cxx
@@ -27,6 +27,7 @@
 #include <svx/svditer.hxx>
 #include <svx/svdoole2.hxx>
 #include <svx/svdpage.hxx>
+#include <svtools/embedhlp.hxx>
 
 #include <com/sun/star/chart2/data/XDataReceiver.hpp>
 #include <com/sun/star/util/XModifiable.hpp>
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index 51f8781..3b6a2f8 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -44,6 +44,7 @@
 #include <editeng/editobj.hxx>
 #include <unotools/tempfile.hxx>
 #include <unotools/ucbstreamhelper.hxx>
+#include <svtools/embedhlp.hxx>
 
 #include "editutil.hxx"
 #include "unonames.hxx"
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index ad65595..86f14a1 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -81,6 +81,7 @@
 #include <svx/xlntrit.hxx>
 #include <svx/xbtmpit.hxx>
 #include <svx/xbitmap.hxx>
+#include <svtools/embedhlp.hxx>
 
 #include "document.hxx"
 #include "drwlayer.hxx"
diff --git a/sc/source/filter/starcalc/scfobj.cxx b/sc/source/filter/starcalc/scfobj.cxx
index 08e7416..b9f231b 100644
--- a/sc/source/filter/starcalc/scfobj.cxx
+++ b/sc/source/filter/starcalc/scfobj.cxx
@@ -27,6 +27,7 @@ using namespace com::sun::star;
 #include <svx/charthelper.hxx>
 #include <svx/svdoole2.hxx>
 #include <svx/svdpage.hxx>
+#include <svtools/embedhlp.hxx>
 #include <sfx2/objsh.hxx>
 #include <sot/storage.hxx>
 #include <sfx2/app.hxx>
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index 3065001..fa9dbfd 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -37,6 +37,7 @@
 #include <unotools/moduleoptions.hxx>
 #include <svtools/insdlg.hxx>
 #include <svtools/soerr.hxx>
+#include <svtools/embedhlp.hxx>
 #include <svx/svxdlg.hxx>
 #include <comphelper/classids.hxx>
 #include <svx/svdpagv.hxx>
diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx
index e5d7321..155f146 100644
--- a/sc/source/ui/unoobj/chartuno.cxx
+++ b/sc/source/ui/unoobj/chartuno.cxx
@@ -34,6 +34,7 @@
 #include <comphelper/classids.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
 #include <svx/charthelper.hxx>
+#include <svtools/embedhlp.hxx>
 
 #include "chartuno.hxx"
 #include "miscuno.hxx"
diff --git a/sc/source/ui/view/viewfun7.cxx b/sc/source/ui/view/viewfun7.cxx
index 68bf809..4700406 100644
--- a/sc/source/ui/view/viewfun7.cxx
+++ b/sc/source/ui/view/viewfun7.cxx
@@ -28,6 +28,7 @@
 #include <svx/svdundo.hxx>
 #include <svx/xbtmpit.hxx>
 #include <svx/xoutbmp.hxx>
+#include <svtools/embedhlp.hxx>
 #include <sfx2/objsh.hxx>
 #include <sfx2/viewfrm.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx
index 05b80fd..bef5991 100644
--- a/sd/source/ui/func/fuinsert.cxx
+++ b/sd/source/ui/func/fuinsert.cxx
@@ -41,6 +41,7 @@
 #include <svl/globalnameitem.hxx>
 #include <unotools/pathoptions.hxx>
 #include <svtools/miscopt.hxx>
+#include <svtools/embedhlp.hxx>
 #include <svx/pfiledlg.hxx>
 #include <svx/dialogs.hrc>
 #include <sfx2/linkmgr.hxx>
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx
index 335b58a..47f962c 100644
--- a/sd/source/ui/view/sdview3.cxx
+++ b/sd/source/ui/view/sdview3.cxx
@@ -53,6 +53,7 @@
 #include <vcl/metaact.hxx>
 #include <svx/svxids.hrc>
 #include <toolkit/helper/vclunohelper.hxx>
+#include <svtools/embedhlp.hxx>
 #include "DrawDocShell.hxx"
 #include "fupoor.hxx"
 #include "tablefunction.hxx"
diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx
index a437669..b15b44f 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -38,6 +38,7 @@
 #include <avmedia/modeltools.hxx>
 #include <svtools/ehdl.hxx>
 #include <svtools/sfxecode.hxx>
+#include <svtools/embedhlp.hxx>
 #include <vcl/graphicfilter.hxx>
 #include "app.hrc"
 #include "Window.hxx"
diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx
index fbf9801..fad9bf8 100644
--- a/svx/source/svdraw/svdetc.cxx
+++ b/svx/source/svdraw/svdetc.cxx
@@ -20,8 +20,6 @@
 #include "sal/config.h"
 
 #include "editeng/forbiddencharacterstable.hxx"
-#include <com/sun/star/embed/XEmbeddedObject.hpp>
-#include <com/sun/star/embed/EmbedStates.hpp>
 #include "officecfg/Office/Common.hxx"
 #include <svx/svdetc.hxx>
 #include <svx/svdmodel.hxx>
@@ -48,7 +46,6 @@
 #include <svx/svdoole2.hxx>
 #include <svl/itempool.hxx>
 #include <unotools/localedatawrapper.hxx>
-#include <com/sun/star/lang/Locale.hpp>
 #include <i18nlangtag/lang.h>
 #include <unotools/syslocale.hxx>
 #include <svx/xflbckit.hxx>
@@ -61,6 +58,11 @@
 #include <svx/svdotable.hxx>
 #include <svx/sdrhittesthelper.hxx>
 
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/embed/XEmbeddedObject.hpp>
+#include <com/sun/star/embed/EmbedStates.hpp>
+#include <com/sun/star/lang/Locale.hpp>
+
 using namespace ::com::sun::star;
 
 /******************************************************************************
commit 2aef59dca407a1d342874cde88732b6cb9e131b4
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Thu Jul 10 13:08:07 2014 -0400

    Move the embedded object to the impl class.
    
    Change-Id: I15af9a74fdcc40d65b3f8b394fc69037c017fe76

diff --git a/include/svx/svdoole2.hxx b/include/svx/svdoole2.hxx
index 3b6b006..7384662 100644
--- a/include/svx/svdoole2.hxx
+++ b/include/svx/svdoole2.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_SVX_SVDOOLE2_HXX
 #define INCLUDED_SVX_SVDOOLE2_HXX
 
-#include <svtools/embedhlp.hxx>
 #include <com/sun/star/uno/Reference.h>
 #include <com/sun/star/frame/XModel.hpp>
 #include <com/sun/star/datatransfer/XTransferable.hpp>
@@ -31,9 +30,17 @@
 #include <sot/storage.hxx>
 #include <svx/svxdllapi.h>
 
+namespace com { namespace sun { namespace star { namespace embed {
 
-//   SdrOle2Obj
+class XEmbeddedObject;
 
+}}}}
+
+namespace svt {
+
+class EmbeddedObjectRef;
+
+}
 
 class SvxUnoShapeModifyListener;
 class SdrOle2ObjImpl;
@@ -61,7 +68,6 @@ protected:
 private:
     SdrOle2ObjImpl*             mpImpl;
 
-    svt::EmbeddedObjectRef      xObjRef;
     Graphic*                    pGraphic;
     OUString                    aProgName;
 
@@ -87,10 +93,9 @@ public:
     SdrOle2Obj( const svt::EmbeddedObjectRef& rNewObjRef, const OUString& rNewObjName, const Rectangle& rNewRect, bool bFrame_ = false );
     virtual ~SdrOle2Obj();
 
-    // access to svt::EmbeddedObjectRef
-    const svt::EmbeddedObjectRef& getEmbeddedObjectRef() const { return xObjRef; }
+    const svt::EmbeddedObjectRef& getEmbeddedObjectRef() const;
 
-    sal_Int64 GetAspect() const { return xObjRef.GetViewAspect(); }
+    sal_Int64 GetAspect() const;
     bool isInplaceActive() const;
     bool isUiActive() const;
     void SetAspect( sal_Int64 nAspect );
diff --git a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
index df2f0ff..ef7314f 100644
--- a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
@@ -33,7 +33,7 @@
 #include <basegfx/matrix/b2dhommatrixtools.hxx>
 #include <drawinglayer/primitive2d/transformprimitive2d.hxx>
 #include <svx/charthelper.hxx>
-
+#include <svtools/embedhlp.hxx>
 
 
 namespace sdr
diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx
index 38b73be..10f6490 100644
--- a/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx
@@ -30,7 +30,7 @@
 #include <com/sun/star/embed/XEmbeddedObject.hpp>
 #include <basegfx/polygon/b2dpolygon.hxx>
 #include <basegfx/matrix/b2dhommatrix.hxx>
-
+#include <svtools/embedhlp.hxx>
 
 
 using namespace com::sun::star;
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index 23f8616..d801b37 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -668,6 +668,8 @@ void SdrEmbedObjectLink::Closed()
 class SdrOle2ObjImpl
 {
 public:
+    svt::EmbeddedObjectRef mxObjRef;
+
     // TODO/LATER: do we really need this pointer?
     GraphicObject*  pGraphicObject;
     OUString        aPersistName;       // name of object in persist
@@ -680,14 +682,25 @@ public:
     SdrEmbedObjectLink* mpObjectLink;
     OUString maLinkURL;
 
-    SdrOle2ObjImpl()
-    : pGraphicObject( NULL )
-    , pLightClient ( NULL )
-    // init to start situation, loading did not fail
-    , mbLoadingOLEObjectFailed( false )
-    , mbConnected( false )
-    , mpObjectLink( NULL )
+    SdrOle2ObjImpl() :
+        pGraphicObject(NULL),
+        pLightClient (NULL),
+        mbLoadingOLEObjectFailed(false),
+        mbConnected(false),
+        mpObjectLink(NULL)
+    {
+        mxObjRef.Lock(true);
+    }
+
+    SdrOle2ObjImpl( const svt::EmbeddedObjectRef& rObjRef ) :
+        mxObjRef(rObjRef),
+        pGraphicObject(NULL),
+        pLightClient (NULL),
+        mbLoadingOLEObjectFailed(false),
+        mbConnected(false),
+        mpObjectLink(NULL)
     {
+        mxObjRef.Lock(true);
     }
 };
 
@@ -745,13 +758,11 @@ SdrOle2Obj::SdrOle2Obj( bool bFrame_ ) :
     m_bChart(false),
     pModifyListener(NULL)
 {
-    xObjRef.Lock(true);
 }
 
 SdrOle2Obj::SdrOle2Obj( const svt::EmbeddedObjectRef&  rNewObjRef, const OUString& rNewObjName, const Rectangle& rNewRect, bool bFrame_ ) :
     SdrRectObj(rNewRect),
-    mpImpl(new SdrOle2ObjImpl),
-    xObjRef(rNewObjRef),
+    mpImpl(new SdrOle2ObjImpl(rNewObjRef)),
     pGraphic(NULL),
     bFrame(bFrame_),
     bInDestruction(false),
@@ -760,23 +771,21 @@ SdrOle2Obj::SdrOle2Obj( const svt::EmbeddedObjectRef&  rNewObjRef, const OUStrin
     m_bChart(false),
     pModifyListener(NULL)
 {
-    xObjRef.Lock(true);
-
     mpImpl->aPersistName = rNewObjName;
 
-    if ( xObjRef.is() && (xObjRef->getStatus( GetAspect() ) & embed::EmbedMisc::EMBED_NEVERRESIZE ) )
+    if (mpImpl->mxObjRef.is() && (mpImpl->mxObjRef->getStatus( GetAspect() ) & embed::EmbedMisc::EMBED_NEVERRESIZE ) )
         SetResizeProtect(true);
 
     // For math objects, set closed state to transparent
-    SetClosedObj(!ImplIsMathObj( xObjRef.GetObject() ));
+    SetClosedObj(!ImplIsMathObj( mpImpl->mxObjRef.GetObject() ));
 }
 
 OUString SdrOle2Obj::GetStyleString()
 {
     OUString strStyle;
-    if( xObjRef.is() && xObjRef.IsChart() )
+    if (mpImpl->mxObjRef.is() && mpImpl->mxObjRef.IsChart())
     {
-        strStyle = xObjRef.GetChartType();
+        strStyle = mpImpl->mxObjRef.GetChartType();
     }
     return strStyle;
 }
@@ -814,23 +823,29 @@ SdrOle2Obj::~SdrOle2Obj()
 
 void SdrOle2Obj::SetAspect( sal_Int64 nAspect )
 {
-    xObjRef.SetViewAspect( nAspect );
+    mpImpl->mxObjRef.SetViewAspect( nAspect );
+}
+
+const svt::EmbeddedObjectRef& SdrOle2Obj::getEmbeddedObjectRef() const
+{
+    return mpImpl->mxObjRef;
 }
 
+sal_Int64 SdrOle2Obj::GetAspect() const
+{
+    return mpImpl->mxObjRef.GetViewAspect();
+}
 
 bool SdrOle2Obj::isInplaceActive() const
 {
-    return xObjRef.is() && embed::EmbedStates::INPLACE_ACTIVE == xObjRef->getCurrentState();
+    return mpImpl->mxObjRef.is() && embed::EmbedStates::INPLACE_ACTIVE == mpImpl->mxObjRef->getCurrentState();
 }
 
-
 bool SdrOle2Obj::isUiActive() const
 {
-    return xObjRef.is() && embed::EmbedStates::UI_ACTIVE == xObjRef->getCurrentState();
+    return mpImpl->mxObjRef.is() && embed::EmbedStates::UI_ACTIVE == mpImpl->mxObjRef->getCurrentState();
 }
 
-
-
 void SdrOle2Obj::SetGraphic_Impl(const Graphic* pGrf)
 {
     if ( pGraphic )
@@ -861,7 +876,7 @@ void SdrOle2Obj::SetGraphic(const Graphic* pGrf)
 
 bool SdrOle2Obj::IsEmpty() const
 {
-    return !(xObjRef.is());
+    return !mpImpl->mxObjRef.is();
 }
 
 
@@ -899,15 +914,15 @@ bool SdrOle2Obj::UpdateLinkURL_Impl()
             if ( !aNewLinkURL.equalsIgnoreAsciiCase( mpImpl->maLinkURL ) )
             {
                 const_cast<SdrOle2Obj*>(this)->GetObjRef_Impl();
-                uno::Reference< embed::XCommonEmbedPersist > xPersObj( xObjRef.GetObject(), uno::UNO_QUERY );
+                uno::Reference<embed::XCommonEmbedPersist> xPersObj( mpImpl->mxObjRef.GetObject(), uno::UNO_QUERY );
                 OSL_ENSURE( xPersObj.is(), "The object must exist!\n" );
                 if ( xPersObj.is() )
                 {
                     try
                     {
-                        sal_Int32 nCurState = xObjRef->getCurrentState();
+                        sal_Int32 nCurState = mpImpl->mxObjRef->getCurrentState();
                         if ( nCurState != embed::EmbedStates::LOADED )
-                            xObjRef->changeState( embed::EmbedStates::LOADED );
+                            mpImpl->mxObjRef->changeState(embed::EmbedStates::LOADED);
 
                         // TODO/LATER: there should be possible to get current mediadescriptor settings from the object
                         uno::Sequence< beans::PropertyValue > aArgs( 1 );
@@ -919,7 +934,7 @@ bool SdrOle2Obj::UpdateLinkURL_Impl()
                         bResult = true;
 
                         if ( nCurState != embed::EmbedStates::LOADED )
-                            xObjRef->changeState( nCurState );
+                            mpImpl->mxObjRef->changeState(nCurState);
                     }
                     catch( ::com::sun::star::uno::Exception& )
                     {
@@ -958,7 +973,7 @@ void SdrOle2Obj::BreakFileLink_Impl()
         {
             try
             {
-                uno::Reference< embed::XLinkageSupport > xLinkSupport( xObjRef.GetObject(), uno::UNO_QUERY_THROW );
+                uno::Reference< embed::XLinkageSupport > xLinkSupport( mpImpl->mxObjRef.GetObject(), uno::UNO_QUERY_THROW );
                 xLinkSupport->breakLink( xStorage, mpImpl->aPersistName );
                 DisconnectFileLink_Impl();
                 mpImpl->maLinkURL = "";
@@ -992,11 +1007,11 @@ void SdrOle2Obj::DisconnectFileLink_Impl()
 
 void SdrOle2Obj::CheckFileLink_Impl()
 {
-    if ( pModel && xObjRef.GetObject().is() && !mpImpl->mpObjectLink )
+    if (pModel && mpImpl->mxObjRef.GetObject().is() && !mpImpl->mpObjectLink)
     {
         try
         {
-            uno::Reference< embed::XLinkageSupport > xLinkSupport( xObjRef.GetObject(), uno::UNO_QUERY );
+            uno::Reference< embed::XLinkageSupport > xLinkSupport( mpImpl->mxObjRef.GetObject(), uno::UNO_QUERY );
             if ( xLinkSupport.is() && xLinkSupport->isLink() )
             {
                 OUString aLinkURL = xLinkSupport->getLinkURL();
@@ -1045,34 +1060,34 @@ void SdrOle2Obj::Connect_Impl()
             {
                 comphelper::EmbeddedObjectContainer& rContainer = pPers->getEmbeddedObjectContainer();
                 if ( !rContainer.HasEmbeddedObject( mpImpl->aPersistName )
-                  || ( xObjRef.is() && !rContainer.HasEmbeddedObject( xObjRef.GetObject() ) ) )
+                  || ( mpImpl->mxObjRef.is() && !rContainer.HasEmbeddedObject( mpImpl->mxObjRef.GetObject() ) ) )
                 {
                     // object not known to container document
                     // No object -> disaster!
-                    DBG_ASSERT( xObjRef.is(), "No object in connect!");
-                    if ( xObjRef.is() )
+                    DBG_ASSERT( mpImpl->mxObjRef.is(), "No object in connect!");
+                    if ( mpImpl->mxObjRef.is() )
                     {
                         // object came from the outside, now add it to the container
                         OUString aTmp;
-                        rContainer.InsertEmbeddedObject( xObjRef.GetObject(), aTmp );
+                        rContainer.InsertEmbeddedObject( mpImpl->mxObjRef.GetObject(), aTmp );
                         mpImpl->aPersistName = aTmp;
                     }
                 }
-                else if ( !xObjRef.is() )
+                else if ( !mpImpl->mxObjRef.is() )
                 {
-                    xObjRef.Assign( rContainer.GetEmbeddedObject( mpImpl->aPersistName ), xObjRef.GetViewAspect() );
+                    mpImpl->mxObjRef.Assign( rContainer.GetEmbeddedObject( mpImpl->aPersistName ), mpImpl->mxObjRef.GetViewAspect() );
                     m_bTypeAsked = false;
                 }
 
-                if ( xObjRef.GetObject().is() )
+                if ( mpImpl->mxObjRef.GetObject().is() )
                 {
-                    xObjRef.AssignToContainer( &rContainer, mpImpl->aPersistName );
+                    mpImpl->mxObjRef.AssignToContainer( &rContainer, mpImpl->aPersistName );
                     mpImpl->mbConnected = true;
-                    xObjRef.Lock( true );
+                    mpImpl->mxObjRef.Lock( true );
                 }
             }
 
-            if ( xObjRef.is() )
+            if ( mpImpl->mxObjRef.is() )
             {
                 if ( !mpImpl->pLightClient )
                 {
@@ -1080,15 +1095,15 @@ void SdrOle2Obj::Connect_Impl()
                     mpImpl->pLightClient->acquire();
                 }
 
-                xObjRef->addStateChangeListener( mpImpl->pLightClient );
-                xObjRef->addEventListener( uno::Reference< document::XEventListener >( mpImpl->pLightClient ) );
+                mpImpl->mxObjRef->addStateChangeListener( mpImpl->pLightClient );
+                mpImpl->mxObjRef->addEventListener( uno::Reference< document::XEventListener >( mpImpl->pLightClient ) );
 
-                if ( xObjRef->getCurrentState() != embed::EmbedStates::LOADED )
+                if ( mpImpl->mxObjRef->getCurrentState() != embed::EmbedStates::LOADED )
                     GetSdrGlobalData().GetOLEObjCache().InsertObj(this);
 
                 CheckFileLink_Impl();
 
-                uno::Reference< container::XChild > xChild( xObjRef.GetObject(), uno::UNO_QUERY );
+                uno::Reference< container::XChild > xChild( mpImpl->mxObjRef.GetObject(), uno::UNO_QUERY );
                 if( xChild.is() )
                 {
                     uno::Reference< uno::XInterface > xParent( pModel->getUnoModel());
@@ -1133,7 +1148,7 @@ void SdrOle2Obj::ObjectLoaded()
 
 void SdrOle2Obj::AddListeners_Impl()
 {
-    if( xObjRef.is() && xObjRef->getCurrentState() != embed::EmbedStates::LOADED )
+    if( mpImpl->mxObjRef.is() && mpImpl->mxObjRef->getCurrentState() != embed::EmbedStates::LOADED )
     {
         // register modify listener
         if( !pModifyListener )
@@ -1170,11 +1185,11 @@ void SdrOle2Obj::Disconnect()
 
 void SdrOle2Obj::RemoveListeners_Impl()
 {
-    if( xObjRef.is() && !mpImpl->aPersistName.isEmpty() )
+    if ( mpImpl->mxObjRef.is() && !mpImpl->aPersistName.isEmpty() )
     {
         try
         {
-            sal_Int32 nState = xObjRef->getCurrentState();
+            sal_Int32 nState = mpImpl->mxObjRef->getCurrentState();
             if ( nState != embed::EmbedStates::LOADED )
             {
                 uno::Reference< util::XModifyBroadcaster > xBC( getXModel(), uno::UNO_QUERY );
@@ -1211,11 +1226,11 @@ void SdrOle2Obj::Disconnect_Impl()
                 // in case the model has correct persistence, but in case of problems such a removing
                 // would make the behavior of the office more stable
 
-                comphelper::EmbeddedObjectContainer* pContainer = xObjRef.GetContainer();
+                comphelper::EmbeddedObjectContainer* pContainer = mpImpl->mxObjRef.GetContainer();
                 if ( pContainer )
                 {
-                    pContainer->CloseEmbeddedObject( xObjRef.GetObject() );
-                    xObjRef.AssignToContainer( NULL, mpImpl->aPersistName );
+                    pContainer->CloseEmbeddedObject( mpImpl->mxObjRef.GetObject() );
+                    mpImpl->mxObjRef.AssignToContainer( NULL, mpImpl->aPersistName );
                 }
 
                 // happens later than the destruction of the model, so we can't assert that).
@@ -1237,20 +1252,20 @@ void SdrOle2Obj::Disconnect_Impl()
 
                 xObjRef = NULL;*/
             }
-            else if ( xObjRef.is() )
+            else if ( mpImpl->mxObjRef.is() )
             {
                 if ( pModel->getUnoModel().is() )
                 {
                     // remove object, but don't close it (that's up to someone else)
-                    comphelper::EmbeddedObjectContainer* pContainer = xObjRef.GetContainer();
+                    comphelper::EmbeddedObjectContainer* pContainer = mpImpl->mxObjRef.GetContainer();
                     if ( pContainer )
                     {
-                        pContainer->RemoveEmbeddedObject( xObjRef.GetObject(), false);
+                        pContainer->RemoveEmbeddedObject( mpImpl->mxObjRef.GetObject(), false);
 
                         // TODO/LATER: mpImpl->aPersistName contains outdated information, to keep it updated
                         // it should be returned from RemoveEmbeddedObject call. Currently it is no problem,
                         // since no container is adjusted, actually the empty string could be provided as a name here
-                        xObjRef.AssignToContainer( NULL, mpImpl->aPersistName );
+                        mpImpl->mxObjRef.AssignToContainer( NULL, mpImpl->aPersistName );
                     }
 
                     DisconnectFileLink_Impl();
@@ -1258,11 +1273,11 @@ void SdrOle2Obj::Disconnect_Impl()
             }
         }
 
-        if ( xObjRef.is() && mpImpl->pLightClient )
+        if ( mpImpl->mxObjRef.is() && mpImpl->pLightClient )
         {
-            xObjRef->removeStateChangeListener ( mpImpl->pLightClient );
-            xObjRef->removeEventListener( uno::Reference< document::XEventListener >( mpImpl->pLightClient ) );
-            xObjRef->setClientSite( NULL );
+            mpImpl->mxObjRef->removeStateChangeListener ( mpImpl->pLightClient );
+            mpImpl->mxObjRef->removeEventListener( uno::Reference< document::XEventListener >( mpImpl->pLightClient ) );
+            mpImpl->mxObjRef->setClientSite( NULL );
 
             GetSdrGlobalData().GetOLEObjCache().RemoveObj(this);
         }
@@ -1393,12 +1408,12 @@ void SdrOle2Obj::SetModel(SdrModel* pNewModel)
             OUString aTmp;
             comphelper::EmbeddedObjectContainer& rContainer = pSrcPers->getEmbeddedObjectContainer();
             uno::Reference < embed::XEmbeddedObject > xObj = rContainer.GetEmbeddedObject( mpImpl->aPersistName );
-            DBG_ASSERT( !xObjRef.is() || xObjRef.GetObject() == xObj, "Wrong object identity!" );
+            DBG_ASSERT( !mpImpl->mxObjRef.is() || mpImpl->mxObjRef.GetObject() == xObj, "Wrong object identity!" );
             if ( xObj.is() )
             {
                 pDestPers->getEmbeddedObjectContainer().MoveEmbeddedObject( rContainer, xObj, aTmp );
                 mpImpl->aPersistName = aTmp;
-                xObjRef.AssignToContainer( &pDestPers->getEmbeddedObjectContainer(), aTmp );
+                mpImpl->mxObjRef.AssignToContainer( &pDestPers->getEmbeddedObjectContainer(), aTmp );
             }
             DBG_ASSERT( !aTmp.isEmpty(), "Copying embedded object failed!" );
         }
@@ -1474,30 +1489,30 @@ void SdrOle2Obj::SetPage(SdrPage* pNewPage)
 
 void SdrOle2Obj::SetObjRef( const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject >& rNewObjRef )
 {
-    DBG_ASSERT( !rNewObjRef.is() || !xObjRef.GetObject().is(), "SetObjRef called on already initialized object!");
-    if( rNewObjRef == xObjRef.GetObject() )
+    DBG_ASSERT( !rNewObjRef.is() || !mpImpl->mxObjRef.GetObject().is(), "SetObjRef called on already initialized object!");
+    if( rNewObjRef == mpImpl->mxObjRef.GetObject() )
         return;
 
     // the caller of the method is responsible to control the old object, it will not be closed here
     // Otherwise WW8 import crashes because it transfers control to OLENode by this method
-    if ( xObjRef.GetObject().is() )
-        xObjRef.Lock( false );
+    if ( mpImpl->mxObjRef.GetObject().is() )
+        mpImpl->mxObjRef.Lock( false );
 
     // avoid removal of object in Disconnect! It is definitely a HACK to call SetObjRef(0)!
     // This call will try to close the objects; so if anybody else wants to keep it, it must be locked by a CloseListener
-    xObjRef.Clear();
+    mpImpl->mxObjRef.Clear();
 
     if ( mpImpl->mbConnected )
         Disconnect();
 
-    xObjRef.Assign( rNewObjRef, GetAspect() );
+    mpImpl->mxObjRef.Assign( rNewObjRef, GetAspect() );
     m_bTypeAsked = false;
 
-    if ( xObjRef.is() )
+    if ( mpImpl->mxObjRef.is() )
     {
         DELETEZ( pGraphic );
 
-        if ( (xObjRef->getStatus( GetAspect() ) & embed::EmbedMisc::EMBED_NEVERRESIZE ) )
+        if ( (mpImpl->mxObjRef->getStatus( GetAspect() ) & embed::EmbedMisc::EMBED_NEVERRESIZE ) )
             SetResizeProtect(true);
 
         // For math objects, set closed state to transparent
@@ -1637,7 +1652,7 @@ SdrOle2Obj& SdrOle2Obj::assignFrom(
         // ImpAssign( rObj );
         const SdrOle2Obj& rOle2Obj = static_cast< const SdrOle2Obj& >( rObj );
 
-        uno::Reference < util::XCloseable > xClose( xObjRef.GetObject(), uno::UNO_QUERY );
+        uno::Reference<util::XCloseable> xClose(mpImpl->mxObjRef.GetObject(), uno::UNO_QUERY);
 
         if( pModel && mpImpl->mbConnected )
             Disconnect();
@@ -1669,13 +1684,13 @@ SdrOle2Obj& SdrOle2Obj::assignFrom(
             ::comphelper::IEmbeddedHelper* pSrcPers = rObj.GetModel()->GetPersist();
             if( pDestPers && pSrcPers )
             {
-                DBG_ASSERT( !xObjRef.is(), "Object already existing!" );
+                DBG_ASSERT( !mpImpl->mxObjRef.is(), "Object already existing!" );
                 comphelper::EmbeddedObjectContainer& rContainer = pSrcPers->getEmbeddedObjectContainer();
                 uno::Reference < embed::XEmbeddedObject > xObj = rContainer.GetEmbeddedObject( mpImpl->aPersistName );
                 if ( xObj.is() )
                 {
                     OUString aTmp;
-                    xObjRef.Assign( pDestPers->getEmbeddedObjectContainer().CopyAndGetEmbeddedObject(
+                    mpImpl->mxObjRef.Assign( pDestPers->getEmbeddedObjectContainer().CopyAndGetEmbeddedObject(
                         rContainer, xObj, aTmp, rSrcShellID, rDestShellID), rOle2Obj.GetAspect());
                     m_bTypeAsked = false;
                     mpImpl->aPersistName = aTmp;
@@ -1707,23 +1722,23 @@ void SdrOle2Obj::ImpSetVisAreaSize()
 
     // the object area of an embedded object was changed, e.g. by user interaction an a selected object
     GetObjRef();
-    if ( xObjRef.is() )
+    if (mpImpl->mxObjRef.is())
     {
         OSL_ASSERT( pModel );
-        sal_Int64 nMiscStatus = xObjRef->getStatus( GetAspect() );
+        sal_Int64 nMiscStatus = mpImpl->mxObjRef->getStatus( GetAspect() );
 
         // the client is required to get access to scaling
-        SfxInPlaceClient* pClient = SfxInPlaceClient::GetClient( dynamic_cast<SfxObjectShell*>(pModel->GetPersist()), xObjRef.GetObject() );
+        SfxInPlaceClient* pClient = SfxInPlaceClient::GetClient( dynamic_cast<SfxObjectShell*>(pModel->GetPersist()), mpImpl->mxObjRef.GetObject() );
         bool bHasOwnClient =
                         ( mpImpl->pLightClient
-                        && xObjRef->getClientSite() == uno::Reference< embed::XEmbeddedClient >( mpImpl->pLightClient ) );
+                        && mpImpl->mxObjRef->getClientSite() == uno::Reference< embed::XEmbeddedClient >( mpImpl->pLightClient ) );
 
         if ( pClient || bHasOwnClient )
         {
             // TODO: IMHO we need to do similar things when object is UIActive or OutplaceActive?!
             if ( ((nMiscStatus & embed::EmbedMisc::MS_EMBED_RECOMPOSEONRESIZE) &&
-                    svt::EmbeddedObjectRef::TryRunningState( xObjRef.GetObject() ))
-                    || xObjRef->getCurrentState() == embed::EmbedStates::INPLACE_ACTIVE
+                    svt::EmbeddedObjectRef::TryRunningState( mpImpl->mxObjRef.GetObject() ))
+                    || mpImpl->mxObjRef->getCurrentState() == embed::EmbedStates::INPLACE_ACTIVE
                     )
             {
                 Fraction aScaleWidth;
@@ -1744,7 +1759,7 @@ void SdrOle2Obj::ImpSetVisAreaSize()
                 // In these cases the change in the object area size will be reflected in a change of the
                 // objects' visual area. The scaling will not change, but it might exist already and must
                 // be used in calculations
-                MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObjRef->getMapUnit( GetAspect() ) );
+                MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( mpImpl->mxObjRef->getMapUnit( GetAspect() ) );
                 Size aVisSize( (long)( Fraction( aRect.GetWidth() ) / aScaleWidth ),
                                 (long)( Fraction( aRect.GetHeight() ) / aScaleHeight ) );
 
@@ -1752,11 +1767,11 @@ void SdrOle2Obj::ImpSetVisAreaSize()
                 awt::Size aSz;
                 aSz.Width = aVisSize.Width();
                 aSz.Height = aVisSize.Height();
-                xObjRef->setVisualAreaSize( GetAspect(), aSz );
+                mpImpl->mxObjRef->setVisualAreaSize( GetAspect(), aSz );
 
                 try
                 {
-                    aSz = xObjRef->getVisualAreaSize( GetAspect() );
+                    aSz = mpImpl->mxObjRef->getVisualAreaSize( GetAspect() );
                 }
                 catch( embed::NoVisualAreaSizeException& )
                 {}
@@ -1768,7 +1783,7 @@ void SdrOle2Obj::ImpSetVisAreaSize()
                 {
                     // server changed VisArea to its liking and the VisArea is different than the suggested one
                     // store the new value as given by the object
-                    MapUnit aNewMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObjRef->getMapUnit( GetAspect() ) );
+                    MapUnit aNewMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( mpImpl->mxObjRef->getMapUnit( GetAspect() ) );
                     aRect.SetSize(OutputDevice::LogicToLogic( aAcceptedVisArea.GetSize(), aNewMapUnit, pModel->GetScaleUnit()));
                 }
 
@@ -1784,7 +1799,7 @@ void SdrOle2Obj::ImpSetVisAreaSize()
                 //a chart sends a modified call to the framework if it was changed
                 //thus the replacement update is already handled there
                 if( !IsChart() )
-                    xObjRef.UpdateReplacement();
+                    mpImpl->mxObjRef.UpdateReplacement();
             }
             else
             {
@@ -1808,14 +1823,14 @@ void SdrOle2Obj::ImpSetVisAreaSize()
             }
         }
         else if( (nMiscStatus & embed::EmbedMisc::MS_EMBED_RECOMPOSEONRESIZE) &&
-            svt::EmbeddedObjectRef::TryRunningState( xObjRef.GetObject() ) )
+            svt::EmbeddedObjectRef::TryRunningState( mpImpl->mxObjRef.GetObject() ) )
         {
             //also handle not sfx based ole objects e.g. charts
             //#i83860# resizing charts in impress distorts fonts
             uno::Reference< embed::XVisualObject > xVisualObject( this->getXModel(), uno::UNO_QUERY );
             if( xVisualObject.is() )
             {
-                MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObjRef->getMapUnit( GetAspect() ) );
+                MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( mpImpl->mxObjRef->getMapUnit( GetAspect() ) );
                 Point aTL( aRect.TopLeft() );
                 Point aBR( aRect.BottomRight() );
                 Point aTL2( OutputDevice::LogicToLogic( aTL, pModel->GetScaleUnit(), aMapUnit) );
@@ -1834,7 +1849,7 @@ void SdrOle2Obj::NbcResize(const Point& rRef, const Fraction& xFact, const Fract
     if( pModel && !pModel->isLocked() )
     {
         GetObjRef();
-        if ( xObjRef.is() && ( xObjRef->getStatus( GetAspect() ) & embed::EmbedMisc::MS_EMBED_RECOMPOSEONRESIZE ) )
+        if ( mpImpl->mxObjRef.is() && ( mpImpl->mxObjRef->getStatus( GetAspect() ) & embed::EmbedMisc::MS_EMBED_RECOMPOSEONRESIZE ) )
         {
             // if the object needs recompose on resize
             // the client site should be created before the resize will take place
@@ -1867,12 +1882,12 @@ void SdrOle2Obj::NbcSetSnapRect(const Rectangle& rRect)
     if( pModel && !pModel->isLocked() )
         ImpSetVisAreaSize();
 
-    if ( xObjRef.is() && IsChart() )
+    if ( mpImpl->mxObjRef.is() && IsChart() )
     {
         //#i103460# charts do not necessarily have an own size within ODF files,
         //for this case they need to use the size settings from the surrounding frame,
         //which is made available with this method as there is no other way
-        xObjRef.SetDefaultSizeForChart( Size( rRect.GetWidth(), rRect.GetHeight() ) );
+        mpImpl->mxObjRef.SetDefaultSizeForChart( Size( rRect.GetWidth(), rRect.GetHeight() ) );
     }
 }
 
@@ -1888,22 +1903,22 @@ void SdrOle2Obj::NbcSetLogicRect(const Rectangle& rRect)
 
 const Graphic* SdrOle2Obj::GetGraphic() const
 {
-    if ( xObjRef.is() )
-        return xObjRef.GetGraphic();
+    if ( mpImpl->mxObjRef.is() )
+        return mpImpl->mxObjRef.GetGraphic();
     return pGraphic;
 }
 
 void SdrOle2Obj::GetNewReplacement()
 {
-    if ( xObjRef.is() )
-        xObjRef.UpdateReplacement();
+    if ( mpImpl->mxObjRef.is() )
+        mpImpl->mxObjRef.UpdateReplacement();
 }
 
 
 
 Size SdrOle2Obj::GetOrigObjSize( MapMode* pTargetMapMode ) const
 {
-    return xObjRef.GetSize( pTargetMapMode );
+    return mpImpl->mxObjRef.GetSize( pTargetMapMode );
 }
 
 
@@ -1981,14 +1996,14 @@ bool SdrOle2Obj::Unload( const uno::Reference< embed::XEmbeddedObject >& xObj, s
 
 bool SdrOle2Obj::Unload()
 {
-    if (!xObjRef.is())
+    if (!mpImpl->mxObjRef.is())
         // Already unloaded.
         return true;
 
     bool bUnloaded = false;
-    if ( pModel && xObjRef.is() )
+    if ( pModel && mpImpl->mxObjRef.is() )
     {
-        bUnloaded = Unload( xObjRef.GetObject(), GetAspect() );
+        bUnloaded = Unload( mpImpl->mxObjRef.GetObject(), GetAspect() );
     }
 
     return bUnloaded;
@@ -1998,27 +2013,27 @@ bool SdrOle2Obj::Unload()
 
 void SdrOle2Obj::GetObjRef_Impl()
 {
-    if ( !xObjRef.is() && !mpImpl->aPersistName.isEmpty() && pModel && pModel->GetPersist() )
+    if ( !mpImpl->mxObjRef.is() && !mpImpl->aPersistName.isEmpty() && pModel && pModel->GetPersist() )
     {
         // Only try loading if it did not went wrong up to now
         if(!mpImpl->mbLoadingOLEObjectFailed)
         {
-            xObjRef.Assign( pModel->GetPersist()->getEmbeddedObjectContainer().GetEmbeddedObject( mpImpl->aPersistName ), GetAspect() );
+            mpImpl->mxObjRef.Assign( pModel->GetPersist()->getEmbeddedObjectContainer().GetEmbeddedObject( mpImpl->aPersistName ), GetAspect() );
             m_bTypeAsked = false;
             CheckFileLink_Impl();
 
             // If loading of OLE object failed, remember that to not invoke a endless
             // loop trying to load it again and again.
-            if( xObjRef.is() )
+            if( mpImpl->mxObjRef.is() )
             {
                 mpImpl->mbLoadingOLEObjectFailed = true;
             }
 
             // For math objects, set closed state to transparent
-            SetClosedObj(!ImplIsMathObj( xObjRef.GetObject() ));
+            SetClosedObj(!ImplIsMathObj( mpImpl->mxObjRef.GetObject() ));
         }
 
-        if ( xObjRef.is() )
+        if ( mpImpl->mxObjRef.is() )
         {
             if( !IsEmptyPresObj() )
             {
@@ -2038,7 +2053,7 @@ void SdrOle2Obj::GetObjRef_Impl()
                 }
             }
 
-            sal_Int64 nMiscStatus = xObjRef->getStatus( GetAspect() );
+            sal_Int64 nMiscStatus = mpImpl->mxObjRef->getStatus( GetAspect() );
             (void)nMiscStatus;
             //TODO/LATER: wait until ResizeOnPrinterChange is defined
             //if ( nMiscStatus & SVOBJ_MISCSTATUS_RESIZEONPRINTERCHANGE )
@@ -2066,7 +2081,7 @@ void SdrOle2Obj::GetObjRef_Impl()
             }
         }
 
-        if ( xObjRef.is() )
+        if ( mpImpl->mxObjRef.is() )
             Connect();
     }
 
@@ -2078,12 +2093,12 @@ void SdrOle2Obj::GetObjRef_Impl()
 uno::Reference < embed::XEmbeddedObject > SdrOle2Obj::GetObjRef() const
 {
     const_cast<SdrOle2Obj*>(this)->GetObjRef_Impl();
-    return xObjRef.GetObject();
+    return mpImpl->mxObjRef.GetObject();
 }
 
 uno::Reference < embed::XEmbeddedObject > SdrOle2Obj::GetObjRef_NoInit() const
 {
-    return xObjRef.GetObject();
+    return mpImpl->mxObjRef.GetObject();
 }
 
 
@@ -2091,8 +2106,8 @@ uno::Reference < embed::XEmbeddedObject > SdrOle2Obj::GetObjRef_NoInit() const
 uno::Reference< frame::XModel > SdrOle2Obj::getXModel() const
 {
     GetObjRef();
-    if ( svt::EmbeddedObjectRef::TryRunningState(xObjRef.GetObject()) )
-        return uno::Reference< frame::XModel >( xObjRef->getComponent(), uno::UNO_QUERY );
+    if ( svt::EmbeddedObjectRef::TryRunningState(mpImpl->mxObjRef.GetObject()) )
+        return uno::Reference< frame::XModel >( mpImpl->mxObjRef->getComponent(), uno::UNO_QUERY );
     else
         return uno::Reference< frame::XModel >();
 }
@@ -2103,7 +2118,7 @@ bool SdrOle2Obj::IsChart() const
 {
     if ( !m_bTypeAsked )
     {
-        m_bChart = ChartHelper::IsChart(xObjRef);
+        m_bChart = ChartHelper::IsChart(mpImpl->mxObjRef);
         m_bTypeAsked = true;
     }
     return m_bChart;
@@ -2112,22 +2127,22 @@ bool SdrOle2Obj::IsChart() const
 
 void SdrOle2Obj::SetGraphicToObj( const Graphic& aGraphic, const OUString& aMediaType )
 {
-    xObjRef.SetGraphic( aGraphic, aMediaType );
+    mpImpl->mxObjRef.SetGraphic( aGraphic, aMediaType );
 }
 
 
 void SdrOle2Obj::SetGraphicToObj( const uno::Reference< io::XInputStream >& xGrStream, const OUString& aMediaType )
 {
-    xObjRef.SetGraphicStream( xGrStream, aMediaType );
+    mpImpl->mxObjRef.SetGraphicStream( xGrStream, aMediaType );
 }
 
 
 bool SdrOle2Obj::IsCalc() const
 {
-    if ( !xObjRef.is() )
+    if ( !mpImpl->mxObjRef.is() )
         return false;
 
-    SvGlobalName aObjClsId( xObjRef->getClassID() );
+    SvGlobalName aObjClsId( mpImpl->mxObjRef->getClassID() );
     if(    SvGlobalName(SO3_SC_CLASSID_30) == aObjClsId
         || SvGlobalName(SO3_SC_CLASSID_40) == aObjClsId
         || SvGlobalName(SO3_SC_CLASSID_50) == aObjClsId
@@ -2162,11 +2177,11 @@ bool SdrOle2Obj::CalculateNewScaling( Fraction& aScaleWidth, Fraction& aScaleHei
 {
     // TODO/LEAN: to avoid rounding errors scaling always uses the VisArea.
     // If we don't cache it for own objects also we must load the object here
-    if ( !xObjRef.is() || !pModel )
+    if ( !mpImpl->mxObjRef.is() || !pModel )
         return false;
 
     MapMode aMapMode( pModel->GetScaleUnit() );
-    aObjAreaSize = xObjRef.GetSize( &aMapMode );
+    aObjAreaSize = mpImpl->mxObjRef.GetSize( &aMapMode );
 
     Size aSize = aRect.GetSize();
     aScaleWidth = Fraction(aSize.Width(),  aObjAreaSize.Width() );
@@ -2183,12 +2198,12 @@ bool SdrOle2Obj::CalculateNewScaling( Fraction& aScaleWidth, Fraction& aScaleHei
 bool SdrOle2Obj::AddOwnLightClient()
 {
     // The Own Light Client must be registered in object only using this method!
-    if ( !SfxInPlaceClient::GetClient( dynamic_cast<SfxObjectShell*>(pModel->GetPersist()), xObjRef.GetObject() )
-      && !( mpImpl->pLightClient && xObjRef->getClientSite() == uno::Reference< embed::XEmbeddedClient >( mpImpl->pLightClient ) ) )
+    if ( !SfxInPlaceClient::GetClient( dynamic_cast<SfxObjectShell*>(pModel->GetPersist()), mpImpl->mxObjRef.GetObject() )
+      && !( mpImpl->pLightClient && mpImpl->mxObjRef->getClientSite() == uno::Reference< embed::XEmbeddedClient >( mpImpl->pLightClient ) ) )
     {
         Connect();
 
-        if ( xObjRef.is() && mpImpl->pLightClient )
+        if ( mpImpl->mxObjRef.is() && mpImpl->pLightClient )
         {
             Fraction aScaleWidth;
             Fraction aScaleHeight;
@@ -2197,7 +2212,7 @@ bool SdrOle2Obj::AddOwnLightClient()
             {
                 mpImpl->pLightClient->SetSizeScale( aScaleWidth, aScaleHeight );
                 try {
-                    xObjRef->setClientSite( mpImpl->pLightClient );
+                    mpImpl->mxObjRef->setClientSite( mpImpl->pLightClient );
                     return true;
                 } catch( uno::Exception& )
                 {}
@@ -2222,7 +2237,7 @@ Graphic SdrOle2Obj::GetEmptyOLEReplacementGraphic()
 
 void SdrOle2Obj::SetWindow(const com::sun::star::uno::Reference < com::sun::star::awt::XWindow >& _xWindow)
 {
-    if ( xObjRef.is() && mpImpl->pLightClient )
+    if ( mpImpl->mxObjRef.is() && mpImpl->pLightClient )
     {
         mpImpl->pLightClient->setWindow(_xWindow);
     }
diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx
index b4b2af1..fdc76fb 100644
--- a/svx/source/unodraw/unoshap4.cxx
+++ b/svx/source/unodraw/unoshap4.cxx
@@ -52,7 +52,7 @@
 #include "svx/svdstr.hrc"
 #include <svdoopengl.hxx>
 #include <vcl/wmf.hxx>
-
+#include <svtools/embedhlp.hxx>
 
 
 using namespace ::osl;
commit cef8eb1f7e906c5717c12967d63f164dced9e8a5
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Thu Jul 10 12:51:04 2014 -0400

    Use initializer properly and remove Init().
    
    Change-Id: Ic343ff4ddd51a933ba97971d5a1197f5a25ef772

diff --git a/include/svx/svdoole2.hxx b/include/svx/svdoole2.hxx
index 175f666..3b6b006 100644
--- a/include/svx/svdoole2.hxx
+++ b/include/svx/svdoole2.hxx
@@ -59,6 +59,8 @@ protected:
     virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() SAL_OVERRIDE;
 
 private:
+    SdrOle2ObjImpl*             mpImpl;
+
     svt::EmbeddedObjectRef      xObjRef;
     Graphic*                    pGraphic;
     OUString                    aProgName;
@@ -71,21 +73,18 @@ private:
     mutable bool                m_bTypeAsked:1;
     mutable bool                m_bChart:1;
 
-    SdrOle2ObjImpl*             mpImpl;
-
     SvxUnoShapeModifyListener*  pModifyListener;
 
 private:
 
     void ImpSetVisAreaSize();
-    void Init();
 
 public:
     OUString GetStyleString();
     TYPEINFO_OVERRIDE();
 
-    SdrOle2Obj(bool bFrame_ = false);
-    SdrOle2Obj(const svt::EmbeddedObjectRef& rNewObjRef, const OUString& rNewObjName, const Rectangle& rNewRect, bool bFrame_ = false);
+    SdrOle2Obj( bool bFrame_ = false );
+    SdrOle2Obj( const svt::EmbeddedObjectRef& rNewObjRef, const OUString& rNewObjName, const Rectangle& rNewRect, bool bFrame_ = false );
     virtual ~SdrOle2Obj();
 
     // access to svt::EmbeddedObjectRef
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index 51c9a47..23f8616 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -734,29 +734,35 @@ sdr::contact::ViewContact* SdrOle2Obj::CreateObjectSpecificViewContact()
 
 
 TYPEINIT1(SdrOle2Obj,SdrRectObj);
-SdrOle2Obj::SdrOle2Obj(bool bFrame_) : m_bTypeAsked(false)
-,m_bChart(false)
-{
-    bInDestruction = false;
-    mbSuppressSetVisAreaSize = false;
-    Init();
-    bFrame=bFrame_;
-}
 
-
-
-SdrOle2Obj::SdrOle2Obj( const svt::EmbeddedObjectRef&  rNewObjRef, const OUString& rNewObjName, const Rectangle& rNewRect, bool bFrame_)
-    : SdrRectObj(rNewRect)
-    , xObjRef( rNewObjRef )
-    , m_bTypeAsked(false)
-    , m_bChart(false)
-{
-    bInDestruction = false;
-    mbSuppressSetVisAreaSize = false;
-    Init();
+SdrOle2Obj::SdrOle2Obj( bool bFrame_ ) :
+    mpImpl(new SdrOle2ObjImpl),
+    pGraphic(NULL),
+    bFrame(bFrame_),
+    bInDestruction(false),
+    mbSuppressSetVisAreaSize(false),
+    m_bTypeAsked(false),
+    m_bChart(false),
+    pModifyListener(NULL)
+{
+    xObjRef.Lock(true);
+}
+
+SdrOle2Obj::SdrOle2Obj( const svt::EmbeddedObjectRef&  rNewObjRef, const OUString& rNewObjName, const Rectangle& rNewRect, bool bFrame_ ) :
+    SdrRectObj(rNewRect),
+    mpImpl(new SdrOle2ObjImpl),
+    xObjRef(rNewObjRef),
+    pGraphic(NULL),
+    bFrame(bFrame_),
+    bInDestruction(false),
+    mbSuppressSetVisAreaSize(false),
+    m_bTypeAsked(false),
+    m_bChart(false),
+    pModifyListener(NULL)
+{
+    xObjRef.Lock(true);
 
     mpImpl->aPersistName = rNewObjName;
-    bFrame=bFrame_;
 
     if ( xObjRef.is() && (xObjRef->getStatus( GetAspect() ) & embed::EmbedMisc::EMBED_NEVERRESIZE ) )
         SetResizeProtect(true);
@@ -765,21 +771,6 @@ SdrOle2Obj::SdrOle2Obj( const svt::EmbeddedObjectRef&  rNewObjRef, const OUStrin
     SetClosedObj(!ImplIsMathObj( xObjRef.GetObject() ));
 }
 
-
-
-void SdrOle2Obj::Init()
-{
-    mpImpl = new SdrOle2ObjImpl;
-    pModifyListener = NULL;
-    pGraphic=NULL;
-    mpImpl->pGraphicObject=NULL;
-    mpImpl->pLightClient = 0;
-
-    xObjRef.Lock( true );
-}
-
-
-
 OUString SdrOle2Obj::GetStyleString()
 {
     OUString strStyle;
commit d8780381020da9214ba7e71d7c6c3de78642c668
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Thu Jul 10 12:25:57 2014 -0400

    These members should be private rather than protected.
    
    Change-Id: I5b50a5dc0b83b2d5017ab749600324338ff0abdc

diff --git a/include/svx/svdoole2.hxx b/include/svx/svdoole2.hxx
index 21d3b56..175f666 100644
--- a/include/svx/svdoole2.hxx
+++ b/include/svx/svdoole2.hxx
@@ -58,6 +58,7 @@ protected:
     virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() SAL_OVERRIDE;
     virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() SAL_OVERRIDE;
 
+private:
     svt::EmbeddedObjectRef      xObjRef;
     Graphic*                    pGraphic;
     OUString                    aProgName;
@@ -74,7 +75,7 @@ protected:
 
     SvxUnoShapeModifyListener*  pModifyListener;
 
-protected:
+private:
 
     void ImpSetVisAreaSize();
     void Init();
commit a111f9c49296edc31b5cc82889576e114537e283
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Thu Jul 10 12:11:20 2014 -0400

    Clean this up.
    
    Change-Id: If44715c7d88f7494cbb61a7c1b696c0494426c59

diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index 889f3ed..51c9a47 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -1990,22 +1990,11 @@ bool SdrOle2Obj::Unload( const uno::Reference< embed::XEmbeddedObject >& xObj, s
 
 bool SdrOle2Obj::Unload()
 {
-    bool bUnloaded = false;
-
-    if( xObjRef.is() )
-    {
-        //TODO/LATER: no refcounting tricks anymore!
-        //"customers" must register as state change listeners
-        // Not necessary in Doc DTor (MM)
-        //sal_uIntPtr nRefCount = (*ppObjRef)->GetRefCount();
-        // prevent Unload if there are external references
-        //if( nRefCount > 2 )
-        //    return false;
-        //DBG_ASSERT( nRefCount == 2, "Wrong RefCount for unload" );
-    }
-    else
-        bUnloaded = true;
+    if (!xObjRef.is())
+        // Already unloaded.
+        return true;
 
+    bool bUnloaded = false;
     if ( pModel && xObjRef.is() )
     {
         bUnloaded = Unload( xObjRef.GetObject(), GetAspect() );


More information about the Libreoffice-commits mailing list