[Libreoffice-commits] core.git: extensions/source oovbaapi/ooo sw/inc sw/source

Tor Lillqvist tml at collabora.com
Thu May 31 10:17:22 UTC 2018


 extensions/source/ole/unoobjw.cxx   |    4 ++--
 oovbaapi/ooo/vba/XSink.idl          |    2 +-
 oovbaapi/ooo/vba/XSinkCaller.idl    |    2 +-
 sw/inc/docsh.hxx                    |    2 +-
 sw/inc/swmodule.hxx                 |    2 +-
 sw/source/ui/vba/vbaapplication.cxx |    2 +-
 sw/source/ui/vba/vbaapplication.hxx |    2 +-
 sw/source/ui/vba/vbadocument.cxx    |    2 +-
 sw/source/ui/vba/vbadocument.hxx    |    2 +-
 sw/source/uibase/app/docsh.cxx      |    2 +-
 sw/source/uibase/app/docsh2.cxx     |    5 ++++-
 sw/source/uibase/app/swmodule.cxx   |    5 +++--
 sw/source/uibase/uno/unotxdoc.cxx   |    3 ++-
 13 files changed, 20 insertions(+), 15 deletions(-)

New commits:
commit 2ee43cff5cf0e4125e7b2bbb7c763069c6aca95c
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Apr 9 15:10:40 2018 +0300

    Prepare to handle out (and inout) parameters to event callbacks
    
    Change-Id: I47054c1df40d1058618b0fbd3fdb82fa93ca8836

diff --git a/extensions/source/ole/unoobjw.cxx b/extensions/source/ole/unoobjw.cxx
index 4acd25081315..c76320195abe 100644
--- a/extensions/source/ole/unoobjw.cxx
+++ b/extensions/source/ole/unoobjw.cxx
@@ -1977,7 +1977,7 @@ public:
          ooo::vba::TypeAndIID aTypeAndIID);
 
     // 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:
     IUnknown* mpUnkSink;
@@ -1996,7 +1996,7 @@ Sink::Sink(IUnknown* pUnkSink,
 }
 
 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)");
 
diff --git a/oovbaapi/ooo/vba/XSink.idl b/oovbaapi/ooo/vba/XSink.idl
index 110c9b6a573f..de37dae959e3 100644
--- a/oovbaapi/ooo/vba/XSink.idl
+++ b/oovbaapi/ooo/vba/XSink.idl
@@ -26,7 +26,7 @@ interface XSink
     // Automation client.
 
     // 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);
 };
 
 }; };
diff --git a/oovbaapi/ooo/vba/XSinkCaller.idl b/oovbaapi/ooo/vba/XSinkCaller.idl
index 33be504fbe62..4bc5f34f7fa2 100644
--- a/oovbaapi/ooo/vba/XSinkCaller.idl
+++ b/oovbaapi/ooo/vba/XSinkCaller.idl
@@ -19,7 +19,7 @@ module ooo {  module vba {
 
 interface XSinkCaller
 {
-    void CallSinks([in] string Method, [in] sequence<any> Arguments);
+    void CallSinks([in] string Method, [inout] sequence<any> Arguments);
 };
 
 }; };
diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx
index dc8214c534d8..d93f626b585b 100644
--- a/sw/inc/docsh.hxx
+++ b/sw/inc/docsh.hxx
@@ -314,7 +314,7 @@ public:
     virtual bool    GetProtectionHash( /*out*/ css::uno::Sequence< sal_Int8 > &rPasswordHash ) override;
 
     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:
diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx
index b9d871a50b08..8539f7fd479c 100644
--- a/sw/inc/swmodule.hxx
+++ b/sw/inc/swmodule.hxx
@@ -248,7 +248,7 @@ public:
             GetLanguageGuesser();
 
     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 >&
diff --git a/sw/source/ui/vba/vbaapplication.cxx b/sw/source/ui/vba/vbaapplication.cxx
index d76e7730a783..45c53114e2cc 100644
--- a/sw/source/ui/vba/vbaapplication.cxx
+++ b/sw/source/ui/vba/vbaapplication.cxx
@@ -267,7 +267,7 @@ SwVbaApplicationOutgoingConnectionPoint::SwVbaApplicationOutgoingConnectionPoint
 // XSinkCaller
 
 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)
     {
diff --git a/sw/source/ui/vba/vbaapplication.hxx b/sw/source/ui/vba/vbaapplication.hxx
index 681c4f9159c6..a8763cc15d6e 100644
--- a/sw/source/ui/vba/vbaapplication.hxx
+++ b/sw/source/ui/vba/vbaapplication.hxx
@@ -87,7 +87,7 @@ public:
     virtual css::uno::Sequence<OUString> getServiceNames() override;
 
     // 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:
     virtual css::uno::Reference< css::frame::XModel > getCurrentDocument() override;
diff --git a/sw/source/ui/vba/vbadocument.cxx b/sw/source/ui/vba/vbadocument.cxx
index 47abf61c1b03..b2413cb178e2 100644
--- a/sw/source/ui/vba/vbadocument.cxx
+++ b/sw/source/ui/vba/vbadocument.cxx
@@ -561,7 +561,7 @@ SwVbaDocument::GetConnectionPoint()
 // XSinkCaller
 
 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)
     {
diff --git a/sw/source/ui/vba/vbadocument.hxx b/sw/source/ui/vba/vbadocument.hxx
index 61ce2a7ab8bd..7cbc63773319 100644
--- a/sw/source/ui/vba/vbadocument.hxx
+++ b/sw/source/ui/vba/vbadocument.hxx
@@ -106,7 +106,7 @@ public:
     virtual css::uno::Sequence<OUString> getServiceNames() override;
 
     // 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
 
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx
index d5503f78ff77..fadf271a19c3 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -1383,7 +1383,7 @@ void SwDocShell::RegisterAutomationDocumentEventsCaller(css::uno::Reference< ooo
     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())
         mxAutomationDocumentEventsCaller->CallSinks(Method, Arguments);
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index 91c86d8c74ff..d369e459d9e8 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -255,7 +255,10 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
         lcl_processCompatibleSfxHint( xVbaEvents, rHint );
 
     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;
     auto pEventHint = dynamic_cast<const SfxEventHint*>(&rHint);
diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx
index e82aa7f25eb1..4209f7dba0a9 100644
--- a/sw/source/uibase/app/swmodule.cxx
+++ b/sw/source/uibase/app/swmodule.cxx
@@ -221,7 +221,8 @@ uno::Reference< linguistic2::XLanguageGuessing > const & SwModule::GetLanguageGu
 
 SwModule::~SwModule()
 {
-    CallAutomationApplicationEventSinks( "Quit", css::uno::Sequence< css::uno::Any >() );
+    css::uno::Sequence< css::uno::Any > aArgs;
+    CallAutomationApplicationEventSinks( "Quit", aArgs );
     delete m_pErrorHandler;
     EndListening( *SfxGetpApp() );
 }
@@ -441,7 +442,7 @@ void SwModule::RegisterAutomationApplicationEventsCaller(css::uno::Reference< oo
     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())
         mxAutomationApplicationEventsCaller->CallSinks(Method, Arguments);
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 08c3ea0cac4e..4b02af2c5ded 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -629,7 +629,8 @@ void SwXTextDocument::dispose()
 
 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;
     if(IsValid() && m_pHiddenViewFrame)
         lcl_DisposeView( m_pHiddenViewFrame, pDocShell);


More information about the Libreoffice-commits mailing list