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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Jan 21 09:40:37 UTC 2019


 oovbaapi/ooo/vba/word/XApplication.idl |    1 
 oovbaapi/ooo/vba/word/XDocuments.idl   |    2 
 oovbaapi/ooo/vba/word/XWordBasic.idl   |    2 
 sw/source/ui/vba/vbaapplication.cxx    |   72 ++++++++++++++++++++++++++++++++-
 sw/source/ui/vba/vbaapplication.hxx    |    2 
 sw/source/ui/vba/vbadocuments.cxx      |    7 +++
 sw/source/ui/vba/vbadocuments.hxx      |    1 
 sw/source/ui/vba/vbawindow.cxx         |    2 
 8 files changed, 87 insertions(+), 2 deletions(-)

New commits:
commit 7b4784ea84ba900c08ca11e1c253fcdd559de6ad
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Fri Jan 18 18:39:31 2019 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Mon Jan 21 11:29:33 2019 +0200

    Add a (dummy) WordBasic.FileSave()
    
    Change-Id: I021d63c9d57f1e0435bcc5f97abc57bc39fece01

diff --git a/oovbaapi/ooo/vba/word/XWordBasic.idl b/oovbaapi/ooo/vba/word/XWordBasic.idl
index 3d9454b812b7..320787361ca9 100644
--- a/oovbaapi/ooo/vba/word/XWordBasic.idl
+++ b/oovbaapi/ooo/vba/word/XWordBasic.idl
@@ -17,6 +17,7 @@ interface XWordBasic
     [attribute] long MailMergeMainDocumentType;
 
     void FileOpen( [in] string Name, [in] any ConfirmConversions, [in] any ReadOnly, [in] any AddToMru, [in] any PasswordDoc, [in] any PasswordDot, [in] any Revert, [in] any WritePasswordDoc, [in] any WritePasswordDot );
+    void FileSave();
     void ToolsOptionsView( [in] any Whatever1, [in] any Whatever2, [in] any Whatever3, [in] any Whatever4, [in] any Whatever5, [in] any Whatever6, [in] any Whatever7, [in] any Whatever8, [in] any Whatever9, [in] any Whatever10, [in] any Whatever11, [in] any Whatever12, [in] any Whatever13, [in] any Whatever14, [in] any Whatever15, [in] any Whatever16, [in] any Whatever17, [in] any Whatever18, [in] any Whatever19, [in] any Whatever20 );
     string WindowName();
     boolean ExistingBookmark( [in] string Name );
diff --git a/sw/source/ui/vba/vbaapplication.cxx b/sw/source/ui/vba/vbaapplication.cxx
index aa86e7a7fbc6..3a0b6042cda7 100644
--- a/sw/source/ui/vba/vbaapplication.cxx
+++ b/sw/source/ui/vba/vbaapplication.cxx
@@ -76,6 +76,7 @@ public:
     virtual void SAL_CALL setMailMergeMainDocumentType( sal_Int32 _mailmergemaindocumenttype ) override;
 
     virtual void SAL_CALL FileOpen( const OUString& Name, const uno::Any& ConfirmConversions, const uno::Any& ReadOnly, const uno::Any& AddToMru, const uno::Any& PasswordDoc, const uno::Any& PasswordDot, const uno::Any& Revert, const uno::Any& WritePasswordDoc, const uno::Any& WritePasswordDot ) override;
