diff options
Diffstat (limited to 'scratch/sc-vba/vbaworkbook.cxx')
-rw-r--r-- | scratch/sc-vba/vbaworkbook.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/scratch/sc-vba/vbaworkbook.cxx b/scratch/sc-vba/vbaworkbook.cxx index 52bca1e77..07a221c8d 100644 --- a/scratch/sc-vba/vbaworkbook.cxx +++ b/scratch/sc-vba/vbaworkbook.cxx @@ -11,6 +11,7 @@ #include "vbaworksheet.hxx" #include "vbaworksheets.hxx" #include "vbaworkbook.hxx" +#include "vbawindows.hxx" #include "vbahelper.hxx" #include <stdio.h> @@ -101,7 +102,14 @@ ScVbaWorkbook::Worksheets( const uno::Any& aIndex ) throw (uno::RuntimeException } return uno::Any( xWorkSheets->Item( aIndex ) ); } - +uno::Any SAL_CALL +ScVbaWorkbook::Windows( const uno::Any& aIndex ) throw (uno::RuntimeException) +{ + uno::Reference< vba::XCollection > xWindows = ScVbaWindows::Windows( m_xContext ); + if ( aIndex.getValueTypeClass() == uno::TypeClass_VOID ) + return uno::Any( xWindows ); + return uno::Any( xWindows->Item( aIndex ) ); +} void ScVbaWorkbook::Close( const uno::Any &rSaveArg, const uno::Any &rFileArg, const uno::Any &rRouteArg ) throw (uno::RuntimeException) @@ -132,7 +140,7 @@ ScVbaWorkbook::Close( const uno::Any &rSaveArg, const uno::Any &rFileArg, else xModifiable->setModified( false ); - uno::Reference< util::XCloseable > xCloseable( getCurrentDocument(), uno::UNO_QUERY ); + uno::Reference< util::XCloseable > xCloseable( getModel(), uno::UNO_QUERY ); if( xCloseable.is() ) // use close(boolean DeliverOwnership) |