Kaydet (Commit) 2ee43cff authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Prepare to handle out (and inout) parameters to event callbacks

Change-Id: I47054c1df40d1058618b0fbd3fdb82fa93ca8836
üst 6c8c727f
...@@ -1977,7 +1977,7 @@ public: ...@@ -1977,7 +1977,7 @@ public:
ooo::vba::TypeAndIID aTypeAndIID); ooo::vba::TypeAndIID aTypeAndIID);
// XSink // XSink
void SAL_CALL Call( const OUString& Method, const Sequence< Any >& Arguments ) override; void SAL_CALL Call( const OUString& Method, Sequence< Any >& Arguments ) override;
private: private:
IUnknown* mpUnkSink; IUnknown* mpUnkSink;
...@@ -1996,7 +1996,7 @@ Sink::Sink(IUnknown* pUnkSink, ...@@ -1996,7 +1996,7 @@ Sink::Sink(IUnknown* pUnkSink,
} }
void SAL_CALL void SAL_CALL
Sink::Call( const OUString& Method, const Sequence< Any >& Arguments ) Sink::Call( const OUString& Method, Sequence< Any >& Arguments )
{ {
SAL_INFO("extensions.olebridge", "Sink::Call(" << Method << ", " << Arguments.getLength() << " arguments)"); SAL_INFO("extensions.olebridge", "Sink::Call(" << Method << ", " << Arguments.getLength() << " arguments)");
......
...@@ -26,7 +26,7 @@ interface XSink ...@@ -26,7 +26,7 @@ interface XSink
// Automation client. // Automation client.
// FIXME: Add "out" arguments, and perhaps exceptions? // FIXME: Add "out" arguments, and perhaps exceptions?
void Call([in] string Method, [in] sequence<any> Arguments); void Call([in] string Method, [inout] sequence<any> Arguments);
}; };
}; }; }; };
......
...@@ -19,7 +19,7 @@ module ooo { module vba { ...@@ -19,7 +19,7 @@ module ooo { module vba {
interface XSinkCaller interface XSinkCaller
{ {
void CallSinks([in] string Method, [in] sequence<any> Arguments); void CallSinks([in] string Method, [inout] sequence<any> Arguments);
}; };
}; }; }; };
......
...@@ -314,7 +314,7 @@ public: ...@@ -314,7 +314,7 @@ public:
virtual bool GetProtectionHash( /*out*/ css::uno::Sequence< sal_Int8 > &rPasswordHash ) override; virtual bool GetProtectionHash( /*out*/ css::uno::Sequence< sal_Int8 > &rPasswordHash ) override;
void RegisterAutomationDocumentEventsCaller(css::uno::Reference< ooo::vba::XSinkCaller > const& xCaller); void RegisterAutomationDocumentEventsCaller(css::uno::Reference< ooo::vba::XSinkCaller > const& xCaller);
void CallAutomationDocumentEventSinks(const OUString& Method, const css::uno::Sequence< css::uno::Any >& Arguments); void CallAutomationDocumentEventSinks(const OUString& Method, css::uno::Sequence< css::uno::Any >& Arguments);
}; };
/** Find the right DocShell and create a new one: /** Find the right DocShell and create a new one:
......
...@@ -248,7 +248,7 @@ public: ...@@ -248,7 +248,7 @@ public:
GetLanguageGuesser(); GetLanguageGuesser();
void RegisterAutomationApplicationEventsCaller(css::uno::Reference< ooo::vba::XSinkCaller > const& xCaller); void RegisterAutomationApplicationEventsCaller(css::uno::Reference< ooo::vba::XSinkCaller > const& xCaller);
void CallAutomationApplicationEventSinks(const OUString& Method, const css::uno::Sequence< css::uno::Any >& Arguments); void CallAutomationApplicationEventSinks(const OUString& Method, css::uno::Sequence< css::uno::Any >& Arguments);
}; };
inline const css::uno::Reference< css::linguistic2::XLinguServiceEventListener >& inline const css::uno::Reference< css::linguistic2::XLinguServiceEventListener >&
......
...@@ -267,7 +267,7 @@ SwVbaApplicationOutgoingConnectionPoint::SwVbaApplicationOutgoingConnectionPoint ...@@ -267,7 +267,7 @@ SwVbaApplicationOutgoingConnectionPoint::SwVbaApplicationOutgoingConnectionPoint
// XSinkCaller // XSinkCaller
void SAL_CALL void SAL_CALL
SwVbaApplication::CallSinks( const OUString& Method, const uno::Sequence< uno::Any >& Arguments ) SwVbaApplication::CallSinks( const OUString& Method, uno::Sequence< uno::Any >& Arguments )
{ {
for (auto& i : mvSinks) for (auto& i : mvSinks)
{ {
......
...@@ -87,7 +87,7 @@ public: ...@@ -87,7 +87,7 @@ public:
virtual css::uno::Sequence<OUString> getServiceNames() override; virtual css::uno::Sequence<OUString> getServiceNames() override;
// XSinkCaller // XSinkCaller
virtual void SAL_CALL CallSinks( const OUString& Method, const css::uno::Sequence< css::uno::Any >& Arguments ) override; virtual void SAL_CALL CallSinks( const OUString& Method, css::uno::Sequence< css::uno::Any >& Arguments ) override;
protected: protected:
virtual css::uno::Reference< css::frame::XModel > getCurrentDocument() override; virtual css::uno::Reference< css::frame::XModel > getCurrentDocument() override;
......
...@@ -561,7 +561,7 @@ SwVbaDocument::GetConnectionPoint() ...@@ -561,7 +561,7 @@ SwVbaDocument::GetConnectionPoint()
// XSinkCaller // XSinkCaller
void SAL_CALL void SAL_CALL
SwVbaDocument::CallSinks( const OUString& Method, const uno::Sequence< uno::Any >& Arguments ) SwVbaDocument::CallSinks( const OUString& Method, uno::Sequence< uno::Any >& Arguments )
{ {
for (auto& i : mvSinks) for (auto& i : mvSinks)
{ {
......
...@@ -106,7 +106,7 @@ public: ...@@ -106,7 +106,7 @@ public:
virtual css::uno::Sequence<OUString> getServiceNames() override; virtual css::uno::Sequence<OUString> getServiceNames() override;
// XSinkCaller // XSinkCaller
virtual void SAL_CALL CallSinks( const OUString& Method, const css::uno::Sequence< css::uno::Any >& Arguments ) override; virtual void SAL_CALL CallSinks( const OUString& Method, css::uno::Sequence< css::uno::Any >& Arguments ) override;
}; };
#endif // INCLUDED_SW_SOURCE_UI_VBA_VBADOCUMENT_HXX #endif // INCLUDED_SW_SOURCE_UI_VBA_VBADOCUMENT_HXX
......
...@@ -1383,7 +1383,7 @@ void SwDocShell::RegisterAutomationDocumentEventsCaller(css::uno::Reference< ooo ...@@ -1383,7 +1383,7 @@ void SwDocShell::RegisterAutomationDocumentEventsCaller(css::uno::Reference< ooo
mxAutomationDocumentEventsCaller = xCaller; mxAutomationDocumentEventsCaller = xCaller;
} }
void SwDocShell::CallAutomationDocumentEventSinks(const OUString& Method, const css::uno::Sequence< css::uno::Any >& Arguments) void SwDocShell::CallAutomationDocumentEventSinks(const OUString& Method, css::uno::Sequence< css::uno::Any >& Arguments)
{ {
if (mxAutomationDocumentEventsCaller.is()) if (mxAutomationDocumentEventsCaller.is())
mxAutomationDocumentEventsCaller->CallSinks(Method, Arguments); mxAutomationDocumentEventsCaller->CallSinks(Method, Arguments);
......
...@@ -255,7 +255,10 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) ...@@ -255,7 +255,10 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
lcl_processCompatibleSfxHint( xVbaEvents, rHint ); lcl_processCompatibleSfxHint( xVbaEvents, rHint );
if ( rHint.GetId() == SfxHintId::DocChanged ) if ( rHint.GetId() == SfxHintId::DocChanged )
SW_MOD()->CallAutomationApplicationEventSinks( "DocumentChange", css::uno::Sequence< css::uno::Any >() ); {
uno::Sequence< css::uno::Any > aArgs;
SW_MOD()->CallAutomationApplicationEventSinks( "DocumentChange", aArgs );
}
sal_uInt16 nAction = 0; sal_uInt16 nAction = 0;
auto pEventHint = dynamic_cast<const SfxEventHint*>(&rHint); auto pEventHint = dynamic_cast<const SfxEventHint*>(&rHint);
......
...@@ -221,7 +221,8 @@ uno::Reference< linguistic2::XLanguageGuessing > const & SwModule::GetLanguageGu ...@@ -221,7 +221,8 @@ uno::Reference< linguistic2::XLanguageGuessing > const & SwModule::GetLanguageGu
SwModule::~SwModule() SwModule::~SwModule()
{ {
CallAutomationApplicationEventSinks( "Quit", css::uno::Sequence< css::uno::Any >() ); css::uno::Sequence< css::uno::Any > aArgs;
CallAutomationApplicationEventSinks( "Quit", aArgs );
delete m_pErrorHandler; delete m_pErrorHandler;
EndListening( *SfxGetpApp() ); EndListening( *SfxGetpApp() );
} }
...@@ -441,7 +442,7 @@ void SwModule::RegisterAutomationApplicationEventsCaller(css::uno::Reference< oo ...@@ -441,7 +442,7 @@ void SwModule::RegisterAutomationApplicationEventsCaller(css::uno::Reference< oo
mxAutomationApplicationEventsCaller = xCaller; mxAutomationApplicationEventsCaller = xCaller;
} }
void SwModule::CallAutomationApplicationEventSinks(const OUString& Method, const css::uno::Sequence< css::uno::Any >& Arguments) void SwModule::CallAutomationApplicationEventSinks(const OUString& Method, css::uno::Sequence< css::uno::Any >& Arguments)
{ {
if (mxAutomationApplicationEventsCaller.is()) if (mxAutomationApplicationEventsCaller.is())
mxAutomationApplicationEventsCaller->CallSinks(Method, Arguments); mxAutomationApplicationEventsCaller->CallSinks(Method, Arguments);
......
...@@ -629,7 +629,8 @@ void SwXTextDocument::dispose() ...@@ -629,7 +629,8 @@ void SwXTextDocument::dispose()
void SwXTextDocument::close( sal_Bool bDeliverOwnership ) void SwXTextDocument::close( sal_Bool bDeliverOwnership )
{ {
pDocShell->CallAutomationDocumentEventSinks( "Close", css::uno::Sequence< css::uno::Any >() ); uno::Sequence< uno::Any > aArgs;
pDocShell->CallAutomationDocumentEventSinks( "Close", aArgs );
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if(IsValid() && m_pHiddenViewFrame) if(IsValid() && m_pHiddenViewFrame)
lcl_DisposeView( m_pHiddenViewFrame, pDocShell); lcl_DisposeView( m_pHiddenViewFrame, pDocShell);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment