diff options
author | Daniel Rentz [dr] <daniel.rentz@oracle.com> | 2010-09-13 17:47:04 +0200 |
---|---|---|
committer | Daniel Rentz [dr] <daniel.rentz@oracle.com> | 2010-09-13 17:47:04 +0200 |
commit | 7e801dd20924783ebe7f40920169179ea3b1a709 (patch) | |
tree | 7e41c810d8d2eb5d854aeae931a0282a395f4f52 | |
parent | mib19: #163583# do not reschedule in callbacks (diff) | |
download | core-7e801dd20924783ebe7f40920169179ea3b1a709.tar.gz core-7e801dd20924783ebe7f40920169179ea3b1a709.zip |
mib19: #163557# cleanup VBA XDocuments implementation, trigger Workbook_Open event when creating a new Excel workbook via Workbooks.Add
-rw-r--r-- | oovbaapi/ooo/vba/excel/XWorkbooks.idl | 2 | ||||
-rw-r--r-- | vbahelper/inc/vbahelper/vbadocumentsbase.hxx | 8 | ||||
-rw-r--r-- | vbahelper/source/vbahelper/vbadocumentsbase.cxx | 9 |
3 files changed, 8 insertions, 11 deletions
diff --git a/oovbaapi/ooo/vba/excel/XWorkbooks.idl b/oovbaapi/ooo/vba/excel/XWorkbooks.idl index 7c94ca1eac18..de7b031e3c0a 100644 --- a/oovbaapi/ooo/vba/excel/XWorkbooks.idl +++ b/oovbaapi/ooo/vba/excel/XWorkbooks.idl @@ -44,7 +44,7 @@ module ooo { module vba { module excel { interface XWorkbooks : com::sun::star::uno::XInterface { - any Add(); + any Add([in] any Template); any Open([in] string Filename, [in] any UpdateLinks, [in] any ReadOnly, [in] any Format, [in] any Password, [in] any WriteResPassword, [in] any IgnoreReadOnlyRecommended, [in] any Origin, [in] any Delimiter, [in] any Editable, [in] any Notify, [in] any Converter, [in] any AddToMru); void Close(); diff --git a/vbahelper/inc/vbahelper/vbadocumentsbase.hxx b/vbahelper/inc/vbahelper/vbadocumentsbase.hxx index 36bc0a4963ee..8e4554b74b3d 100644 --- a/vbahelper/inc/vbahelper/vbadocumentsbase.hxx +++ b/vbahelper/inc/vbahelper/vbadocumentsbase.hxx @@ -57,10 +57,10 @@ public: // VbaDocumentsBase_BASE virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ) = 0; - // XDocumentsBase - virtual css::uno::Any SAL_CALL Add() throw (css::uno::RuntimeException); - virtual void SAL_CALL Close( ) throw (css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL Open( const ::rtl::OUString& Filename, const css::uno::Any& ReadOnly, const css::uno::Sequence< css::beans::PropertyValue >& rProps ) throw (css::uno::RuntimeException); +protected: + css::uno::Any createDocument() throw (css::uno::RuntimeException); + void closeDocuments() throw (css::uno::RuntimeException); + css::uno::Any openDocument( const ::rtl::OUString& Filename, const css::uno::Any& ReadOnly, const css::uno::Sequence< css::beans::PropertyValue >& rProps ) throw (css::uno::RuntimeException); }; #endif /* SC_VBA_WORKBOOKS_HXX */ diff --git a/vbahelper/source/vbahelper/vbadocumentsbase.cxx b/vbahelper/source/vbahelper/vbadocumentsbase.cxx index e01809d5fbc3..f2b70ab231c7 100644 --- a/vbahelper/source/vbahelper/vbadocumentsbase.cxx +++ b/vbahelper/source/vbahelper/vbadocumentsbase.cxx @@ -213,8 +213,7 @@ VbaDocumentsBase::VbaDocumentsBase( const uno::Reference< XHelperInterface >& xP { } -uno::Any SAL_CALL -VbaDocumentsBase::Add() throw (uno::RuntimeException) +uno::Any VbaDocumentsBase::createDocument() throw (uno::RuntimeException) { uno::Reference< lang::XMultiComponentFactory > xSMgr( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); @@ -244,8 +243,7 @@ VbaDocumentsBase::Add() throw (uno::RuntimeException) return uno::makeAny( xComponent ); } -void -VbaDocumentsBase::Close() throw (uno::RuntimeException) +void VbaDocumentsBase::closeDocuments() throw (uno::RuntimeException) { // #FIXME this *MUST* be wrong documents::close surely closes ALL documents // in the collection, use of getCurrentDocument here is totally wrong @@ -259,8 +257,7 @@ VbaDocumentsBase::Close() throw (uno::RuntimeException) } // #TODO# #FIXME# can any of the unused params below be used? -uno::Any -VbaDocumentsBase::Open( const rtl::OUString& rFileName, const uno::Any& ReadOnly, const uno::Sequence< beans::PropertyValue >& rProps ) throw (uno::RuntimeException) +uno::Any VbaDocumentsBase::openDocument( const rtl::OUString& rFileName, const uno::Any& ReadOnly, const uno::Sequence< beans::PropertyValue >& rProps ) throw (uno::RuntimeException) { // we need to detect if this is a URL, if not then assume its a file path rtl::OUString aURL; |