40using namespace ::
cppu;
42#define DISPATCH_SAVEAS 0
43#define DISPATCH_SAVE 1
44#define DISPATCH_CLOSEDOC 2
45#define DISPATCH_CLOSEWIN 3
46#define DISPATCH_CLOSEFRAME 4
47#define DISPATCH_RELOAD 5
52 EventObject aEvt( *
this );
67 :m_pContentHolder( _pContentHolder )
68 ,m_aInterceptedURL{
".uno:SaveAs",
96 ::osl::MutexGuard aGuard(
m_aMutex );
124 Sequence< PropertyValue > aNewArgs = Arguments;
127 while( nInd < aNewArgs.getLength() )
129 if ( aNewArgs[nInd].
Name ==
"SaveTo" )
131 aNewArgs.getArray()[nInd].Value <<=
true;
137 if ( nInd == aNewArgs.getLength() )
139 aNewArgs.realloc( nInd + 1 );
140 auto pNewArgs = aNewArgs.getArray();
141 pNewArgs[nInd].Name =
"SaveTo";
142 pNewArgs[nInd].Value <<=
true;
157 DispatchHelper* pHelper =
new DispatchHelper;
158 pHelper->aArguments = Arguments;
167 std::unique_ptr<DispatchHelper> pHelper(
static_cast< DispatchHelper*
>( _pDispatcher ) );
170 if ( m_pContentHolder && m_pContentHolder->prepareClose() && m_xSlaveDispatchProvider.is() )
172 Reference< XDispatch >
xDispatch = m_xSlaveDispatchProvider->queryDispatch(pHelper->aURL,
"_self", 0 );
175 Reference< XInterface > xKeepContentHolderAlive( *m_pContentHolder );
176 xDispatch->dispatch( pHelper->aURL,pHelper->aArguments);
199 FeatureStateEvent aStateEvent;
201 aStateEvent.FeatureDescriptor =
"SaveCopyTo";
202 aStateEvent.IsEnabled =
true;
203 aStateEvent.Requery =
false;
204 aStateEvent.State <<= OUString(
"($3)");
205 Control->statusChanged(aStateEvent);
218 FeatureStateEvent aStateEvent;
220 aStateEvent.FeatureDescriptor =
"Update";
221 aStateEvent.IsEnabled =
true;
222 aStateEvent.Requery =
false;
224 Control->statusChanged(aStateEvent);
241 FeatureStateEvent aStateEvent;
243 aStateEvent.FeatureDescriptor =
"Close and Return";
244 aStateEvent.IsEnabled =
true;
245 aStateEvent.Requery =
false;
246 Control->statusChanged(aStateEvent);
292 for(;pIter != pEnd;++pIter)
294 if (
URL.Complete == *pIter )
295 return static_cast<XDispatch*
>(
this);
301 return Reference<XDispatch>();
307 typedef Sequence<Reference<XDispatch>> DispatchSeq;
310 DispatchSeq(Requests.getLength());
312 auto aRetRange = asNonConstRange(aRet);
313 for(sal_Int32
i = 0;
i < Requests.getLength(); ++
i)
317 for(;pIter != pEnd;++pIter)
319 if ( Requests[
i].FeatureURL.Complete == *pIter )
321 aRetRange[
i] =
static_cast<XDispatch*
>(
this);
355 const Reference< XDispatchProvider >& NewSupplier )
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
const css::uno::Reference< css::uno::XComponentContext > & getContext() const
virtual css::uno::Reference< css::util::XCloseable > SAL_CALL getComponent() override
const css::uno::Reference< css::sdbc::XConnection > & getConnection() const
static void fillReportData(const css::uno::Reference< css::uno::XComponentContext > &_rxContext, const css::uno::Reference< css::util::XCloseable > &_rxComponent, const css::uno::Reference< css::sdbc::XConnection > &_rxActiveConnection)
bool save(bool _bApprove, const css::uno::Reference< css::awt::XTopWindow > &rDialogParent)
virtual void SAL_CALL addStatusListener(const css::uno::Reference< css::frame::XStatusListener > &Control, const css::util::URL &URL) override
virtual void SAL_CALL dispatch(const css::util::URL &URL, const css::uno::Sequence< css::beans::PropertyValue > &Arguments) override
OInterceptor(ODocumentDefinition *_pContentHolder)
virtual ~OInterceptor() override
virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches(const css::uno::Sequence< css::frame::DispatchDescriptor > &Requests) override
css::uno::Reference< css::frame::XDispatchProvider > m_xMasterDispatchProvider
virtual void SAL_CALL setSlaveDispatchProvider(const css::uno::Reference< css::frame::XDispatchProvider > &NewDispatchProvider) override
virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL getMasterDispatchProvider() override
virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch(const css::util::URL &URL, const OUString &TargetFrameName, sal_Int32 SearchFlags) override
css::uno::Reference< css::frame::XDispatchProvider > m_xSlaveDispatchProvider
virtual css::uno::Sequence< OUString > SAL_CALL getInterceptedURLs() override
css::uno::Sequence< OUString > m_aInterceptedURL
ODocumentDefinition * m_pContentHolder
comphelper::OMultiTypeInterfaceContainerHelperVar3< css::frame::XStatusListener, OUString > StatusListenerContainer
virtual void SAL_CALL setMasterDispatchProvider(const css::uno::Reference< css::frame::XDispatchProvider > &NewSupplier) override
virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL getSlaveDispatchProvider() override
std::unique_ptr< StatusListenerContainer > m_pStatCL
virtual void SAL_CALL removeStatusListener(const css::uno::Reference< css::frame::XStatusListener > &Control, const css::util::URL &URL) override
#define DBG_UNHANDLED_EXCEPTION(...)
Reference< XDispatch > xDispatch
#define DISPATCH_CLOSEFRAME
#define DISPATCH_CLOSEWIN
#define DISPATCH_CLOSEDOC
Sequence< PropertyValue > aArguments
#define LINK(Instance, Class, Member)
IMPL_LINK(OInterceptor, OnDispatch, void *, _pDispatcher, void)