summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/cellsh3.cxx
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2004-08-02 11:59:12 +0000
committerKurt Zenker <kz@openoffice.org>2004-08-02 11:59:12 +0000
commit545db7e2837b607392b4b6d9e6b5ea290242321d (patch)
treec18bf49940888b77a869c5e1b776a605e5603941 /sc/source/ui/view/cellsh3.cxx
parent9d1c9c84d506af4f38305386c4d2e2d0f4d6ce0e (diff)
INTEGRATION: CWS os35 (1.13.34); FILE MERGED
2004/07/17 13:42:00 dr 1.13.34.3: #i20500# new 'toggle merge cells' slot 2004/07/17 13:18:08 dr 1.13.34.2: #i20500# new 'toggle merge cells' slot 2004/07/16 23:21:59 dr 1.13.34.1: #i20500# merge cells toolbar button
Diffstat (limited to 'sc/source/ui/view/cellsh3.cxx')
-rw-r--r--sc/source/ui/view/cellsh3.cxx57
1 files changed, 42 insertions, 15 deletions
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index d4b7fa6302f6..c1db771dc397 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: cellsh3.cxx,v $
*
- * $Revision: 1.14 $
+ * $Revision: 1.15 $
*
- * last change: $Author: kz $ $Date: 2004-08-02 10:14:06 $
+ * last change: $Author: kz $ $Date: 2004-08-02 12:59:12 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -797,14 +797,38 @@ void ScCellShell::Execute( SfxRequest& rReq )
break;
case FID_MERGE_ON:
+ case FID_MERGE_OFF:
+ case FID_MERGE_TOGGLE:
+ {
+ if ( !GetViewData()->GetDocument()->GetChangeTrack() )
{
- if ( !GetViewData()->GetDocument()->GetChangeTrack() )
+ // test whether to merge or to split
+ bool bMerge = false;
+ switch( nSlot )
+ {
+ case FID_MERGE_ON:
+ bMerge = true;
+ break;
+ case FID_MERGE_OFF:
+ bMerge = false;
+ break;
+ case FID_MERGE_TOGGLE:
+ {
+ SfxPoolItem* pItem = 0;
+ if( rBindings.QueryState( nSlot, pItem ) >= SFX_ITEM_DEFAULT )
+ bMerge = !static_cast< SfxBoolItem* >( pItem )->GetValue();
+ }
+ break;
+ }
+
+ if( bMerge )
{
+ // merge - check if to move contents of covered cells
BOOL bMoveContents = FALSE;
BOOL bApi = rReq.IsAPI();
const SfxPoolItem* pItem;
if ( pReqArgs &&
- pReqArgs->GetItemState(FID_MERGE_ON, TRUE, &pItem) == SFX_ITEM_SET )
+ pReqArgs->GetItemState(nSlot, TRUE, &pItem) == SFX_ITEM_SET )
{
DBG_ASSERT(pItem && pItem->ISA(SfxBoolItem), "falsches Item");
bMoveContents = ((const SfxBoolItem*)pItem)->GetValue();
@@ -813,21 +837,24 @@ void ScCellShell::Execute( SfxRequest& rReq )
if (pTabViewShell->MergeCells( bApi, bMoveContents ))
{
if (!bApi && bMoveContents) // "ja" im Dialog geklickt
- {
- rReq.AppendItem( SfxBoolItem( FID_MERGE_ON, bMoveContents ) );
- }
+ rReq.AppendItem( SfxBoolItem( nSlot, bMoveContents ) );
+ rBindings.Invalidate( nSlot );
rReq.Done();
}
}
+ else
+ {
+ // split cells
+ if (pTabViewShell->RemoveMerge())
+ {
+ rBindings.Invalidate( nSlot );
+ rReq.Done();
+ }
+ }
+ break;
}
- break;
- case FID_MERGE_OFF:
- if ( !GetViewData()->GetDocument()->GetChangeTrack() )
- {
- if (pTabViewShell->RemoveMerge())
- rReq.Done();
- }
- break;
+ }
+ break;
case SID_AUTOFORMAT:
{