summaryrefslogtreecommitdiff
path: root/svx/source/table
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@Sun.COM>2009-10-22 17:29:01 +0200
committerArmin Le Grand <Armin.Le.Grand@Sun.COM>2009-10-22 17:29:01 +0200
commitafc5047960fa639a4ab215abddecd8747532c2e0 (patch)
tree65d342d901e6f510a6a35d41f861523029004d05 /svx/source/table
parentece6eb1ab43ca851cb4c9e4cda848ecdcda9d0b0 (diff)
parentc18e25b533b12d73ae8bc58564f9eda45c26e3b1 (diff)
commit after rebase to DEV300m62
Diffstat (limited to 'svx/source/table')
-rw-r--r--svx/source/table/cell.cxx13
-rw-r--r--svx/source/table/cellcursor.cxx17
-rw-r--r--svx/source/table/tablecontroller.cxx41
-rw-r--r--svx/source/table/tablelayouter.cxx1
-rw-r--r--svx/source/table/tablemodel.cxx14
-rw-r--r--svx/source/table/viewcontactoftableobj.cxx2
6 files changed, 46 insertions, 42 deletions
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index 46268a68ca02..42034f2bd0cb 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -278,19 +278,6 @@ namespace sdr
void CellProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
{
TextProperties::SetStyleSheet( pNewStyleSheet, bDontRemoveHardAttr );
-
- if( bDontRemoveHardAttr && pNewStyleSheet )
- {
- GetObjectItemSet();
-
- const SfxItemSet& rStyleAttribs = pNewStyleSheet->GetItemSet();
-
- for ( USHORT nWhich = SDRATTR_START; nWhich <= SDRATTR_TABLE_LAST; nWhich++ )
- {
- if ( rStyleAttribs.GetItemState( nWhich ) == SFX_ITEM_ON )
- mpItemSet->ClearItem( nWhich );
- }
- }
}
} // end of namespace properties
} // end of namespace sdr
diff --git a/svx/source/table/cellcursor.cxx b/svx/source/table/cellcursor.cxx
index 681546b9ebd9..f3b33a12f932 100644
--- a/svx/source/table/cellcursor.cxx
+++ b/svx/source/table/cellcursor.cxx
@@ -269,7 +269,9 @@ void SAL_CALL CellCursor::merge( ) throw (NoSupportException, RuntimeException)
throw DisposedException();
SdrModel* pModel = mxTable->getSdrTableObj()->GetModel();
- if( pModel )
+ const bool bUndo = pModel && mxTable->getSdrTableObj()->IsInserted() && pModel->IsUndoEnabled();
+
+ if( bUndo )
pModel->BegUndo( ImpGetResStr(STR_TABLE_MERGE) );
try
@@ -283,8 +285,11 @@ void SAL_CALL CellCursor::merge( ) throw (NoSupportException, RuntimeException)
DBG_ERROR("sdr::table::CellCursor::merge(), exception caught!");
}
- if( pModel )
+ if( bUndo )
pModel->EndUndo();
+
+ if( pModel )
+ pModel->SetChanged();
}
// -----------------------------------------------------------------------------
@@ -530,7 +535,8 @@ void SAL_CALL CellCursor::split( sal_Int32 nColumns, sal_Int32 nRows ) throw (No
throw DisposedException();
SdrModel* pModel = mxTable->getSdrTableObj()->GetModel();
- if( pModel )
+ const bool bUndo = pModel && mxTable->getSdrTableObj()->IsInserted() && pModel->IsUndoEnabled();
+ if( bUndo )
pModel->BegUndo( ImpGetResStr(STR_TABLE_SPLIT) );
try
@@ -550,8 +556,11 @@ void SAL_CALL CellCursor::split( sal_Int32 nColumns, sal_Int32 nRows ) throw (No
throw NoSupportException();
}
- if( pModel )
+ if( bUndo )
pModel->EndUndo();
+
+ if( pModel )
+ pModel->SetChanged();
}
// -----------------------------------------------------------------------------
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index c99c2b3c2262..d7f64c852fc6 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -568,9 +568,6 @@ void SvxTableController::onInsert( sal_uInt16 nSId, const SfxItemSet* pArgs )
if( bUndo )
mpModel->EndUndo();
- if( mpModel )
- mpModel->SetChanged();
-
aStart.mnCol = nNewStartColumn;
aStart.mnRow = 0;
aEnd.mnCol = aStart.mnCol + nNewColumns - 1;
@@ -602,13 +599,7 @@ void SvxTableController::onInsert( sal_uInt16 nSId, const SfxItemSet* pArgs )
}
if( bUndo )
- {
mpModel->EndUndo();
- mpModel->SetChanged();
- }
-
- if( mpModel )
- mpModel->SetChanged();
aStart.mnCol = 0;
aStart.mnRow = nNewRowStart;
@@ -879,7 +870,8 @@ void SvxTableController::SetTableStyle( const SfxItemSet* pArgs )
pModel->AddUndo( new TableStyleUndo( *pTableObj ) );
}
-/*
+ pTableObj->setTableStyle( xNewTableStyle );
+
const sal_Int32 nRowCount = mxTable->getRowCount();
const sal_Int32 nColCount = mxTable->getColumnCount();
for( sal_Int32 nRow = 0; nRow < nRowCount; nRow++ )
@@ -889,9 +881,26 @@ void SvxTableController::SetTableStyle( const SfxItemSet* pArgs )
CellRef xCell( dynamic_cast< Cell* >( mxTable->getCellByPosition( nCol, nRow ).get() ) );
if( xCell.is() )
{
- if( bUndo )
- xCell->AddUndo();
- xCell->setAllPropertiesToDefault();
+ SfxItemSet aSet( xCell->GetItemSet() );
+ bool bChanges = false;
+ const SfxItemSet& rStyleAttribs = xCell->GetStyleSheet()->GetItemSet();
+
+ for ( USHORT nWhich = SDRATTR_START; nWhich <= SDRATTR_TABLE_LAST; nWhich++ )
+ {
+ if( (rStyleAttribs.GetItemState( nWhich ) == SFX_ITEM_ON) && (aSet.GetItemState( nWhich ) == SFX_ITEM_ON) )
+ {
+ aSet.ClearItem( nWhich );
+ bChanges = true;
+ }
+ }
+
+ if( bChanges )
+ {
+ if( bUndo )
+ xCell->AddUndo();
+
+ xCell->SetMergedItemSetAndBroadcast( aSet, sal_True );
+ }
}
}
catch( Exception& e )
@@ -900,9 +909,6 @@ void SvxTableController::SetTableStyle( const SfxItemSet* pArgs )
DBG_ERROR( "svx::SvxTableController::SetTableStyle(), exception caught!" );
}
}
-*/
-
- pTableObj->setTableStyle( xNewTableStyle );
if( bUndo )
pModel->EndUndo();
@@ -1067,9 +1073,6 @@ void SvxTableController::SplitMarkedCells()
if( bUndo )
mpModel->EndUndo();
-
- if( mpModel )
- mpModel->SetChanged();
}
aEnd.mnRow += mxTable->getRowCount() - nRowCount;
aEnd.mnCol += mxTable->getColumnCount() - nColCount;
diff --git a/svx/source/table/tablelayouter.cxx b/svx/source/table/tablelayouter.cxx
index b2620452d31a..2d19a9994c41 100644
--- a/svx/source/table/tablelayouter.cxx
+++ b/svx/source/table/tablelayouter.cxx
@@ -118,7 +118,6 @@ basegfx::B2ITuple TableLayouter::getCellSize( const CellPos& rPos ) const
width += maColumns[aPos.mnCol++].mnSize;
nColSpan--;
- nColSpan--;
}
}
}
diff --git a/svx/source/table/tablemodel.cxx b/svx/source/table/tablemodel.cxx
index ce79dad77b4c..34ef52f6d701 100644
--- a/svx/source/table/tablemodel.cxx
+++ b/svx/source/table/tablemodel.cxx
@@ -795,6 +795,9 @@ void TableModel::insertColumns( sal_Int32 nIndex, sal_Int32 nCount )
if( bUndo )
pModel->EndUndo();
+ if( pModel )
+ pModel->SetChanged();
+
}
catch( Exception& )
{
@@ -900,10 +903,10 @@ void TableModel::removeColumns( sal_Int32 nIndex, sal_Int32 nCount )
maRows[nRows]->removeColumns( nIndex, nCount );
if( bUndo )
- {
pModel->EndUndo();
+
+ if( pModel )
pModel->SetChanged();
- }
}
catch( Exception& )
{
@@ -970,6 +973,9 @@ void TableModel::insertRows( sal_Int32 nIndex, sal_Int32 nCount )
if( bUndo )
pModel->EndUndo();
+ if( pModel )
+ pModel->SetChanged();
+
updateRows();
setModified(sal_True);
}
@@ -1056,10 +1062,10 @@ void TableModel::removeRows( sal_Int32 nIndex, sal_Int32 nCount )
remove_range<RowVector,RowVector::iterator>( maRows, nIndex, nCount );
if( bUndo )
- {
pModel->EndUndo();
+
+ if( pModel )
pModel->SetChanged();
- }
}
catch( Exception& )
{
diff --git a/svx/source/table/viewcontactoftableobj.cxx b/svx/source/table/viewcontactoftableobj.cxx
index a8396e4eff16..e4e515ed1613 100644
--- a/svx/source/table/viewcontactoftableobj.cxx
+++ b/svx/source/table/viewcontactoftableobj.cxx
@@ -123,7 +123,7 @@ namespace drawinglayer
getTransform(),
*getSdrFTAttribute().getText(),
0,
- true, false));
+ true, false, false));
}
}