diff -cNr old/sc/source/ui/drawfunc/fusel2.cxx new/sc/source/ui/drawfunc/fusel2.cxx *** old/sc/source/ui/drawfunc/fusel2.cxx Tue Nov 14 23:52:32 2006 --- new/sc/source/ui/drawfunc/fusel2.cxx Fri Jun 29 16:52:54 2007 *************** *** 46,51 **** --- 46,52 ---- #include #include #include + #include #include "fusel.hxx" #include "tabvwsh.hxx" *************** *** 53,58 **** --- 54,63 ---- #include "detfunc.hxx" #include "futext.hxx" #include "sc.hrc" + #include "userdat.hxx" + #include "drwlayer.hxx" + #include "attrib.hxx" + #include "scitems.hxx" // ----------------------------------------------------------------------- *************** *** 130,135 **** --- 135,141 ---- return FALSE; SdrObject* pFoundObj = NULL; + ScAddress aTabPos; SdrObjListIter aIter( *pPV->GetObjList(), IM_FLAT ); SdrObject* pObject = aIter.Next(); *************** *** 139,144 **** --- 145,155 ---- && pObject->GetLogicRect().IsInside( rPos ) ) { pFoundObj = pObject; + ScDrawObjData* pData = ScDrawLayer::GetObjDataTab( pObject, pViewShell->GetViewData()->GetTabNo() ); + if( pData ) + { + aTabPos = ScAddress( pData->aStt); + } // keep searching - use the last matching object (on top) } pObject = aIter.Next(); *************** *** 148,158 **** if ( pFoundObj ) { SdrLayer* pLockLayer = NULL; ! // Leave the internal note object unlocked - re-lock in ScDrawView::MarkListHasChanged() pLockLayer = pDrDoc->GetLayerAdmin().GetLayerPerID(SC_LAYER_INTERN); if (pLockLayer && pView->IsLayerLocked(pLockLayer->GetName())) ! pView->SetLayerLocked( pLockLayer->GetName(), FALSE ); } return (pFoundObj != NULL); --- 159,174 ---- if ( pFoundObj ) { SdrLayer* pLockLayer = NULL; ! ScDocument* pDoc = pViewShell->GetViewData()->GetDocument(); ! SfxObjectShell* pDocSh = pViewShell->GetViewData()->GetSfxDocShell(); ! const ScProtectionAttr* pProtAttr = static_cast< const ScProtectionAttr* > (pDoc->GetAttr(aTabPos.Col(), aTabPos.Row(), aTabPos.Tab(), ATTR_PROTECTION ) ); ! BOOL bProtectAttr = pProtAttr->GetProtection() || pProtAttr->GetHideCell() ; ! BOOL bProtectDoc = pDoc->IsTabProtected(aTabPos.Tab()) || pDocSh->IsReadOnly() ; ! BOOL bProtect = bProtectDoc && bProtectAttr ; // Leave the internal note object unlocked - re-lock in ScDrawView::MarkListHasChanged() pLockLayer = pDrDoc->GetLayerAdmin().GetLayerPerID(SC_LAYER_INTERN); if (pLockLayer && pView->IsLayerLocked(pLockLayer->GetName())) ! pView->SetLayerLocked( pLockLayer->GetName(), bProtect ); } return (pFoundObj != NULL);