summaryrefslogtreecommitdiff
path: root/svx/source/form/fmpgeimp.cxx
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/form/fmpgeimp.cxx
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/form/fmpgeimp.cxx')
-rw-r--r--svx/source/form/fmpgeimp.cxx63
1 files changed, 41 insertions, 22 deletions
diff --git a/svx/source/form/fmpgeimp.cxx b/svx/source/form/fmpgeimp.cxx
index ae9e5a349532..41243a41bda2 100644
--- a/svx/source/form/fmpgeimp.cxx
+++ b/svx/source/form/fmpgeimp.cxx
@@ -355,10 +355,14 @@ Reference< XForm > FmFormPageImpl::getDefaultForm()
if ( !xForm.is() )
{
SdrModel* pModel = pPage->GetModel();
- XubString aStr(SVX_RES(RID_STR_FORM));
- XubString aUndoStr(SVX_RES(RID_STR_UNDO_CONTAINER_INSERT));
- aUndoStr.SearchAndReplace('#', aStr);
- pModel->BegUndo(aUndoStr);
+
+ if( pModel->IsUndoEnabled() )
+ {
+ XubString aStr(SVX_RES(RID_STR_FORM));
+ XubString aUndoStr(SVX_RES(RID_STR_UNDO_CONTAINER_INSERT));
+ aUndoStr.SearchAndReplace('#', aStr);
+ pModel->BegUndo(aUndoStr);
+ }
try
{
@@ -373,11 +377,14 @@ Reference< XForm > FmFormPageImpl::getDefaultForm()
xFormProps->setPropertyValue( FM_PROP_NAME, makeAny( sName ) );
Reference< XIndexContainer > xContainer( xForms, UNO_QUERY );
- pModel->AddUndo(new FmUndoContainerAction(*(FmFormModel*)pModel,
- FmUndoContainerAction::Inserted,
- xContainer,
- xForm,
- xContainer->getCount()));
+ if( pModel->IsUndoEnabled() )
+ {
+ pModel->AddUndo(new FmUndoContainerAction(*(FmFormModel*)pModel,
+ FmUndoContainerAction::Inserted,
+ xContainer,
+ xForm,
+ xContainer->getCount()));
+ }
xForms->insertByName( sName, makeAny( xForm ) );
xCurrentForm = xForm;
}
@@ -387,7 +394,8 @@ Reference< XForm > FmFormPageImpl::getDefaultForm()
xForm.clear();
}
- pModel->EndUndo();
+ if( pModel->IsUndoEnabled() )
+ pModel->EndUndo();
}
return xForm;
@@ -429,10 +437,17 @@ Reference< ::com::sun::star::form::XForm > FmFormPageImpl::findPlaceInFormCompo
if (!xForm.is())
{
SdrModel* pModel = pPage->GetModel();
- XubString aStr(SVX_RES(RID_STR_FORM));
- XubString aUndoStr(SVX_RES(RID_STR_UNDO_CONTAINER_INSERT));
- aUndoStr.SearchAndReplace('#', aStr);
- pModel->BegUndo(aUndoStr);
+
+ const bool bUndo = pModel->IsUndoEnabled();
+
+ if( bUndo )
+ {
+ XubString aStr(SVX_RES(RID_STR_FORM));
+ XubString aUndoStr(SVX_RES(RID_STR_UNDO_CONTAINER_INSERT));
+ aUndoStr.SearchAndReplace('#', aStr);
+ pModel->BegUndo(aUndoStr);
+ }
+
xForm = Reference< ::com::sun::star::form::XForm >(::comphelper::getProcessServiceFactory()->createInstance(FM_SUN_COMPONENT_FORM), UNO_QUERY);
// a form should always have the command type table as default
Reference< ::com::sun::star::beans::XPropertySet > xFormProps(xForm, UNO_QUERY);
@@ -465,16 +480,20 @@ Reference< ::com::sun::star::form::XForm > FmFormPageImpl::findPlaceInFormCompo
xFormProps->setPropertyValue(FM_PROP_NAME, makeAny(aName));
- Reference< ::com::sun::star::container::XIndexContainer > xContainer( getForms(), UNO_QUERY );
- pModel->AddUndo(new FmUndoContainerAction(*(FmFormModel*)pModel,
- FmUndoContainerAction::Inserted,
- xContainer,
- xForm,
- xContainer->getCount()));
-
+ if( bUndo )
+ {
+ Reference< ::com::sun::star::container::XIndexContainer > xContainer( getForms(), UNO_QUERY );
+ pModel->AddUndo(new FmUndoContainerAction(*(FmFormModel*)pModel,
+ FmUndoContainerAction::Inserted,
+ xContainer,
+ xForm,
+ xContainer->getCount()));
+ }
getForms()->insertByName(aName, makeAny(xForm));
- pModel->EndUndo();
+
+ if( bUndo )
+ pModel->EndUndo();
}
xCurrentForm = xForm;
}