summaryrefslogtreecommitdiff
path: root/svx/source/toolbars
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2009-06-04 16:21:29 +0000
committerKurt Zenker <kz@openoffice.org>2009-06-04 16:21:29 +0000
commitc3e9297cb1fd34478e529f95892bcd93be9121ab (patch)
treeaadf115a00eafe8e5397143de95f242bcb436c8f /svx/source/toolbars
parent837a58b872594da72126e120e0575b5401c9e0c7 (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/toolbars')
-rw-r--r--svx/source/toolbars/extrusionbar.cxx15
-rw-r--r--svx/source/toolbars/fontworkbar.cxx27
2 files changed, 30 insertions, 12 deletions
diff --git a/svx/source/toolbars/extrusionbar.cxx b/svx/source/toolbars/extrusionbar.cxx
index 996d9efeb431..734c43a15098 100644
--- a/svx/source/toolbars/extrusionbar.cxx
+++ b/svx/source/toolbars/extrusionbar.cxx
@@ -514,6 +514,9 @@ void ExtrusionBar::execute( SdrView* pSdrView, SfxRequest& rReq, SfxBindings& rB
{
sal_uInt16 nSID = rReq.GetSlot();
sal_uInt16 nStrResId = 0;
+
+ const bool bUndo = pSdrView && pSdrView->IsUndoEnabled();
+
switch( nSID )
{
case SID_EXTRUSION_TOOGLE:
@@ -584,14 +587,18 @@ void ExtrusionBar::execute( SdrView* pSdrView, SfxRequest& rReq, SfxBindings& rB
SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
if( pObj->ISA(SdrObjCustomShape) )
{
- String aStr( SVX_RES( nStrResId ) );
- pSdrView->BegUndo( aStr );
- pSdrView->AddUndo( pSdrView->GetModel()->GetSdrUndoFactory().CreateUndoAttrObject( *pObj ) );
+ if( bUndo )
+ {
+ String aStr( SVX_RES( nStrResId ) );
+ pSdrView->BegUndo( aStr );
+ pSdrView->AddUndo( pSdrView->GetModel()->GetSdrUndoFactory().CreateUndoAttrObject( *pObj ) );
+ }
SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
impl_execute( pSdrView, rReq, aGeometryItem, pObj );
pObj->SetMergedItem( aGeometryItem );
pObj->BroadcastObjectChange();
- pSdrView->EndUndo();
+ if( bUndo )
+ pSdrView->EndUndo();
// simulate a context change:
// force SelectionHasChanged() being called
diff --git a/svx/source/toolbars/fontworkbar.cxx b/svx/source/toolbars/fontworkbar.cxx
index 469833597483..d18fcaeb3cba 100644
--- a/svx/source/toolbars/fontworkbar.cxx
+++ b/svx/source/toolbars/fontworkbar.cxx
@@ -492,9 +492,14 @@ void FontworkBar::execute( SdrView* pSdrView, SfxRequest& rReq, SfxBindings& rBi
SdrObject* pObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
if( pObj->ISA(SdrObjCustomShape) )
{
- String aStr( SVX_RES( RID_SVXSTR_UNDO_APPLY_FONTWORK_SHAPE ) );
- pSdrView->BegUndo( aStr );
- pSdrView->AddUndo( pSdrView->GetModel()->GetSdrUndoFactory().CreateUndoAttrObject( *pObj ) );
+ const bool bUndo = pSdrView->IsUndoEnabled();
+
+ if( bUndo )
+ {
+ String aStr( SVX_RES( RID_SVXSTR_UNDO_APPLY_FONTWORK_SHAPE ) );
+ pSdrView->BegUndo( aStr );
+ pSdrView->AddUndo( pSdrView->GetModel()->GetSdrUndoFactory().CreateUndoAttrObject( *pObj ) );
+ }
SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
GetGeometryForCustomShape( aGeometryItem, aCustomShape );
pObj->SetMergedItem( aGeometryItem );
@@ -508,7 +513,8 @@ void FontworkBar::execute( SdrView* pSdrView, SfxRequest& rReq, SfxBindings& rBi
}
pObj->BroadcastObjectChange();
- pSdrView->EndUndo();
+ if( bUndo )
+ pSdrView->EndUndo();
pSdrView->AdjustMarkHdl(); //HMH sal_True );
rBindings.Invalidate( SID_FONTWORK_SHAPE_TYPE );
}
@@ -562,14 +568,19 @@ void FontworkBar::execute( SdrView* pSdrView, SfxRequest& rReq, SfxBindings& rBi
SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
if( pObj->ISA(SdrObjCustomShape) )
{
- String aStr( SVX_RES( nStrResId ) );
- pSdrView->BegUndo( aStr );
- pSdrView->AddUndo( pSdrView->GetModel()->GetSdrUndoFactory().CreateUndoAttrObject( *pObj ) );
+ const bool bUndo = pSdrView->IsUndoEnabled();
+ if( bUndo )
+ {
+ String aStr( SVX_RES( nStrResId ) );
+ pSdrView->BegUndo( aStr );
+ pSdrView->AddUndo( pSdrView->GetModel()->GetSdrUndoFactory().CreateUndoAttrObject( *pObj ) );
+ }
SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
impl_execute( pSdrView, rReq, aGeometryItem, pObj );
pObj->SetMergedItem( aGeometryItem );
pObj->BroadcastObjectChange();
- pSdrView->EndUndo();
+ if( bUndo )
+ pSdrView->EndUndo();
}
}
}