vbaapplication.cxx (cdf0e10c) vbaapplication.cxx (c83e58a0)
1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *

--- 191 unchanged lines hidden (view full) ---

200{
201 uno::Reference< script::XInvocation > xWSF( new ScVbaWSFunction( this, mxContext ) );
202 return xWSF->hasProperty( Name );
203}
204
205uno::Reference< excel::XWorkbook >
206ScVbaApplication::getActiveWorkbook() throw (uno::RuntimeException)
207{
1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *

--- 191 unchanged lines hidden (view full) ---

200{
201 uno::Reference< script::XInvocation > xWSF( new ScVbaWSFunction( this, mxContext ) );
202 return xWSF->hasProperty( Name );
203}
204
205uno::Reference< excel::XWorkbook >
206ScVbaApplication::getActiveWorkbook() throw (uno::RuntimeException)
207{
208 // will throw if active document is not in VBA compatibility mode (no object for codename)
209 return uno::Reference< excel::XWorkbook >( getVBADocument( getCurrentExcelDoc( mxContext ) ), uno::UNO_QUERY_THROW );
208 uno::Reference< frame::XModel > xModel( getCurrentExcelDoc( mxContext ), uno::UNO_SET_THROW );
209 uno::Reference< excel::XWorkbook > xWorkbook( getVBADocument( xModel ), uno::UNO_QUERY );
210 if( xWorkbook.is() ) return xWorkbook;
211 // #i116936# getVBADocument() may return null in documents without global VBA mode enabled
212 return new ScVbaWorkbook( this, mxContext, xModel );
210}
211
212uno::Reference< excel::XWorkbook > SAL_CALL
213ScVbaApplication::getThisWorkbook() throw (uno::RuntimeException)
214{
213}
214
215uno::Reference< excel::XWorkbook > SAL_CALL
216ScVbaApplication::getThisWorkbook() throw (uno::RuntimeException)
217{
215 // should never throw as this model is in VBA compatibility mode
216 return uno::Reference< excel::XWorkbook >( getVBADocument( getThisExcelDoc( mxContext ) ), uno::UNO_QUERY_THROW );
218 uno::Reference< frame::XModel > xModel( getThisExcelDoc( mxContext ), uno::UNO_SET_THROW );
219 uno::Reference< excel::XWorkbook > xWorkbook( getVBADocument( xModel ), uno::UNO_QUERY );
220 if( xWorkbook.is() ) return xWorkbook;
221 // #i116936# getVBADocument() may return null in documents without global VBA mode enabled
222 return new ScVbaWorkbook( this, mxContext, xModel );
217}
218
219uno::Reference< XAssistant > SAL_CALL
220ScVbaApplication::getAssistant() throw (uno::RuntimeException)
221{
222 return uno::Reference< XAssistant >( new ScVbaAssistant( this, mxContext ) );
223}
224

--- 968 unchanged lines hidden ---
223}
224
225uno::Reference< XAssistant > SAL_CALL
226ScVbaApplication::getAssistant() throw (uno::RuntimeException)
227{
228 return uno::Reference< XAssistant >( new ScVbaAssistant( this, mxContext ) );
229}
230

--- 968 unchanged lines hidden ---