diff options
author | David Tardon <dtardon@redhat.com> | 2013-02-07 12:45:29 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2013-03-18 12:29:35 +0100 |
commit | fd4bcc8318ff54b3e2def557347e9853e9733ace (patch) | |
tree | 537edb317e9d7ac8c53978c55fec617748b457d8 /svx | |
parent | 0b26c52223978a63cc67044d751c545fd7d5cbe6 (diff) |
guard against self-assignment
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/table/svdotable.cxx | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx index d54c3f7cb75f..dad9ff02d878 100644 --- a/svx/source/table/svdotable.cxx +++ b/svx/source/table/svdotable.cxx @@ -285,31 +285,34 @@ void SdrTableObjImpl::init( SdrTableObj* pTable, sal_Int32 nColumns, sal_Int32 n void SdrTableObjImpl::operator=( const SdrTableObjImpl& rSource ) { - if( mpLayouter ) + if (this != &rSource) { - delete mpLayouter; - mpLayouter = 0; - } + if( mpLayouter ) + { + delete mpLayouter; + mpLayouter = 0; + } - if( mxTable.is() ) - { - Reference< XModifyListener > xListener( static_cast< ::com::sun::star::util::XModifyListener* >(this) ); - mxTable->removeModifyListener( xListener ); - mxTable->dispose(); - mxTable.clear(); - } + if( mxTable.is() ) + { + Reference< XModifyListener > xListener( static_cast< ::com::sun::star::util::XModifyListener* >(this) ); + mxTable->removeModifyListener( xListener ); + mxTable->dispose(); + mxTable.clear(); + } - maTableStyle = rSource.maTableStyle; + maTableStyle = rSource.maTableStyle; - mxTable = new TableModel( mpTableObj, rSource.mxTable ); - mpLayouter = new TableLayouter( mxTable ); - Reference< XModifyListener > xListener( static_cast< ::com::sun::star::util::XModifyListener* >(this) ); - mxTable->addModifyListener( xListener ); - mxTableStyle = rSource.mxTableStyle; - UpdateWritingMode(); - ApplyCellStyles(); - mpTableObj->aRect = mpTableObj->maLogicRect; - LayoutTable( mpTableObj->aRect, false, false ); + mxTable = new TableModel( mpTableObj, rSource.mxTable ); + mpLayouter = new TableLayouter( mxTable ); + Reference< XModifyListener > xListener( static_cast< ::com::sun::star::util::XModifyListener* >(this) ); + mxTable->addModifyListener( xListener ); + mxTableStyle = rSource.mxTableStyle; + UpdateWritingMode(); + ApplyCellStyles(); + mpTableObj->aRect = mpTableObj->maLogicRect; + LayoutTable( mpTableObj->aRect, false, false ); + } } // ----------------------------------------------------------------------------- |