diff options
author | Kurt Zenker <kz@openoffice.org> | 2009-06-04 16:21:29 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2009-06-04 16:21:29 +0000 |
commit | c3e9297cb1fd34478e529f95892bcd93be9121ab (patch) | |
tree | aadf115a00eafe8e5397143de95f242bcb436c8f /svx/source/svdraw/svdglev.cxx | |
parent | 837a58b872594da72126e120e0575b5401c9e0c7 (diff) |
CWS-TOOLING: integrate CWS clnoundo
2009-05-18 09:40:22 +0200 wg r271998 : i102011
2009-04-28 12:20:24 +0200 cl r271318 : CWS-TOOLING: rebase CWS clnoundo to trunk@270723 (milestone: DEV300:m46)
2009-04-02 11:37:14 +0200 cl r270388 : #i100371# check valid positions all the time to avoid crashes during model lock
2009-03-30 13:02:27 +0200 cl r270219 : #i100371# do not create undo actions in drawing layer during load
2009-03-30 12:59:41 +0200 cl r270218 : #i100371# do not create undo actions in drawing layer during load
2009-03-30 12:55:06 +0200 cl r270217 : #i100371# do not create undo actions in drawing layer during load
2009-03-30 12:53:27 +0200 cl r270216 : #i100371# do not create undo actions in drawing layer during load
2009-03-30 12:49:28 +0200 cl r270215 : #i100371# added EnableUndo() and IsUndoEnabled()
Diffstat (limited to 'svx/source/svdraw/svdglev.cxx')
-rw-r--r-- | svx/source/svdraw/svdglev.cxx | 79 |
1 files changed, 56 insertions, 23 deletions
diff --git a/svx/source/svdraw/svdglev.cxx b/svx/source/svdraw/svdglev.cxx index dfc4fe171850..ac33106d3555 100644 --- a/svx/source/svdraw/svdglev.cxx +++ b/svx/source/svdraw/svdglev.cxx @@ -76,12 +76,17 @@ void SdrGlueEditView::ImpDoMarkedGluePoints(PGlueDoFunc pDoFunc, BOOL bConst, co } else { pGPL=pObj->ForceGluePointList(); } - if (pGPL!=NULL) { - if (!bConst) AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj)); - for (ULONG nPtNum=0; nPtNum<nPtAnz; nPtNum++) { + if (pGPL!=NULL) + { + if(!bConst && IsUndoEnabled() ) + AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj)); + + for (ULONG nPtNum=0; nPtNum<nPtAnz; nPtNum++) + { USHORT nPtId=pPts->GetObject(nPtNum); USHORT nGlueIdx=pGPL->FindGluePoint(nPtId); - if (nGlueIdx!=SDRGLUEPOINT_NOTFOUND) { + if (nGlueIdx!=SDRGLUEPOINT_NOTFOUND) + { SdrGluePoint& rGP=(*pGPL)[nGlueIdx]; (*pDoFunc)(rGP,pObj,p1,p2,p3,p4,p5); } @@ -240,21 +245,31 @@ void SdrGlueEditView::DeleteMarkedGluePoints() { BrkAction(); ForceUndirtyMrkPnt(); - BegUndo(ImpGetResStr(STR_EditDelete),GetDescriptionOfMarkedGluePoints(),SDRREPFUNC_OBJ_DELETE); + const bool bUndo = IsUndoEnabled(); + if( bUndo ) + BegUndo(ImpGetResStr(STR_EditDelete),GetDescriptionOfMarkedGluePoints(),SDRREPFUNC_OBJ_DELETE); + ULONG nMarkAnz=GetMarkedObjectCount(); - for (ULONG nm=0; nm<nMarkAnz; nm++) { + for (ULONG nm=0; nm<nMarkAnz; nm++) + { SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pObj=pM->GetMarkedSdrObj(); const SdrUShortCont* pPts=pM->GetMarkedGluePoints(); ULONG nPtAnz=pPts==NULL ? 0 : pPts->GetCount(); - if (nPtAnz!=0) { + if (nPtAnz!=0) + { SdrGluePointList* pGPL=pObj->ForceGluePointList(); - if (pGPL!=NULL) { - AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj)); - for (ULONG nPtNum=0; nPtNum<nPtAnz; nPtNum++) { + if (pGPL!=NULL) + { + if( bUndo ) + AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj)); + + for (ULONG nPtNum=0; nPtNum<nPtAnz; nPtNum++) + { USHORT nPtId=pPts->GetObject(nPtNum); USHORT nGlueIdx=pGPL->FindGluePoint(nPtId); - if (nGlueIdx!=SDRGLUEPOINT_NOTFOUND) { + if (nGlueIdx!=SDRGLUEPOINT_NOTFOUND) + { pGPL->Delete(nGlueIdx); } } @@ -263,29 +278,41 @@ void SdrGlueEditView::DeleteMarkedGluePoints() } } } - EndUndo(); + if( bUndo ) + EndUndo(); UnmarkAllGluePoints(); - if (nMarkAnz!=0) pMod->SetChanged(); + if (nMarkAnz!=0) + pMod->SetChanged(); } //////////////////////////////////////////////////////////////////////////////////////////////////// void SdrGlueEditView::ImpCopyMarkedGluePoints() { - BegUndo(); + const bool bUndo = IsUndoEnabled(); + + if( bUndo ) + BegUndo(); + ULONG nMarkAnz=GetMarkedObjectCount(); - for (ULONG nm=0; nm<nMarkAnz; nm++) { + for (ULONG nm=0; nm<nMarkAnz; nm++) + { SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pObj=pM->GetMarkedSdrObj(); SdrUShortCont* pPts=pM->GetMarkedGluePoints(); SdrGluePointList* pGPL=pObj->ForceGluePointList(); ULONG nPtAnz=pPts==NULL ? 0 : pPts->GetCount(); - if (nPtAnz!=0 && pGPL!=NULL) { - AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj)); - for (ULONG nPtNum=0; nPtNum<nPtAnz; nPtNum++) { + if (nPtAnz!=0 && pGPL!=NULL) + { + if( bUndo ) + AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj)); + + for (ULONG nPtNum=0; nPtNum<nPtAnz; nPtNum++) + { USHORT nPtId=pPts->GetObject(nPtNum); USHORT nGlueIdx=pGPL->FindGluePoint(nPtId); - if (nGlueIdx!=SDRGLUEPOINT_NOTFOUND) { + if (nGlueIdx!=SDRGLUEPOINT_NOTFOUND) + { SdrGluePoint aNewGP((*pGPL)[nGlueIdx]); // GluePoint klonen USHORT nNewIdx=pGPL->Insert(aNewGP); // und einfuegen USHORT nNewId=(*pGPL)[nNewIdx].GetId(); // Id des neuen GluePoints ermitteln @@ -294,8 +321,11 @@ void SdrGlueEditView::ImpCopyMarkedGluePoints() } } } - EndUndo(); - if (nMarkAnz!=0) pMod->SetChanged(); + if( bUndo ) + EndUndo(); + + if (nMarkAnz!=0) + pMod->SetChanged(); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -310,8 +340,11 @@ void SdrGlueEditView::ImpTransformMarkedGluePoints(PGlueTrFunc pTrFunc, const vo ULONG nPtAnz=pPts==NULL ? 0 : pPts->GetCount(); if (nPtAnz!=0) { SdrGluePointList* pGPL=pObj->ForceGluePointList(); - if (pGPL!=NULL) { - AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj)); + if (pGPL!=NULL) + { + if( IsUndoEnabled() ) + AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj)); + for (ULONG nPtNum=0; nPtNum<nPtAnz; nPtNum++) { USHORT nPtId=pPts->GetObject(nPtNum); USHORT nGlueIdx=pGPL->FindGluePoint(nPtId); |