summaryrefslogtreecommitdiff
path: root/reportdesign/source
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2011-03-25 17:27:08 +0100
committerLuboš Luňák <l.lunak@suse.cz>2011-03-25 17:27:08 +0100
commit4afa430c30483767440f61d11e9012e694019157 (patch)
tree38eb33a7b545935d35a8ee0dcaab88a6d4239d28 /reportdesign/source
parent63d665953fb95ae69d41f38afc9cd49922ed4ff2 (diff)
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.
Diffstat (limited to 'reportdesign/source')
-rw-r--r--reportdesign/source/core/sdr/RptObject.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx
index 71e0246c8ab4..4969f740c7bb 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());