[Libreoffice-commits] .: reportdesign/inc reportdesign/source

Lubos Lunak llunak at kemper.freedesktop.org
Fri Mar 25 09:40:01 PDT 2011


 reportdesign/inc/RptObject.hxx             |    4 ++--
 reportdesign/source/core/sdr/RptObject.cxx |    8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 23bceb3008a8c91b07f7e4008035c1a134f0a806
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Fri Mar 25 17:27:08 2011 +0100

    more sensible SdrObject::Clone() and SdrObject::operator=()
    
    Virtual operator=() is IMO pointless, and especially in a class hierarchy
    like SdrObject it's pretty unlikely one could reasonably assign any
    SdrObject-based object to any other one. Moreover, it was actually
    only used in Clone(), which was almost never reimplemented, so the
    more sensible choice is to have non-virtual operator= and virtual
    Clone() always being reimplemented and using that.
    
    This commit also fixes various smaller or bigger, er, interesting
    details in the various operator= implementations.

diff --git a/reportdesign/inc/RptObject.hxx b/reportdesign/inc/RptObject.hxx
index 7960c08..d58950b 100644
--- a/reportdesign/inc/RptObject.hxx
+++ b/reportdesign/inc/RptObject.hxx
@@ -221,7 +221,7 @@ public:
     virtual sal_uInt16 GetObjIdentifier() const;
     virtual sal_uInt32 GetObjInventor() const;
     // Clone() soll eine komplette Kopie des Objektes erzeugen.
-    virtual SdrObject* Clone() const;
+    virtual OOle2Obj* Clone() const;
     virtual void initializeOle();
 
     void initializeChart( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel>& _xModel);
@@ -273,7 +273,7 @@ public:
     virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getUnoShape();
     virtual sal_uInt16 GetObjIdentifier() const;
     virtual sal_uInt32 GetObjInventor() const;
-    virtual SdrObject* Clone() const;
+    virtual OUnoObject* Clone() const;
 
 private:
     void    impl_setReportComponent_nothrow();
diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx
index 5519d25..1f6a01a 100644
--- a/reportdesign/source/core/sdr/RptObject.cxx
+++ b/reportdesign/source/core/sdr/RptObject.cxx
@@ -942,9 +942,9 @@ uno::Reference< uno::XInterface > OUnoObject::getUnoShape()
     return OObjectBase::getUnoShapeOf( *this );
 }
 // -----------------------------------------------------------------------------
-SdrObject* OUnoObject::Clone() const
+OUnoObject* OUnoObject::Clone() const
 {
-    SdrObject* pClone = SdrUnoObj::Clone();
+    OUnoObject* pClone = CloneHelper< OUnoObject >();
     if ( pClone )
     {
         Reference<XPropertySet> xSource(const_cast<OUnoObject*>(this)->getUnoShape(),uno::UNO_QUERY);
@@ -1130,9 +1130,9 @@ uno::Reference< chart2::data::XDatabaseDataProvider > lcl_getDataProvider(const
 }
 // -----------------------------------------------------------------------------
 // Clone() soll eine komplette Kopie des Objektes erzeugen.
-SdrObject* OOle2Obj::Clone() const
+OOle2Obj* OOle2Obj::Clone() const
 {
-    OOle2Obj* pObj = static_cast<OOle2Obj*>(SdrOle2Obj::Clone());
+    OOle2Obj* pObj = CloneHelper< OOle2Obj >();
     OReportModel* pRptModel = static_cast<OReportModel*>(GetModel());
     svt::EmbeddedObjectRef::TryRunningState( pObj->GetObjRef() );
     pObj->impl_createDataProvider_nothrow(pRptModel->getReportDefinition().get());


More information about the Libreoffice-commits mailing list