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

Tor Lillqvist tml at collabora.com
Thu May 31 11:20:59 UTC 2018


 extensions/source/ole/unoobjw.cxx              |    8 ++++----
 oovbaapi/ooo/vba/word/XApplicationOutgoing.idl |    4 +++-
 sw/source/uibase/app/docsh2.cxx                |   24 ++++++++++++++++++++++++
 3 files changed, 31 insertions(+), 5 deletions(-)

New commits:
commit bbe55ee8e78b2e293234ea8d2b234c4cd7091aa1
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Apr 16 18:01:03 2018 +0300

    Use correct index for incoming Arguments sequence
    
    Change-Id: I1c706a2139cb2596969c6c1d166d3f9fe9f91d39

diff --git a/extensions/source/ole/unoobjw.cxx b/extensions/source/ole/unoobjw.cxx
index 0ba804420174..f0e533a43025 100644
--- a/extensions/source/ole/unoobjw.cxx
+++ b/extensions/source/ole/unoobjw.cxx
@@ -2208,21 +2208,21 @@ Sink::Call( const OUString& Method, Sequence< Any >& Arguments )
                     case VT_BYREF|VT_I2:
                         {
                             SHORT *pI = (SHORT*)aDispParams.rgvarg[i].byref;
-                            Arguments[i] <<= (sal_Int16)*pI;
+                            Arguments[nIncomingArgIndex] <<= (sal_Int16)*pI;
                             delete pI;
                         }
                         break;
                     case VT_BYREF|VT_I4:
                         {
                             LONG *pL = (LONG*)aDispParams.rgvarg[i].byref;
-                            Arguments[i] <<= (sal_Int32)*pL;
+                            Arguments[nIncomingArgIndex] <<= (sal_Int32)*pL;
                             delete pL;
                         }
                         break;
                     case VT_BYREF|VT_BSTR:
                         {
                             BSTR *pBstr = (BSTR*)aDispParams.rgvarg[i].byref;
-                            Arguments[i] <<= OUString(o3tl::toU(*pBstr));
+                            Arguments[nIncomingArgIndex] <<= OUString(o3tl::toU(*pBstr));
                             // Undo SysAllocString() done in anyToVariant()
                             SysFreeString(*pBstr);
                             delete pBstr;
@@ -2232,7 +2232,7 @@ Sink::Call( const OUString& Method, Sequence< Any >& Arguments )
                         {
                             VARIANT_BOOL *pBool = (VARIANT_BOOL*)aDispParams.rgvarg[i].byref;
                             // SAL_ DEBUG("===> VT_BOOL: byref is now " << aDispParams.rgvarg[i].byref << ", " << (int)*pBool);
-                            Arguments[i] <<= (sal_Bool)(*pBool != VARIANT_FALSE ? sal_True : sal_False);
+                            Arguments[nIncomingArgIndex] <<= (sal_Bool)(*pBool != VARIANT_FALSE ? sal_True : sal_False);
                             delete pBool;
                         }
                         break;
commit 05101334e6d15eb77782dfc36c2065561f7e57e6
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Apr 16 17:02:25 2018 +0300

    Add DocumentOpen and NewDocument to XApplicationOutgoing and emit such
    
    Change-Id: Ia2a0ade0af45f1ba99b0cfa860bd1986edcf272e

diff --git a/oovbaapi/ooo/vba/word/XApplicationOutgoing.idl b/oovbaapi/ooo/vba/word/XApplicationOutgoing.idl
index 9b62f02ad27c..3eab2dd5a291 100644
--- a/oovbaapi/ooo/vba/word/XApplicationOutgoing.idl
+++ b/oovbaapi/ooo/vba/word/XApplicationOutgoing.idl
@@ -25,9 +25,11 @@ module ooo {  module vba {  module word {
 
 interface XApplicationOutgoing : XInterfaceWithIID
 {
-    void DocumentChange();
     void Quit();
+    void DocumentChange();
+    void DocumentOpen([in] any Document);
     void DocumentBeforeClose([in] any Document, [out] any Cancel);
+    void NewDocument([in] any Document);
 };
 
 }; }; };
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index 40d5976c64d2..2042640d66c9 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -269,6 +269,30 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
             default:
                 break;
         }
+
+        switch( pSfxEventHint->GetEventId() )
+        {
+            case SfxEventHintId::CreateDoc:
+                {
+                    uno::Any aDocument;
+                    aDocument <<= mxAutomationDocumentObject;
+                    uno::Sequence< uno::Any > aArgs(1);
+                    aArgs[0] = aDocument;
+                    SW_MOD()->CallAutomationApplicationEventSinks( "NewDocument", aArgs );
+                }
+                break;
+            case SfxEventHintId::OpenDoc:
+                {
+                    uno::Any aDocument;
+                    aDocument <<= mxAutomationDocumentObject;
+                    uno::Sequence< uno::Any > aArgs(1);
+                    aArgs[0] = aDocument;
+                    SW_MOD()->CallAutomationApplicationEventSinks( "DocumentOpen", aArgs );
+                }
+                break;
+            default:
+                break;
+        }
     }
 
     sal_uInt16 nAction = 0;


More information about the Libreoffice-commits mailing list