23#include <com/sun/star/util/XModifyBroadcaster.hpp>
24#include <com/sun/star/document/UndoFailedException.hpp>
30#include <svtools/strings.hrc>
35using ::com::sun::star::uno::Reference;
36using ::com::sun::star::uno::Sequence;
56 ENSURE_OR_RETURN_VOID( xBroadcaster.is(),
"UndoCommandDispatch::initialize: missing modification broadcaster interface!" );
57 xBroadcaster->addModifyListener(
this );
61 const OUString & rURL,
67 const bool bFireAll = rURL.isEmpty();
68 uno::Any aUndoState, aRedoState, aUndoStrings, aRedoStrings;
77 if( bFireAll || rURL ==
".uno:Undo" )
79 if( bFireAll || rURL ==
".uno:Redo" )
81 if( bFireAll || rURL ==
".uno:GetUndoStrings" )
83 if( bFireAll || rURL ==
".uno:GetRedoStrings" )
100 if ( Arguments.hasElements() && Arguments[0].Name ==
URL.Path )
101 Arguments[0].Value >>=
nCount;
105 if (
URL.Path ==
"Undo" )
111 catch(
const document::UndoFailedException& )
115 catch(
const uno::Exception& )
127 OSL_ENSURE( xBroadcaster.is(),
"UndoCommandDispatch::initialize: missing modification broadcaster interface!" );
128 if( xBroadcaster.is() )
130 xBroadcaster->removeModifyListener(
this );
This is the base class for an XDispatch.
void fireStatusEventForURL(const OUString &rURL, const css::uno::Any &rState, bool bEnabled, const css::uno::Reference< css::frame::XStatusListener > &xSingleListener)
sends a status event for a specific command to all registered listeners or only the one given when se...
rtl::Reference<::chart::ChartModel > m_xModel
virtual ~UndoCommandDispatch() override
css::uno::Reference< css::document::XUndoManager > m_xUndoManager
virtual void disposing(std::unique_lock< std::mutex > &rGuard) override
is called when this is disposed
UndoCommandDispatch(const css::uno::Reference< css::uno::XComponentContext > &xContext, rtl::Reference<::chart::ChartModel > xModel)
virtual void SAL_CALL dispatch(const css::util::URL &URL, const css::uno::Sequence< css::beans::PropertyValue > &Arguments) override
virtual void initialize() override
virtual void fireStatusEvent(const OUString &rURL, const css::uno::Reference< css::frame::XStatusListener > &xSingleListener) override
sends a status event for a specific command to all registered listeners or only the one given when se...
#define DBG_UNHANDLED_EXCEPTION(...)
#define ENSURE_OR_RETURN_VOID(c, m)
Reference< frame::XModel > m_xModel
Reference< XModel > xModel
SVT_DLLPUBLIC OUString SvtResId(TranslateId aId)