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/svdedxv.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/svdedxv.cxx')
-rw-r--r-- | svx/source/svdraw/svdedxv.cxx | 104 |
1 files changed, 69 insertions, 35 deletions
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 49ba83ed35ae..75ce75240a6f 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -858,7 +858,8 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(sal_Bool bDontDeleteReally) pTextEditCursorMerker=NULL; aTextEditArea=Rectangle(); - if (pTEOutliner!=NULL) { + if (pTEOutliner!=NULL) + { BOOL bModified=pTEOutliner->IsModified(); if (pTEOutlinerView!=NULL) { @@ -886,9 +887,13 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(sal_Bool bDontDeleteReally) pTEOutliner->SetBeginPasteOrDropHdl(Link()); pTEOutliner->SetEndPasteOrDropHdl(Link()); - XubString aObjName; - pTEObj->TakeObjNameSingul(aObjName); - BegUndo(ImpGetResStr(STR_UndoObjSetText),aObjName); + const bool bUndo = IsUndoEnabled(); + if( bUndo ) + { + XubString aObjName; + pTEObj->TakeObjNameSingul(aObjName); + BegUndo(ImpGetResStr(STR_UndoObjSetText),aObjName); + } pTEObj->EndTextEdit(*pTEOutliner); @@ -922,25 +927,43 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(sal_Bool bDontDeleteReally) if(pTEObj->IsInserted() && bDelObj && pTextObj->GetObjInventor()==SdrInventor && !bDontDeleteReally) { SdrObjKind eIdent=(SdrObjKind)pTextObj->GetObjIdentifier(); - if (eIdent==OBJ_TEXT || eIdent==OBJ_TEXTEXT) + if(eIdent==OBJ_TEXT || eIdent==OBJ_TEXTEXT) { pDelUndo= GetModel()->GetSdrUndoFactory().CreateUndoDeleteObject(*pTEObj); } } } - if (pTxtUndo!=NULL) { AddUndo(pTxtUndo); eRet=SDRENDTEXTEDIT_CHANGED; } - if (pDelUndo!=NULL) { - AddUndo(pDelUndo); + if (pTxtUndo!=NULL) + { + if( bUndo ) + AddUndo(pTxtUndo); + eRet=SDRENDTEXTEDIT_CHANGED; + } + if (pDelUndo!=NULL) + { + if( bUndo ) + { + AddUndo(pDelUndo); + } + else + { + delete pDelUndo; + } eRet=SDRENDTEXTEDIT_DELETED; DBG_ASSERT(pTEObj->GetObjList()!=NULL,"SdrObjEditView::SdrEndTextEdit(): Fatal: Editiertes Objekt hat keine ObjList!"); - if (pTEObj->GetObjList()!=NULL) { + if (pTEObj->GetObjList()!=NULL) + { pTEObj->GetObjList()->RemoveObject(pTEObj->GetOrdNum()); CheckMarked(); // und gleich die Maekierung entfernen... } - } else if (bDelObj) { // Fuer den Writer: Loeschen muss die App nachholen. + } + else if (bDelObj) + { // Fuer den Writer: Loeschen muss die App nachholen. eRet=SDRENDTEXTEDIT_SHOULDBEDELETED; } - EndUndo(); // EndUndo hinter Remove, falls der UndoStack gleich weggehaun' wird + + if( bUndo ) + EndUndo(); // EndUndo hinter Remove, falls der UndoStack gleich weggehaun' wird // #111096# // Switch on evtl. TextAnimation again after TextEdit @@ -955,14 +978,16 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(sal_Bool bDontDeleteReally) AdjustMarkHdl(); } // alle OutlinerViews loeschen - for (ULONG i=pTEOutliner->GetViewCount(); i>0;) { + for (ULONG i=pTEOutliner->GetViewCount(); i>0;) + { i--; OutlinerView* pOLV=pTEOutliner->GetView(i); USHORT nMorePix=pOLV->GetInvalidateMore() + 10; // solaris aw033 test #i# Window* pWin=pOLV->GetWindow(); Rectangle aRect(pOLV->GetOutputArea()); pTEOutliner->RemoveView(i); - if (!bTextEditDontDelete || i!=0) { + if (!bTextEditDontDelete || i!=0) + { // die nullte gehoert mir u.U. nicht. delete pOLV; } @@ -1564,21 +1589,26 @@ BOOL SdrObjEditView::SetAttributes(const SfxItemSet& rSet, BOOL bReplaceAll) if( !bRet ) { - String aStr; - ImpTakeDescriptionStr(STR_EditSetAttributes,aStr); - BegUndo(aStr); - AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*mxTextEditObj.get())); - - // #i43537# - // If this is a text object also rescue the OutlinerParaObject since - // applying attributes to the object may change text layout when - // multiple portions exist with multiple formats. If a OutlinerParaObject - // really exists and needs to be rescued is evaluated in the undo - // implementation itself. - sal_Bool bRescueText(mxTextEditObj->ISA(SdrTextObj)); - - AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*mxTextEditObj.get(),false,!bNoEEItems || bRescueText)); - EndUndo(); + const bool bUndo = IsUndoEnabled(); + + if( bUndo ) + { + String aStr; + ImpTakeDescriptionStr(STR_EditSetAttributes,aStr); + BegUndo(aStr); + AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*mxTextEditObj.get())); + + // #i43537# + // If this is a text object also rescue the OutlinerParaObject since + // applying attributes to the object may change text layout when + // multiple portions exist with multiple formats. If a OutlinerParaObject + // really exists and needs to be rescued is evaluated in the undo + // implementation itself. + bool bRescueText = dynamic_cast< SdrTextObj* >(mxTextEditObj.get()); + + AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*mxTextEditObj.get(),false,!bNoEEItems || bRescueText)); + EndUndo(); + } mxTextEditObj->SetMergedItemSetAndBroadcast(*pSet, bReplaceAll); @@ -1610,12 +1640,15 @@ BOOL SdrObjEditView::SetAttributes(const SfxItemSet& rSet, BOOL bReplaceAll) if( !bRet ) { - String aStr; - ImpTakeDescriptionStr(STR_EditSetAttributes,aStr); - BegUndo(aStr); - AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*mxTextEditObj.get())); - AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*mxTextEditObj.get(),false,false)); - EndUndo(); + if( IsUndoEnabled() ) + { + String aStr; + ImpTakeDescriptionStr(STR_EditSetAttributes,aStr); + BegUndo(aStr); + AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*mxTextEditObj.get())); + AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*mxTextEditObj.get(),false,false)); + EndUndo(); + } mxTextEditObj->SetMergedItemSetAndBroadcast(aSet, bReplaceAll); @@ -1645,7 +1678,8 @@ BOOL SdrObjEditView::SetAttributes(const SfxItemSet& rSet, BOOL bReplaceAll) } bRet=TRUE; } - if (pModifiedSet!=NULL) delete pModifiedSet; + if (pModifiedSet!=NULL) + delete pModifiedSet; return bRet; } |