summaryrefslogtreecommitdiff
path: root/svx/source/engine3d/scene3d.cxx
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2011-03-25 17:33:24 +0100
committerLuboš Luňák <l.lunak@suse.cz>2011-03-25 17:33:24 +0100
commit0527adbab1eca41ae6aeefa6e63c2e02a796c111 (patch)
tree7e010b157c25b63f38a1999047d3891e6c3b77fc /svx/source/engine3d/scene3d.cxx
parente71901089adf1ec3d62fef0c6c07559381e5a551 (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 'svx/source/engine3d/scene3d.cxx')
-rwxr-xr-xsvx/source/engine3d/scene3d.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx
index d6458afb0c8a..159daf97badc 100755
--- a/svx/source/engine3d/scene3d.cxx
+++ b/svx/source/engine3d/scene3d.cxx
@@ -529,14 +529,21 @@ void E3dScene::removeAllNonSelectedObjects()
}
}
+E3dScene* E3dScene::Clone() const
+{
+ return CloneHelper< E3dScene >();
+}
+
/*************************************************************************
|*
|* Zuweisungsoperator
|*
\************************************************************************/
-void E3dScene::operator=(const SdrObject& rObj)
+E3dScene& E3dScene::operator=(const E3dScene& rObj)
{
+ if( this == &rObj )
+ return *this;
E3dObject::operator=(rObj);
const E3dScene& r3DObj = (const E3dScene&) rObj;
@@ -566,6 +573,7 @@ void E3dScene::operator=(const SdrObject& rObj)
// ActionChanged at the VC which will for this class
// flush that cached data and initalize it's valid reconstruction
GetViewContact().ActionChanged();
+ return *this;
}
/*************************************************************************