From a5a569e618519de7611d7aff935024f0d88ddb4f Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 17 Jun 2009 12:31:00 +0000 Subject: #i10000# fix bad integration --- svx/source/table/tablecontroller.cxx | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'svx') diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index 55125b14eff4..1d7b3f8a3295 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -582,7 +582,10 @@ void SvxTableController::onInsert( sal_uInt16 nSId ) } if( bUndo ) + { mpModel->EndUndo(); + mpModel->SetChanged(); + } if( mpModel ) mpModel->SetChanged(); @@ -987,6 +990,9 @@ void SvxTableController::MergeMarkedCells() SdrTableObj* pTableObj = dynamic_cast< ::sdr::table::SdrTableObj* >( mxTableObj.get() ); if( pTableObj ) { + if( pTableObj->IsTextEditActive() ) + mpView->SdrEndTextEdit(sal_True); + TableModelNotifyGuard aGuard( mxTable.get() ); MergeRange( aStart.mnCol, aStart.mnRow, aEnd.mnCol, aEnd.mnRow ); } @@ -1018,6 +1024,9 @@ void SvxTableController::SplitMarkedCells() SdrTableObj* pTableObj = dynamic_cast< SdrTableObj* >( mxTableObj.get() ); if( pTableObj ) { + if( pTableObj->IsTextEditActive() ) + mpView->SdrEndTextEdit(sal_True); + TableModelNotifyGuard aGuard( mxTable.get() ); const bool bUndo = mpModel && mpModel->IsUndoEnabled(); @@ -1476,7 +1485,16 @@ bool SvxTableController::executeAction( sal_uInt16 nAction, bool bSelect, Window if( bSelect ) gotoCell( pTableObj->getPreviousCell( getSelectionEnd(), true ), false, pWindow, nAction ); else - gotoCell( pTableObj->getNextCell( getSelectionEnd(), true ), false, pWindow, nAction ); + { + CellPos aSelectionEnd( getSelectionEnd() ); + CellPos aNextCell( pTableObj->getNextCell( aSelectionEnd, true ) ); + if( aSelectionEnd == aNextCell ) + { + onInsert( SID_TABLE_INSERT_ROW ); + aNextCell = pTableObj->getNextCell( aSelectionEnd, true ); + } + gotoCell( aNextCell, false, pWindow, nAction ); + } break; } } @@ -1974,7 +1992,7 @@ void SvxTableController::MergeAttrFromSelectedCells(SfxItemSet& rAttr, bool bOnl for( sal_Int32 nCol = aStart.mnCol; nCol <= aEnd.mnCol; nCol++ ) { CellRef xCell( dynamic_cast< Cell* >( mxTable->getCellByPosition( nCol, nRow ).get() ) ); - if( xCell.is() ) + if( xCell.is() && !xCell->isMerged() ) { const SfxItemSet& rSet = xCell->GetItemSet(); SfxWhichIter aIter(rSet); -- cgit v1.2.3