summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
Diffstat (limited to 'svx')
-rw-r--r--svx/source/table/tablecontroller.cxx18
1 files changed, 17 insertions, 1 deletions
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index b98feb21c87b..aba6dedfc148 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -1172,6 +1172,13 @@ void SvxTableController::SetVertical( sal_uInt16 nSId )
{
TableModelNotifyGuard aGuard( mxTable.get() );
+ bool bUndo = mpModel && mpModel->IsUndoEnabled();
+ if (bUndo)
+ {
+ mpModel->BegUndo(ImpGetResStr(STR_TABLE_NUMFORMAT));
+ mpModel->AddUndo(mpModel->GetSdrUndoFactory().CreateUndoAttrObject(*pTableObj));
+ }
+
CellPos aStart, aEnd;
getSelectedCells( aStart, aEnd );
@@ -1198,11 +1205,20 @@ void SvxTableController::SetVertical( sal_uInt16 nSId )
{
CellRef xCell( dynamic_cast< Cell* >( mxTable->getCellByPosition( nCol, nRow ).get() ) );
if( xCell.is() )
- xCell->SetMergedItem(aItem);
+ {
+ if (bUndo)
+ xCell->AddUndo();
+ SfxItemSet aSet(xCell->GetItemSet());
+ aSet.Put(aItem);
+ xCell->SetMergedItemSetAndBroadcast(aSet, /*bClearAllItems=*/false);
+ }
}
}
UpdateTableShape();
+
+ if (bUndo)
+ mpModel->EndUndo();
}
}