[Libreoffice-commits] core.git: 2 commits - oovbaapi/ooo sw/source
Tor Lillqvist
tml at collabora.com
Thu May 31 11:10:35 UTC 2018
oovbaapi/ooo/vba/word/XDocuments.idl | 8 +++-----
sw/source/ui/vba/vbadocument.cxx | 1 +
sw/source/ui/vba/vbadocuments.cxx | 6 ++++++
sw/source/ui/vba/vbadocuments.hxx | 1 +
sw/source/uibase/app/docsh2.cxx | 16 ++++++++++++++--
5 files changed, 25 insertions(+), 7 deletions(-)
New commits:
commit fd01684f639fc7d47215ba8dfa334b876e19de12
Author: Tor Lillqvist <tml at collabora.com>
Date: Mon Apr 9 17:19:27 2018 +0300
Add ooo::vba::word::XDocuments::OpenNoRepairDialog()
Just call Open() with the same parameters. (Most of which are
cheerfully ignored.)
Change-Id: Ia9b980bf870bac04fab7e23843d29f66d5859037
diff --git a/oovbaapi/ooo/vba/word/XDocuments.idl b/oovbaapi/ooo/vba/word/XDocuments.idl
index c51a34fb6175..a9b6cdac8056 100644
--- a/oovbaapi/ooo/vba/word/XDocuments.idl
+++ b/oovbaapi/ooo/vba/word/XDocuments.idl
@@ -22,18 +22,16 @@
#include <com/sun/star/uno/XInterface.idl>
#include <ooo/vba/XCollection.idl>
-
-
-
module ooo { module vba { module word {
-
-
interface XDocuments : com::sun::star::uno::XInterface
{
any Add([in] any Template, [in] any NewTemplate, [in] any DocumentType, [in] any Visible);
+
any Open([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 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);
+
void Close([in] any SaveChanges,[in] any OriginalFormat,[in] any RouteDocument);
};
diff --git a/sw/source/ui/vba/vbadocuments.cxx b/sw/source/ui/vba/vbadocuments.cxx
index a12d5c91dc75..7cada2510f34 100644
--- a/sw/source/ui/vba/vbadocuments.cxx
+++ b/sw/source/ui/vba/vbadocuments.cxx
@@ -138,6 +138,12 @@ SwVbaDocuments::Open( const OUString& Filename, const uno::Any& /*ConfirmConvers
return aRet;
}
+uno::Any SAL_CALL
+SwVbaDocuments::OpenNoRepairDialog( 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, const uno::Any& Encoding, const uno::Any& Visible, const uno::Any& OpenAndRepair, const uno::Any& DocumentDirection, const uno::Any& NoEncodingDialog, const uno::Any& XMLTransform )
+{
+ return Open( Filename, ConfirmConversions, ReadOnly, AddToRecentFiles, PasswordDocument, PasswordTemplate, Revert, WritePasswordDocument, WritePasswordTemplate, Format, Encoding, Visible, OpenAndRepair, DocumentDirection, NoEncodingDialog, XMLTransform );
+}
+
OUString
SwVbaDocuments::getServiceImplName()
{
diff --git a/sw/source/ui/vba/vbadocuments.hxx b/sw/source/ui/vba/vbadocuments.hxx
index ccf3a4d9b938..45dcfab61b88 100644
--- a/sw/source/ui/vba/vbadocuments.hxx
+++ b/sw/source/ui/vba/vbadocuments.hxx
@@ -45,6 +45,7 @@ public:
// Methods
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 void SAL_CALL Close( const css::uno::Any& SaveChanges, const css::uno::Any& OriginalFormat, const css::uno::Any& RouteDocument ) override;
};
commit 48ba5b970b8c0f100dbc79274f5b17113e5b7fd2
Author: Tor Lillqvist <tml at collabora.com>
Date: Mon Apr 9 16:35:45 2018 +0300
Fire the DocumentBeforeClose event (call the callback)
Change-Id: I9c7a17aa9bdbbba29cd12a0e3d09c9047e9b5678
diff --git a/sw/source/ui/vba/vbadocument.cxx b/sw/source/ui/vba/vbadocument.cxx
index b2413cb178e2..9a1fcf39ae9a 100644
--- a/sw/source/ui/vba/vbadocument.cxx
+++ b/sw/source/ui/vba/vbadocument.cxx
@@ -88,6 +88,7 @@ SwVbaDocument::~SwVbaDocument()
void SwVbaDocument::Initialize()
{
mxTextDocument.set( getModel(), uno::UNO_QUERY_THROW );
+ word::getDocShell( mxModel )->RegisterAutomationDocumentObject( this );
}
sal_uInt32
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index d369e459d9e8..22696b2af35f 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -335,13 +335,25 @@ bool SwDocShell::PrepareClose( bool bUI )
if (m_xDoc && IsInPrepareClose())
{
+ uno::Any aDocument;
+ aDocument <<= mxAutomationDocumentObject;
+
+ uno::Sequence< uno::Any > aArgs(2);
+ aArgs[0] = aDocument;
+ // FIXME: This should be an out argument, hmm?
+ aArgs[1] <<= false;
+
+ SW_MOD()->CallAutomationApplicationEventSinks( "DocumentBeforeClose", aArgs );
+
+ // FIXME: Do something based on what value the callback set the second argument to
+
uno::Reference< script::vba::XVBAEventProcessor > const xVbaEvents =
m_xDoc->GetVbaEventProcessor();
if( xVbaEvents.is() )
{
using namespace com::sun::star::script::vba::VBAEventId;
- uno::Sequence< uno::Any > aArgs;
- xVbaEvents->processVbaEvent( DOCUMENT_CLOSE, aArgs );
+ uno::Sequence< uno::Any > aNoArgs;
+ xVbaEvents->processVbaEvent( DOCUMENT_CLOSE, aNoArgs );
}
}
return bRet;
More information about the Libreoffice-commits
mailing list