diff options
Diffstat (limited to 'chart2/source/controller')
-rw-r--r-- | chart2/source/controller/main/UndoGuard.cxx | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/chart2/source/controller/main/UndoGuard.cxx b/chart2/source/controller/main/UndoGuard.cxx index 97418e725140..b2a02aaa3522 100644 --- a/chart2/source/controller/main/UndoGuard.cxx +++ b/chart2/source/controller/main/UndoGuard.cxx @@ -70,11 +70,18 @@ UndoGuard::~UndoGuard() void UndoGuard::commit() { - if ( !m_bActionPosted && !!m_pDocumentSnapshot && m_xUndoManager.is() ) + if ( !m_bActionPosted && !!m_pDocumentSnapshot ) { - const Reference< document::XUndoAction > xAction( new impl::UndoElement( m_aUndoString, m_xChartModel, m_pDocumentSnapshot ) ); - m_pDocumentSnapshot.reset(); // don't dispose, it's data went over to the UndoElement - m_xUndoManager->addUndoAction( xAction ); + try + { + const Reference< document::XUndoAction > xAction( new impl::UndoElement( m_aUndoString, m_xChartModel, m_pDocumentSnapshot ) ); + m_pDocumentSnapshot.reset(); // don't dispose, it's data went over to the UndoElement + m_xUndoManager->addUndoAction( xAction ); + } + catch( const uno::Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } } m_bActionPosted = true; } |