editeng/source/items/itemtype.cxx | 4 +-- svx/inc/svx/sdrobjectuser.hxx | 6 ++-- svx/source/table/svdotable.cxx | 50 ++++++++++++++++++++------------------ 3 files changed, 32 insertions(+), 28 deletions(-)
New commits: commit f09d1be5a721bcd6ecc9f217fc4926f4e01ea6ad Author: David Tardon <[email protected]> Date: Thu Mar 14 11:22:01 2013 +0100 fix copypasta Change-Id: I0ed143e66d1b7729afbb56b478f409ed34212244 diff --git a/svx/inc/svx/sdrobjectuser.hxx b/svx/inc/svx/sdrobjectuser.hxx index 4f93225..b1e0c73 100644 --- a/svx/inc/svx/sdrobjectuser.hxx +++ b/svx/inc/svx/sdrobjectuser.hxx @@ -27,9 +27,9 @@ class SdrObject; //////////////////////////////////////////////////////////////////////////////////////////////////// -// To make things more safe, allow users of the page to register at it. The users need to be derived -// from sdr::PageUser to get a call. The users do not need to call RemovePageUser() at the page -// when they get called from PageInDestruction(). +// To make things more safe, allow users of an object to register at it. The users need to be derived +// from sdr::ObjectUser to get a call. The users do not need to call RemoveObjectUser() at the page +// when they get called from ObjectInDestruction(). namespace sdr { commit 327a649b48fa54f7758a1a86d0fa324cfa71bc77 Author: David Tardon <[email protected]> Date: Thu Mar 7 15:27:05 2013 +0100 use SAL_N_ELEMENTS diff --git a/editeng/source/items/itemtype.cxx b/editeng/source/items/itemtype.cxx index daaba33..58506af 100644 --- a/editeng/source/items/itemtype.cxx +++ b/editeng/source/items/itemtype.cxx @@ -149,13 +149,13 @@ XubString GetColorString( const Color& rCol ) COL_LIGHTGRAY, COL_LIGHTBLUE, COL_LIGHTGREEN, COL_LIGHTCYAN, COL_LIGHTRED, COL_LIGHTMAGENTA, COL_YELLOW, COL_WHITE }; - while ( nColor < sizeof(aColAry)/sizeof(ColorData) && + while ( nColor < SAL_N_ELEMENTS(aColAry) && aColAry[nColor] != nColData ) { nColor += 1; } - if ( nColor < sizeof(aColAry)/sizeof(ColorData) ) + if ( nColor < SAL_N_ELEMENTS(aColAry) ) sStr = EE_RESSTR( RID_SVXITEMS_COLOR_BEGIN + nColor + 1 ); if ( sStr.isEmpty() ) commit d352006d1c746e8d80e210de10ff6ed4476dd94d Author: David Tardon <[email protected]> Date: Thu Feb 7 12:46:38 2013 +0100 use the std signature for operator= diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx index dad9ff0..97396a7 100644 --- a/svx/source/table/svdotable.cxx +++ b/svx/source/table/svdotable.cxx @@ -234,7 +234,7 @@ public: void DragEdge( bool mbHorizontal, int nEdge, sal_Int32 nOffset ); - void operator=( const SdrTableObjImpl& rSource ); + SdrTableObjImpl& operator=( const SdrTableObjImpl& rSource ); // XModifyListener virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException); @@ -283,7 +283,7 @@ void SdrTableObjImpl::init( SdrTableObj* pTable, sal_Int32 nColumns, sal_Int32 n // ----------------------------------------------------------------------------- -void SdrTableObjImpl::operator=( const SdrTableObjImpl& rSource ) +SdrTableObjImpl& SdrTableObjImpl::operator=( const SdrTableObjImpl& rSource ) { if (this != &rSource) { @@ -313,6 +313,7 @@ void SdrTableObjImpl::operator=( const SdrTableObjImpl& rSource ) mpTableObj->aRect = mpTableObj->maLogicRect; LayoutTable( mpTableObj->aRect, false, false ); } + return *this; } // ----------------------------------------------------------------------------- commit fd4bcc8318ff54b3e2def557347e9853e9733ace Author: David Tardon <[email protected]> Date: Thu Feb 7 12:45:29 2013 +0100 guard against self-assignment diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx index d54c3f7..dad9ff0 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 ); + } } // ----------------------------------------------------------------------------- _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
