summaryrefslogtreecommitdiff
path: root/chart2/source/controller/main/UndoGuard.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/source/controller/main/UndoGuard.cxx')
-rw-r--r--chart2/source/controller/main/UndoGuard.cxx15
1 files changed, 8 insertions, 7 deletions
diff --git a/chart2/source/controller/main/UndoGuard.cxx b/chart2/source/controller/main/UndoGuard.cxx
index 91687aebd28f..4e870c36d07d 100644
--- a/chart2/source/controller/main/UndoGuard.cxx
+++ b/chart2/source/controller/main/UndoGuard.cxx
@@ -20,11 +20,12 @@
#include "UndoGuard.hxx"
#include "ChartModelClone.hxx"
#include "UndoActions.hxx"
+#include <ChartModel.hxx>
#include <com/sun/star/document/XUndoManager.hpp>
-#include <com/sun/star/frame/XModel.hpp>
+#include <utility>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
using namespace ::com::sun::star;
@@ -33,14 +34,14 @@ using ::com::sun::star::uno::Reference;
namespace chart
{
-UndoGuard::UndoGuard( const OUString& i_undoString, const uno::Reference< document::XUndoManager > & i_undoManager,
+UndoGuard::UndoGuard( OUString i_undoString, const uno::Reference< document::XUndoManager > & i_undoManager,
const ModelFacet i_facet )
- :m_xChartModel( i_undoManager->getParent(), uno::UNO_QUERY_THROW )
- ,m_xUndoManager( i_undoManager )
- ,m_pDocumentSnapshot()
- ,m_aUndoString( i_undoString )
+ :m_xUndoManager( i_undoManager )
+ ,m_aUndoString(std::move( i_undoString ))
,m_bActionPosted( false )
{
+ m_xChartModel = dynamic_cast<::chart::ChartModel*>(i_undoManager->getParent().get());
+ assert(m_xChartModel);
m_pDocumentSnapshot = std::make_shared<ChartModelClone>( m_xChartModel, i_facet );
}