diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-26 09:16:07 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-28 07:32:01 +0100 |
commit | b2897ae7e15d69e25bc608f073e77a5a7aabd9b3 (patch) | |
tree | dcbc7ecc417c716e9c899fcd8af7b3d266e9231a /svx | |
parent | 5ab1b4f97032e4b1f1f0c080311f3a393ce89585 (diff) |
make SvxTableController constructor take SdrTableObj
since the only call site already effectively checks that, simplify the
constructor code accordingly
Change-Id: I29e5283d529a988693972d85cfa8196ba2906220
Reviewed-on: https://gerrit.libreoffice.org/48651
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdedxv.cxx | 2 | ||||
-rw-r--r-- | svx/source/table/tablecontroller.cxx | 32 |
2 files changed, 14 insertions, 20 deletions
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 734008157212..29d54d576e4f 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -2413,7 +2413,7 @@ void SdrObjEditView::MarkListHasChanged() // check for table if( pObj && (pObj->GetObjInventor() == SdrInventor::Default ) && (pObj->GetObjIdentifier() == OBJ_TABLE) ) { - mxSelectionController = sdr::table::CreateTableController( this, pObj, mxLastSelectionController ); + mxSelectionController = sdr::table::CreateTableController( this, static_cast<sdr::table::SdrTableObj const *>(pObj), mxLastSelectionController ); if( mxSelectionController.is() ) { mxLastSelectionController.clear(); diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index f683569df3df..804ebcb655a2 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -141,13 +141,13 @@ void SAL_CALL SvxTableControllerModifyListener::disposing( const css::lang::Even // class SvxTableController -rtl::Reference< sdr::SelectionController > CreateTableController( SdrObjEditView* pView, const SdrObject* pObj, const rtl::Reference< sdr::SelectionController >& xRefController ) +rtl::Reference< sdr::SelectionController > CreateTableController( SdrObjEditView* pView, const SdrTableObj* pObj, const rtl::Reference< sdr::SelectionController >& xRefController ) { return SvxTableController::create( pView, pObj, xRefController ); } -rtl::Reference< sdr::SelectionController > SvxTableController::create( SdrObjEditView* pView, const SdrObject* pObj, const rtl::Reference< sdr::SelectionController >& xRefController ) +rtl::Reference< sdr::SelectionController > SvxTableController::create( SdrObjEditView* pView, const SdrTableObj* pObj, const rtl::Reference< sdr::SelectionController >& xRefController ) { if( xRefController.is() ) { @@ -159,33 +159,27 @@ rtl::Reference< sdr::SelectionController > SvxTableController::create( SdrObjEdi } -SvxTableController::SvxTableController( SdrObjEditView* pView, const SdrObject* pObj ) +SvxTableController::SvxTableController( SdrObjEditView* pView, const SdrTableObj* pObj ) : mbCellSelectionMode(false) , mbLeftButtonDown(false) , mpSelectionOverlay(nullptr) , mpView( dynamic_cast< SdrView* >( pView ) ) -, mxTableObj( dynamic_cast< SdrTableObj* >( const_cast< SdrObject* >( pObj ) ) ) +, mxTableObj( const_cast< SdrTableObj* >( pObj ) ) , mpModel( nullptr ) , mnUpdateEvent( nullptr ) { - if( pObj ) - { - mpModel = pObj->GetModel(); + mpModel = mxTableObj->GetModel(); - if( mxTableObj.is() ) - { - mxTableObj->getActiveCellPos( maCursorFirstPos ); - maCursorLastPos = maCursorFirstPos; + mxTableObj->getActiveCellPos( maCursorFirstPos ); + maCursorLastPos = maCursorFirstPos; - Reference< XTable > xTable( mxTableObj->getTable() ); - if( xTable.is() ) - { - mxModifyListener = new SvxTableControllerModifyListener( this ); - xTable->addModifyListener( mxModifyListener ); + Reference< XTable > xTable( mxTableObj->getTable() ); + if( xTable.is() ) + { + mxModifyListener = new SvxTableControllerModifyListener( this ); + xTable->addModifyListener( mxModifyListener ); - mxTable.set( dynamic_cast< TableModel* >( xTable.get() ) ); - } - } + mxTable.set( dynamic_cast< TableModel* >( xTable.get() ) ); } } |