+    virtual void SAL_CALL FileSave() override;
     virtual void SAL_CALL ToolsOptionsView( const css::uno::Any& Whatever1,
                                             const css::uno::Any& Whatever2,
                                             const css::uno::Any& Whatever3,
@@ -531,6 +532,12 @@ SwWordBasic::FileOpen( const OUString& Name, const uno::Any& ConfirmConversions,
 }
 
 void SAL_CALL
+SwWordBasic::FileSave()
+{
+    // FIXME save it
+}
+
+void SAL_CALL
 SwWordBasic::ToolsOptionsView( const css::uno::Any& /*Whatever1*/,
                                const css::uno::Any& /*Whatever2*/,
                                const css::uno::Any& /*Whatever3*/,
commit b4ab7b86b27d83ee20087bd33adbf28db6c31b12
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Fri Jan 18 18:38:59 2019 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Mon Jan 21 11:29:19 2019 +0200

    Add TODO FIXME
    
    Change-Id: I1492c604ac39ce72fe2cfe8804ac15e8c41b9a46

diff --git a/sw/source/ui/vba/vbadocuments.cxx b/sw/source/ui/vba/vbadocuments.cxx
index 980406c88d23..bdf0f45e3722 100644
--- a/sw/source/ui/vba/vbadocuments.cxx
+++ b/sw/source/ui/vba/vbadocuments.cxx
@@ -106,6 +106,7 @@ SwVbaDocuments::Add( const uno::Any& Template, const uno::Any& /*NewTemplate*/,
 }
 
 // #TODO# #FIXME# can any of the unused params below be used?
+// #TODO# #FIXME# surely we should actually close the document here
 void SAL_CALL
 SwVbaDocuments::Close( const uno::Any& /*SaveChanges*/, const uno::Any& /*OriginalFormat*/, const uno::Any& /*RouteDocument*/ )
 {
commit 712acb2a1d49e4ed3dccd34f5e6bc35ac735ce31
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Fri Jan 18 16:59:51 2019 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Mon Jan 21 11:28:46 2019 +0200

    Add a dummy WordBasic.ToolsOptionsView
    
    Does nothing. Needed for customer application to proceed. Once we are
    further along in getting it to work, we can investigate what the
    parameters passed to this ToolsOptionsView method actually are. (This
    WordBasic thing is something that has been deprecated since last
    century, I suspect, so no wonder it is hard to find authoritative
    documentation on it.)
    
    Change-Id: I62a6d6d9abb9364afca110570fa341a2375a77a6

diff --git a/oovbaapi/ooo/vba/word/XWordBasic.idl b/oovbaapi/ooo/vba/word/XWordBasic.idl
index 769d8aad3faf..3d9454b812b7 100644
--- a/oovbaapi/ooo/vba/word/XWordBasic.idl
+++ b/oovbaapi/ooo/vba/word/XWordBasic.idl
@@ -17,6 +17,7 @@ interface XWordBasic
     [attribute] long MailMergeMainDocumentType;
 
     void FileOpen( [in] string Name, [in] any ConfirmConversions, [in] any ReadOnly, [in] any AddToMru, [in] any PasswordDoc, [in] any PasswordDot, [in] any Revert, [in] any WritePasswordDoc, [in] any WritePasswordDot );
+    void ToolsOptionsView( [in] any Whatever1, [in] any Whatever2, [in] any Whatever3, [in] any Whatever4, [in] any Whatever5, [in] any Whatever6, [in] any Whatever7, [in] any Whatever8, [in] any Whatever9, [in] any Whatever10, [in] any Whatever11, [in] any Whatever12, [in] any Whatever13, [in] any Whatever14, [in] any Whatever15, [in] any Whatever16, [in] any Whatever17, [in] any Whatever18, [in] any Whatever19, [in] any Whatever20 );
     string WindowName();
     boolean ExistingBookmark( [in] string Name );
     void MailMergeOpenDataSource( [in] string Name,
diff --git a/sw/source/ui/vba/vbaapplication.cxx b/sw/source/ui/vba/vbaapplication.cxx
index 9c7937c4ee62..aa86e7a7fbc6 100644
--- a/sw/source/ui/vba/vbaapplication.cxx
+++ b/sw/source/ui/vba/vbaapplication.cxx
@@ -76,6 +76,26 @@ public:
     virtual void SAL_CALL setMailMergeMainDocumentType( sal_Int32 _mailmergemaindocumenttype ) override;
 
     virtual void SAL_CALL FileOpen( const OUString& Name, const uno::Any& ConfirmConversions, const uno::Any& ReadOnly, const uno::Any& AddToMru, const uno::Any& PasswordDoc, const uno::Any& PasswordDot, const uno::Any& Revert, const uno::Any& WritePasswordDoc, const uno::Any& WritePasswordDot ) override;
+    virtual void SAL_CALL ToolsOptionsView( const css::uno::Any& Whatever1,
+                                            const css::uno::Any& Whatever2,
+                                            const css::uno::Any& Whatever3,
+                                            const css::uno::Any& Whatever4,
+                                            const css::uno::Any& Whatever5,
+                                            const css::uno::Any& Whatever6,
+                                            const css::uno::Any& Whatever7,
+                                            const css::uno::Any& Whatever8,
+                                            const css::uno::Any& Whatever9,
+                                            const css::uno::Any& Whatever10,
+                                            const css::uno::Any& Whatever11,
+                                            const css::uno::Any& Whatever12,
+                                            const css::uno::Any& Whatever13,
+                                            const css::uno::Any& Whatever14,
+                                            const css::uno::Any& Whatever15,
+                                            const css::uno::Any& Whatever16,
+                                            const css::uno::Any& Whatever17,
+                                            const css::uno::Any& Whatever18,
+                                            const css::uno::Any& Whatever19,
+                                            const css::uno::Any& Whatever20 ) override;
     virtual OUString SAL_CALL WindowName() override;
     virtual sal_Bool SAL_CALL ExistingBookmark( const OUString& Name ) override;
     virtual void SAL_CALL MailMergeOpenDataSource(const OUString& Name, const css::uno::Any& Format,
@@ -510,6 +530,31 @@ SwWordBasic::FileOpen( const OUString& Name, const uno::Any& ConfirmConversions,
         rDocuments->Open( Name, ConfirmConversions, ReadOnly, AddToMru, PasswordDoc, PasswordDot, Revert, WritePasswordDoc, WritePasswordDot, uno::Any(), uno::Any(), uno::Any(), uno::Any(), uno::Any(), uno::Any(), uno::Any() );
 }
 
+void SAL_CALL
+SwWordBasic::ToolsOptionsView( const css::uno::Any& /*Whatever1*/,
+                               const css::uno::Any& /*Whatever2*/,
+                               const css::uno::Any& /*Whatever3*/,
+                               const css::uno::Any& /*Whatever4*/,
+                               const css::uno::Any& /*Whatever5*/,
+                               const css::uno::Any& /*Whatever6*/,
+                               const css::uno::Any& /*Whatever7*/,
+                               const css::uno::Any& /*Whatever8*/,
+                               const css::uno::Any& /*Whatever9*/,
+                               const css::uno::Any& /*Whatever10*/,
+                               const css::uno::Any& /*Whatever11*/,
+                               const css::uno::Any& /*Whatever12*/,
+                               const css::uno::Any& /*Whatever13*/,
+                               const css::uno::Any& /*Whatever14*/,
+                               const css::uno::Any& /*Whatever15*/,
+                               const css::uno::Any& /*Whatever16*/,
+                               const css::uno::Any& /*Whatever17*/,
+                               const css::uno::Any& /*Whatever18*/,
+                               const css::uno::Any& /*Whatever19*/,
+                               const css::uno::Any& /*Whatever20*/)
+{
+    // ???
+}
+
 OUString SAL_CALL
 SwWordBasic::WindowName()
 {
commit 87b6dac1581cf224f67e86a048deef5fed2e72f9
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Fri Jan 18 14:49:24 2019 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Mon Jan 21 11:28:29 2019 +0200

    Try ignoring RuntimeException in ComḿandBars(), VB6 clients don't like them?
    
    Change-Id: Ia577174fac926295db439349f6caca178b363ba0

diff --git a/sw/source/ui/vba/vbaapplication.cxx b/sw/source/ui/vba/vbaapplication.cxx
index b9c8bd5f4055..9c7937c4ee62 100644
--- a/sw/source/ui/vba/vbaapplication.cxx
+++ b/sw/source/ui/vba/vbaapplication.cxx
@@ -167,7 +167,14 @@ SwVbaApplication::getOptions()
 uno::Any SAL_CALL
 SwVbaApplication::CommandBars( const uno::Any& aIndex )
 {
-    return VbaApplicationBase::CommandBars( aIndex );
+    try
+    {
+        return VbaApplicationBase::CommandBars( aIndex );
+    }
+    catch (const uno::RuntimeException&)
+    {
+        return uno::Any();
+    }
 }
 
 uno::Reference< word::XSelection > SAL_CALL
commit a3b143079f58be23eaccccd2fff31bc402c67201
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Fri Jan 18 14:17:50 2019 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Mon Jan 21 11:28:10 2019 +0200

    Don't throw an exception, just ignore trying to set an unhandled WindowState
    
    End-user VB6 applications might not like the exception. Better to just
    ignore.
    
    Change-Id: I42718de7855079e38c7983db39180c184ab7224f

diff --git a/sw/source/ui/vba/vbawindow.cxx b/sw/source/ui/vba/vbawindow.cxx
index fc914cc5769b..b958655fafc0 100644
--- a/sw/source/ui/vba/vbawindow.cxx
+++ b/sw/source/ui/vba/vbawindow.cxx
@@ -109,7 +109,7 @@ SwVbaWindow::setWindowState( const uno::Any& _windowstate )
         else if (nwindowState == word::WdWindowState::wdWindowStateNormal)
             pWork -> Restore();
         else
-            throw uno::RuntimeException("Invalid Parameter" );
+            SAL_WARN("sw.vba", "Unhandled window state " << nwindowState);
     }
 }
 
commit de0105a3093beca09830188623c9c54c8095b2c6
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Fri Jan 18 14:14:37 2019 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Mon Jan 21 11:27:29 2019 +0200

    Add Documents.OpenOld() method and Application.CustomizationContext property
    
    OpenOld() just forwards to the regular Open(), passing empty extra
    parameters. CustomizationContext is fully dummy for now.
    
    Change-Id: I167494700853768d971fe16afea35e90a647a00e

diff --git a/oovbaapi/ooo/vba/word/XApplication.idl b/oovbaapi/ooo/vba/word/XApplication.idl
index d061586b8de1..76d8a326c806 100644
--- a/oovbaapi/ooo/vba/word/XApplication.idl
+++ b/oovbaapi/ooo/vba/word/XApplication.idl
@@ -50,6 +50,7 @@ interface XApplication : XConnectable
     // Actually write-only but there is no way to say that in UNO IDL.
     // The getter just returns an empty string.
     [attribute] string StatusBar;
+    [attribute] any CustomizationContext;
 
     any CommandBars( [in] any Index );
     any Documents( [in] any Index );
diff --git a/oovbaapi/ooo/vba/word/XDocuments.idl b/oovbaapi/ooo/vba/word/XDocuments.idl
index a9b6cdac8056..79517c53576f 100644
--- a/oovbaapi/ooo/vba/word/XDocuments.idl
+++ b/oovbaapi/ooo/vba/word/XDocuments.idl
@@ -32,6 +32,8 @@ interface XDocuments : com::sun::star::uno::XInterface
 
     any OpenNoRepairDialog([in] string Filename, [in] any ConfirmConversions, [in] any ReadOnly, [in] any AddToRecentFiles, [in] any PasswordDocument, [in] any PasswordTemplate, [in] any Revert, [in] any WritePasswordDocument, [in] any WritePasswordTemplate, [in] any Format, [in] any Encoding, [in] any Visible, [in] any OpenAndRepair, [in] any DocumentDirection, [in] any NoEncodingDialog, [in] any XMLTransform);
 
+    any OpenOld([in] string FileName, [in] any ConfirmConversions, [in] any ReadOnly, [in] any AddToRecentFiles, [in] any PasswordDocument, [in] any PasswordTemplate, [in] any Revert, [in] any WritePasswordDocument, [in] any WritePasswordTemplate, [in] any Format);
+
     void Close([in] any SaveChanges,[in] any OriginalFormat,[in] any RouteDocument);
 };
 
diff --git a/sw/source/ui/vba/vbaapplication.cxx b/sw/source/ui/vba/vbaapplication.cxx
index 578a2b3d6c35..b9c8bd5f4055 100644
--- a/sw/source/ui/vba/vbaapplication.cxx
+++ b/sw/source/ui/vba/vbaapplication.cxx
@@ -319,6 +319,17 @@ OUString SAL_CALL SwVbaApplication::getStatusBar()
     return OUString("");
 }
 
+uno::Any SAL_CALL SwVbaApplication::getCustomizationContext()
+{
+    return uno::Any(); // ???
+}
+
+void SAL_CALL SwVbaApplication::setCustomizationContext( const uno::Any& _customizationcontext )
+{
+    (void) _customizationcontext;
+    // ???
+}
+
 void SAL_CALL SwVbaApplication::setStatusBar( const OUString& _statusbar )
 {
     // ScVbaAppSettings::setStatusBar() also uses the XStatusIndicator to show this, so maybe that is OK?
diff --git a/sw/source/ui/vba/vbaapplication.hxx b/sw/source/ui/vba/vbaapplication.hxx
index 96b4be10100f..b32a372749cd 100644
--- a/sw/source/ui/vba/vbaapplication.hxx
+++ b/sw/source/ui/vba/vbaapplication.hxx
@@ -89,6 +89,8 @@ public:
     virtual void SAL_CALL setTop( sal_Int32 _top ) override;
     virtual OUString SAL_CALL getStatusBar() override;
     virtual void SAL_CALL setStatusBar( const OUString& _statusbar ) override;
+    virtual css::uno::Any SAL_CALL getCustomizationContext() override;
+    virtual void SAL_CALL setCustomizationContext( const css::uno::Any& _customizationcontext ) override;
     virtual float SAL_CALL CentimetersToPoints( float Centimeters ) override;
     virtual void SAL_CALL ShowMe() override;
     virtual void SAL_CALL Resize( sal_Int32 Width, sal_Int32 Height ) override;
diff --git a/sw/source/ui/vba/vbadocuments.cxx b/sw/source/ui/vba/vbadocuments.cxx
index 4424a890cdfd..980406c88d23 100644
--- a/sw/source/ui/vba/vbadocuments.cxx
+++ b/sw/source/ui/vba/vbadocuments.cxx
@@ -141,6 +141,12 @@ SwVbaDocuments::OpenNoRepairDialog( const OUString& Filename, const uno::Any& Co
     return Open( Filename, ConfirmConversions, ReadOnly, AddToRecentFiles, PasswordDocument, PasswordTemplate, Revert, WritePasswordDocument, WritePasswordTemplate, Format, Encoding, Visible, OpenAndRepair, DocumentDirection, NoEncodingDialog, XMLTransform );
 }
 
+uno::Any SAL_CALL
+SwVbaDocuments::OpenOld( const OUString& FileName, const uno::Any& ConfirmConversions, const uno::Any& ReadOnly, const uno::Any& AddToRecentFiles, const uno::Any& PasswordDocument, const uno::Any& PasswordTemplate, const uno::Any& Revert, const uno::Any& WritePasswordDocument, const uno::Any& WritePasswordTemplate, const uno::Any& Format )
+{
+    return Open( FileName, ConfirmConversions, ReadOnly, AddToRecentFiles, PasswordDocument, PasswordTemplate, Revert, WritePasswordDocument, WritePasswordTemplate, Format, uno::Any(), uno::Any(), uno::Any(), uno::Any(), uno::Any(), uno::Any() );
+}
+
 OUString
 SwVbaDocuments::getServiceImplName()
 {
diff --git a/sw/source/ui/vba/vbadocuments.hxx b/sw/source/ui/vba/vbadocuments.hxx
index 45dcfab61b88..d72b1a168486 100644
--- a/sw/source/ui/vba/vbadocuments.hxx
+++ b/sw/source/ui/vba/vbadocuments.hxx
@@ -46,6 +46,7 @@ public:
     virtual css::uno::Any SAL_CALL Add( const css::uno::Any& Template, const css::uno::Any& NewTemplate, const css::uno::Any& DocumentType, const css::uno::Any& Visible ) override;
     virtual css::uno::Any SAL_CALL Open( const OUString& Filename, const css::uno::Any& ConfirmConversions, const css::uno::Any& ReadOnly, const css::uno::Any& AddToRecentFiles, const css::uno::Any& PasswordDocument, const css::uno::Any& PasswordTemplate, const css::uno::Any& Revert, const css::uno::Any& WritePasswordDocument, const css::uno::Any& WritePasswordTemplate, const css::uno::Any& Format, const css::uno::Any& Encoding, const css::uno::Any& Visible, const css::uno::Any& OpenAndRepair, const css::uno::Any& DocumentDirection, const css::uno::Any& NoEncodingDialog, const css::uno::Any& XMLTransform ) override;
     virtual css::uno::Any SAL_CALL OpenNoRepairDialog( const OUString& Filename, const css::uno::Any& ConfirmConversions, const css::uno::Any& ReadOnly, const css::uno::Any& AddToRecentFiles, const css::uno::Any& PasswordDocument, const css::uno::Any& PasswordTemplate, const css::uno::Any& Revert, const css::uno::Any& WritePasswordDocument, const css::uno::Any& WritePasswordTemplate, const css::uno::Any& Format, const css::uno::Any& Encoding, const css::uno::Any& Visible, const css::uno::Any& OpenAndRepair, const css::uno::Any& DocumentDirection, const css::uno::Any& NoEncodingDialog, const css::uno::Any& XMLTransform ) override;
+    virtual css::uno::Any SAL_CALL OpenOld( const OUString& FileName, const css::uno::Any& ConfirmConversions, const css::uno::Any& ReadOnly, const css::uno::Any& AddToRecentFiles, const css::uno::Any& PasswordDocument, const css::uno::Any& PasswordTemplate, const css::uno::Any& Revert, const css::uno::Any& WritePasswordDocument, const css::uno::Any& WritePasswordTemplate, const css::uno::Any& Format ) override;
     virtual void SAL_CALL Close( const css::uno::Any& SaveChanges, const css::uno::Any& OriginalFormat, const css::uno::Any& RouteDocument ) override;
 };
 


More information about the Libreoffice-commits mailing list