diff options
Diffstat (limited to 'chart2/source/controller/main/UndoCommandDispatch.cxx')
-rw-r--r-- | chart2/source/controller/main/UndoCommandDispatch.cxx | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/chart2/source/controller/main/UndoCommandDispatch.cxx b/chart2/source/controller/main/UndoCommandDispatch.cxx index e4bd85a3be34..1c5c760f93f5 100644 --- a/chart2/source/controller/main/UndoCommandDispatch.cxx +++ b/chart2/source/controller/main/UndoCommandDispatch.cxx @@ -18,14 +18,14 @@ */ #include "UndoCommandDispatch.hxx" +#include <ChartModel.hxx> -#include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/util/XModifyBroadcaster.hpp> #include <com/sun/star/document/UndoFailedException.hpp> -#include <com/sun/star/document/XUndoManagerSupplier.hpp> +#include <utility> #include <vcl/svapp.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <svtools/strings.hrc> #include <svtools/svtresid.hxx> @@ -40,12 +40,11 @@ namespace chart UndoCommandDispatch::UndoCommandDispatch( const Reference< uno::XComponentContext > & xContext, - const Reference< frame::XModel > & xModel ) : + rtl::Reference<::chart::ChartModel> xModel ) : CommandDispatch( xContext ), - m_xModel( xModel ) + m_xModel(std::move( xModel )) { - uno::Reference< document::XUndoManagerSupplier > xSuppUndo( m_xModel, uno::UNO_QUERY_THROW ); - m_xUndoManager.set( xSuppUndo->getUndoManager(), uno::UNO_SET_THROW ); + m_xUndoManager.set( m_xModel->getUndoManager(), uno::UNO_SET_THROW ); } UndoCommandDispatch::~UndoCommandDispatch() @@ -76,13 +75,13 @@ void UndoCommandDispatch::fireStatusEvent( aRedoStrings <<= m_xUndoManager->getAllRedoActionTitles(); if( bFireAll || rURL == ".uno:Undo" ) - fireStatusEventForURL( ".uno:Undo", aUndoState, m_xUndoManager->isUndoPossible(), xSingleListener ); + fireStatusEventForURL( u".uno:Undo"_ustr, aUndoState, m_xUndoManager->isUndoPossible(), xSingleListener ); if( bFireAll || rURL == ".uno:Redo" ) - fireStatusEventForURL( ".uno:Redo", aRedoState, m_xUndoManager->isRedoPossible(), xSingleListener ); + fireStatusEventForURL( u".uno:Redo"_ustr, aRedoState, m_xUndoManager->isRedoPossible(), xSingleListener ); if( bFireAll || rURL == ".uno:GetUndoStrings" ) - fireStatusEventForURL( ".uno:GetUndoStrings", aUndoStrings, true, xSingleListener ); + fireStatusEventForURL( u".uno:GetUndoStrings"_ustr, aUndoStrings, true, xSingleListener ); if( bFireAll || rURL == ".uno:GetRedoStrings" ) - fireStatusEventForURL( ".uno:GetRedoStrings", aRedoStrings, true, xSingleListener ); + fireStatusEventForURL( u".uno:GetRedoStrings"_ustr, aRedoStrings, true, xSingleListener ); } // ____ XDispatch ____ @@ -122,7 +121,7 @@ void SAL_CALL UndoCommandDispatch::dispatch( // ____ WeakComponentImplHelperBase ____ /// is called when this is disposed -void SAL_CALL UndoCommandDispatch::disposing() +void UndoCommandDispatch::disposing(std::unique_lock<std::mutex>& /*rGuard*/) { Reference< util::XModifyBroadcaster > xBroadcaster( m_xUndoManager, uno::UNO_QUERY ); OSL_ENSURE( xBroadcaster.is(), "UndoCommandDispatch::initialize: missing modification broadcaster interface!" ); |