void SdrEditView::EndUndo()
{ // #i13033# // Comparison changed to 1L since EndUndo() is called later now // and EndUndo WILL change count to count-1 if(1 == GetModel().GetUndoBracketLevel())
{
ImpBroadcastEdgesOfMarkedNodes();
}
// #i13033# // moved to bottom to still have access to UNDOs inside of // ImpBroadcastEdgesOfMarkedNodes()
GetModel().EndUndo();
}
// #i13033# // New mechanism to search for necessary disconnections for // changed connectors inside the transitive hull of all at // the beginning of UNDO selected objects for(size_t a(0); a < rAllMarkedObjects.size(); a++)
{
SdrEdgeObj* pEdge = dynamic_cast<SdrEdgeObj*>( rAllMarkedObjects[a] );
void SdrEditView::CheckPossibilities()
{ if (mbSomeObjChgdFlag)
{
m_bPossibilitiesDirty = true;
// This call IS necessary to correct the MarkList, in which // no longer to the model belonging objects still can reside. // These ones need to be removed.
CheckMarked();
}
// these ones are only allowed when single object is selected
m_bTransparenceAllowed = (nMarkCount == 1);
m_bGradientAllowed = (nMarkCount == 1);
m_bCropAllowed = (nMarkCount == 1); if(m_bGradientAllowed)
{ // gradient depends on fill style const SdrMark* pM = rMarkList.GetMark(0); const SdrObject* pObj = pM->GetMarkedSdrObj();
// may be group object, so get merged ItemSet const SfxItemSet& rSet = pObj->GetMergedItemSet();
SfxItemState eState = rSet.GetItemState(XATTR_FILLSTYLE, false);
if(SfxItemState::INVALID != eState)
{ // If state is not DONTCARE, test the item
drawing::FillStyle eFillStyle = rSet.Get(XATTR_FILLSTYLE).GetValue();
for (size_t nm=0; nm<nMarkCount; ++nm) { const SdrMark* pM=rMarkList.GetMark(nm); const SdrObject* pObj=pM->GetMarkedSdrObj(); const SdrPageView* pPV=pM->GetPageView(); if (pPV!=pPV0) { if (pPV->IsReadOnly()) m_bReadOnly=true;
pPV0=pPV;
}
SdrObjTransformInfoRec aInfo;
pObj->TakeObjInfo(aInfo); bool bMovPrt=pObj->IsMoveProtect(); bool bSizPrt=pObj->IsResizeProtect(); if (!bMovPrt && aInfo.bMoveAllowed) nMovableCount++; // count MovableObjs if (bMovPrt) m_bMoveProtect=true; if (bSizPrt) m_bResizeProtect=true;
// not allowed when not allowed at one object if(!aInfo.bTransparenceAllowed)
m_bTransparenceAllowed = false;
// If one of these can't do something, none can if (!aInfo.bMoveAllowed ) m_bMoveAllowed =false; if (!aInfo.bResizeFreeAllowed) m_bResizeFreeAllowed=false; if (!aInfo.bResizePropAllowed) m_bResizePropAllowed=false; if (!aInfo.bRotateFreeAllowed) m_bRotateFreeAllowed=false; if (!aInfo.bRotate90Allowed ) m_bRotate90Allowed =false; if (!aInfo.bMirrorFreeAllowed) m_bMirrorFreeAllowed=false; if (!aInfo.bMirror45Allowed ) m_bMirror45Allowed =false; if (!aInfo.bMirror90Allowed ) m_bMirror90Allowed =false; if (!aInfo.bShearAllowed ) m_bShearAllowed =false; if (aInfo.bEdgeRadiusAllowed) m_bEdgeRadiusAllowed=true; if (aInfo.bNoContortion ) m_bContortionPossible=false; // For Crook with Contortion: all objects have to be // Movable and Rotatable, except for a maximum of 1 of them if (!m_bMoreThanOneNoMovRot) { if (!aInfo.bMoveAllowed || !aInfo.bResizeFreeAllowed) {
m_bMoreThanOneNoMovRot=bNoMovRotFound;
bNoMovRotFound=true;
}
}
// Must be resizable to allow cropping if (!aInfo.bResizeFreeAllowed && !aInfo.bResizePropAllowed)
m_bCropAllowed = false;
// if one member cannot be converted, no conversion is possible if(!aInfo.bCanConvToContour)
m_bCanConvToContour = false;
// Ungroup if (!m_bUnGroupPossible) m_bUnGroupPossible=pObj->GetSubList()!=nullptr; // ConvertToCurve: If at least one can be converted, that is fine. if (aInfo.bCanConvToPath ) m_bCanConvToPath =true; if (aInfo.bCanConvToPoly ) m_bCanConvToPoly =true;
bool bIs3D = DynCastE3dObject(pObj); // set up a scene updater if object is a 3d object if(bIs3D)
{
aUpdaters.push_back(new E3DModifySceneSnapRectUpdater(pObj));
}
if( !bUndo )
{ // tdf#108863 and tdf#108889 don't delete objects before EndUndo()
ret.push_back(pObj);
}
pOL->RemoveObject(nOrdNum);
}
// fire scene updaters while(!aUpdaters.empty())
{ delete aUpdaters.back();
aUpdaters.pop_back();
}
}
if( bUndo )
EndUndo();
} return ret;
}
staticvoid lcl_LazyDelete(std::vector<rtl::Reference<SdrObject>> & rLazyDelete)
{ // now delete removed scene objects while (!rLazyDelete.empty())
rLazyDelete.pop_back();
}
void SdrEditView::DeleteMarkedObj()
{ const SdrMarkList& rMarkList = GetMarkedObjectList(); // #i110981# return when nothing is to be done at all if(!rMarkList.GetMarkCount())
{ return;
}
// moved breaking action and undo start outside loop
BrkAction();
BegUndo(SvxResId(STR_EditDelete),rMarkList.GetMarkDescription(),SdrRepeatFunc::Delete);
std::vector<rtl::Reference<SdrObject>> lazyDeleteObjects; // remove as long as something is selected. This allows to schedule objects for // removal for a next run as needed while(rMarkList.GetMarkCount())
{ // vector to remember the parents which may be empty after object removal
std::vector< SdrObject* > aParents;
{ const size_t nCount(rMarkList.GetMarkCount());
for(size_t a = 0; a < nCount; ++a)
{ // in the first run, add all found parents, but only once
SdrMark* pMark(rMarkList.GetMark(a));
SdrObject* pObject(pMark->GetMarkedSdrObj());
SdrObject* pParent(pObject->getParentSdrObjectFromSdrObject());
if(!aParents.empty())
{ // in a 2nd run, remove all objects which may already be scheduled for // removal. I am not sure if this can happen, but theoretically // a to-be-removed object may already be the group/3DScene itself for(size_t a = 0; a < nCount; ++a)
{
SdrMark* pMark = rMarkList.GetMark(a);
SdrObject* pObject = pMark->GetMarkedSdrObj();
// original stuff: remove selected objects. Handle clear will // do something only once auto temp(DeleteMarkedList(rMarkList));
lazyDeleteObjects.insert(lazyDeleteObjects.end(), temp.begin(), temp.end());
GetMarkedObjectListWriteAccess().Clear();
maHdlList.Clear();
SdrMarkList aSourceObjectsForCopy(rMarkList); // The following loop is used instead of MarkList::Merge(), to be // able to flag the MarkEntries. const size_t nEdgeCnt = GetEdgesOfMarkedNodes().GetMarkCount(); for (size_t nEdgeNum=0; nEdgeNum<nEdgeCnt; ++nEdgeNum) {
SdrMark aM(*GetEdgesOfMarkedNodes().GetMark(nEdgeNum));
aM.SetUser(1);
aSourceObjectsForCopy.InsertEntry(aM);
}
aSourceObjectsForCopy.ForceSort();
// #i13033# // New mechanism to re-create the connections of cloned connectors
CloneList aCloneList;
if (pM->GetUser()==0)
{ // otherwise it is only an Edge we have to copy as well
GetMarkedObjectListWriteAccess().InsertEntry(aME);
}
} else {
nCloneErrCnt++;
}
}
// #i13033# // New mechanism to re-create the connections of cloned connectors
aCloneList.CopyConnections();
if(nCloneErrCnt)
{ #ifdef DBG_UTIL
OStringBuffer aStr("SdrEditView::CopyMarkedObj(): Error when cloning ");
if (!(nOptions & SdrInsertFlags::DONTMARK)) { if (!(nOptions & SdrInsertFlags::ADDMARK)) UnmarkAllObj();
MarkObj(pObj,&rPV);
} returntrue;
}
void SdrEditView::ReplaceObjectAtView(SdrObject* pOldObj, SdrPageView& rPV, SdrObject* pNewObj, bool bMark)
{ if(IsTextEdit())
{ #ifdef DBG_UTIL if(auto pTextObj = DynCastSdrTextObj(pOldObj)) if (pTextObj->IsTextEditActive())
OSL_ENSURE(false, "OldObject is in TextEdit mode, this has to be ended before replacing it using SdrEndTextEdit (!)");
if(auto pTextObj = DynCastSdrTextObj(pNewObj)) if (pTextObj->IsTextEditActive())
OSL_ENSURE(false, "NewObject is in TextEdit mode, this has to be ended before replacing it using SdrEndTextEdit (!)"); #endif
// #i123468# emergency repair situation, needs to cast up to a class derived from // this one; (aw080 has a mechanism for that and the view hierarchy is secured to // always be a SdrView)
SdrView *pSdrView = dynamic_cast<SdrView*>(this); if (pSdrView)
pSdrView->SdrEndTextEdit();
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.