summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--oovbaapi/UnoApi_oovbaapi.mk1
-rw-r--r--oovbaapi/ooo/vba/word/XApplication.idl1
-rw-r--r--oovbaapi/ooo/vba/word/XWordBasic.idl24
-rw-r--r--sw/source/ui/vba/vbaapplication.cxx38
-rw-r--r--sw/source/ui/vba/vbaapplication.hxx1
5 files changed, 65 insertions, 0 deletions
diff --git a/oovbaapi/UnoApi_oovbaapi.mk b/oovbaapi/UnoApi_oovbaapi.mk
index bb9601f8152b..421dd057a347 100644
--- a/oovbaapi/UnoApi_oovbaapi.mk
+++ b/oovbaapi/UnoApi_oovbaapi.mk
@@ -1100,6 +1100,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,oovbaapi,ooo/vba/word,\
XVariables \
XView \
XWindow \
+ XWordBasic \
XWrapFormat \
))
diff --git a/oovbaapi/ooo/vba/word/XApplication.idl b/oovbaapi/ooo/vba/word/XApplication.idl
index 4b0f4f4e9a2a..62319f63a932 100644
--- a/oovbaapi/ooo/vba/word/XApplication.idl
+++ b/oovbaapi/ooo/vba/word/XApplication.idl
@@ -32,6 +32,7 @@ interface XApplication : XConnectable
[attribute, readonly] XSystem System;
[attribute, readonly] XOptions Options;
[attribute, readonly] XSelection Selection;
+ [attribute, readonly] XWordBasic WordBasic;
[attribute] boolean DisplayAutoCompleteTips;
[attribute] long EnableCancelKey;
[attribute] long WindowState;
diff --git a/oovbaapi/ooo/vba/word/XWordBasic.idl b/oovbaapi/ooo/vba/word/XWordBasic.idl
new file mode 100644
index 000000000000..1920f20543a6
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XWordBasic.idl
@@ -0,0 +1,24 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+#ifndef __ooo_vba_word_XWordBasic_idl__
+#define __ooo_vba_word_XWordBasic_idl__
+
+module ooo { module vba { module word {
+
+interface XWordBasic
+{
+ 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 );
+};
+
+}; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaapplication.cxx b/sw/source/ui/vba/vbaapplication.cxx
index 897be10a8c11..37358d2cc51d 100644
--- a/sw/source/ui/vba/vbaapplication.cxx
+++ b/sw/source/ui/vba/vbaapplication.cxx
@@ -56,6 +56,18 @@ public:
void SAL_CALL Unadvise( sal_uInt32 Cookie ) override;
};
+class SwWordBasic : public cppu::WeakImplHelper<word::XWordBasic>
+{
+private:
+ SwVbaApplication* mpApp;
+
+public:
+ SwWordBasic( SwVbaApplication* pApp );
+
+ // XWordBasic
+ 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;
+};
+
SwVbaApplication::SwVbaApplication( uno::Reference<uno::XComponentContext >& xContext ):
SwVbaApplication_BASE( xContext )
{
@@ -138,6 +150,13 @@ SwVbaApplication::getSelection()
return new SwVbaSelection( this, mxContext, getCurrentDocument() );
}
+uno::Reference< word::XWordBasic > SAL_CALL
+SwVbaApplication::getWordBasic()
+{
+ uno::Reference< word::XWordBasic > xWB( new SwWordBasic( this ) );
+ return xWB;
+}
+
uno::Any SAL_CALL
SwVbaApplication::Documents( const uno::Any& index )
{
@@ -387,4 +406,23 @@ SwVbaApplicationOutgoingConnectionPoint::Unadvise( sal_uInt32 Cookie )
mpApp->RemoveSink( Cookie );
}
+// SwWordBasic
+
+SwWordBasic::SwWordBasic( SwVbaApplication* pApp ) :
+ mpApp(pApp)
+{
+}
+
+// XWordBasic
+void SAL_CALL
+SwWordBasic::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 )
+{
+ uno::Any aDocuments = mpApp->Documents( uno::Any() );
+
+ uno::Reference<word::XDocuments> rDocuments;
+
+ if (aDocuments >>= rDocuments)
+ 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() );
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaapplication.hxx b/sw/source/ui/vba/vbaapplication.hxx
index 101000158a4e..9cf2da2a5dd8 100644
--- a/sw/source/ui/vba/vbaapplication.hxx
+++ b/sw/source/ui/vba/vbaapplication.hxx
@@ -65,6 +65,7 @@ public:
virtual css::uno::Reference< ov::word::XWindow > SAL_CALL getActiveWindow() override;
virtual css::uno::Reference< ooo::vba::word::XOptions > SAL_CALL getOptions() override;
virtual css::uno::Reference< ooo::vba::word::XSelection > SAL_CALL getSelection() override;
+ virtual css::uno::Reference< ooo::vba::word::XWordBasic > SAL_CALL getWordBasic() override;
virtual css::uno::Any SAL_CALL CommandBars( const css::uno::Any& aIndex ) override;
virtual css::uno::Any SAL_CALL Documents( const css::uno::Any& aIndex ) override;
virtual css::uno::Any SAL_CALL Addins( const css::uno::Any& aIndex ) override;