diff options
Diffstat (limited to 'svx/source/table/cellcursor.cxx')
-rw-r--r-- | svx/source/table/cellcursor.cxx | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/svx/source/table/cellcursor.cxx b/svx/source/table/cellcursor.cxx index db68fdb61ab4..b6368837cfc5 100644 --- a/svx/source/table/cellcursor.cxx +++ b/svx/source/table/cellcursor.cxx @@ -242,11 +242,11 @@ void SAL_CALL CellCursor::merge( ) if( !mxTable.is() || (mxTable->getSdrTableObj() == nullptr) ) throw DisposedException(); - SdrModel* pModel = mxTable->getSdrTableObj()->GetModel(); - const bool bUndo = pModel && mxTable->getSdrTableObj()->IsInserted() && pModel->IsUndoEnabled(); + SdrModel& rModel(mxTable->getSdrTableObj()->getSdrModelFromSdrObject()); + const bool bUndo(mxTable->getSdrTableObj()->IsInserted() && rModel.IsUndoEnabled()); if( bUndo ) - pModel->BegUndo( ImpGetResStr(STR_TABLE_MERGE) ); + rModel.BegUndo( ImpGetResStr(STR_TABLE_MERGE) ); try { @@ -260,10 +260,9 @@ void SAL_CALL CellCursor::merge( ) } if( bUndo ) - pModel->EndUndo(); + rModel.EndUndo(); - if( pModel ) - pModel->SetChanged(); + rModel.SetChanged(); } @@ -503,10 +502,11 @@ void SAL_CALL CellCursor::split( sal_Int32 nColumns, sal_Int32 nRows ) if( !mxTable.is() || (mxTable->getSdrTableObj() == nullptr) ) throw DisposedException(); - SdrModel* pModel = mxTable->getSdrTableObj()->GetModel(); - const bool bUndo = pModel && mxTable->getSdrTableObj()->IsInserted() && pModel->IsUndoEnabled(); + SdrModel& rModel(mxTable->getSdrTableObj()->getSdrModelFromSdrObject()); + const bool bUndo(mxTable->getSdrTableObj()->IsInserted() && rModel.IsUndoEnabled()); + if( bUndo ) - pModel->BegUndo( ImpGetResStr(STR_TABLE_SPLIT) ); + rModel.BegUndo( ImpGetResStr(STR_TABLE_SPLIT) ); try { @@ -526,10 +526,9 @@ void SAL_CALL CellCursor::split( sal_Int32 nColumns, sal_Int32 nRows ) } if( bUndo ) - pModel->EndUndo(); + rModel.EndUndo(); - if( pModel ) - pModel->SetChanged(); + rModel.SetChanged(); } |