diff -cNr old/sc/source/ui/view/cellsh3.cxx new/sc/source/ui/view/cellsh3.cxx *** old/sc/source/ui/view/cellsh3.cxx Wed May 23 04:12:36 2007 --- new/sc/source/ui/view/cellsh3.cxx Thu Oct 18 22:01:10 2007 *************** *** 67,72 **** --- 67,73 ---- #include "editable.hxx" #include "scabstdlg.hxx" //CHINA001 + #include "attrib.hxx" #define IS_EDITMODE() GetViewData()->HasEditView( GetViewData()->GetActivePart() ) *************** *** 757,762 **** --- 758,773 ---- if ( !GetViewData()->GetDocument()->GetChangeTrack() ) { // test whether to merge or to split + ScDocument* pDoc = GetViewData()->GetDocument(); + SfxObjectShell* pDocSh = GetViewData()->GetSfxDocShell(); + SCTAB nTab = GetViewData()->GetTabNo(); + SCCOL nCol = GetViewData()->GetCurX(); + SCROW nRow = GetViewData()->GetCurY(); + BOOL bProtectDoc = pDoc->IsTabProtected( nTab ) || pDocSh->IsReadOnly(); + const ScProtectionAttr* pProtAttr = static_cast< const ScProtectionAttr* >( pDoc->GetAttr(nCol, nRow, nTab, ATTR_PROTECTION )); + BOOL bProtectAttr = pProtAttr->GetProtection() || pProtAttr->GetHideCell(); + BOOL bProtect = bProtectDoc && bProtectAttr; + bool bMerge = false; switch( nSlot ) { *************** *** 799,809 **** else { // split cells ! if (pTabViewShell->RemoveMerge()) { rBindings.Invalidate( nSlot ); rReq.Done(); } } break; } --- 810,826 ---- else { // split cells ! if( bProtect ) { rBindings.Invalidate( nSlot ); rReq.Done(); } + else + { + pTabViewShell->RemoveMerge(); + rBindings.Invalidate( nSlot ); + rReq.Done(); + } } break; }