fix cast to implementation objects failure from some vba objects

old calls attempting to cast to implementation objects now fail ( and crash on access ) because we now wrap some objects via a aggregation proxy. This patch fixes this
This commit is contained in:
Markus Mohrhard
2011-04-07 17:14:41 +01:00
committed by Noel Power
parent bc617d8135
commit 48b23fbd5e
7 changed files with 89 additions and 20 deletions

View File

@@ -924,8 +924,7 @@ ScVbaApplication::setIteration(sal_Bool bIteration) throw (uno::RuntimeException
uno::Reference< ooo::vba::excel::XWorkbook > xWorkbook;
uno::Any aWorkbook = xWorkbooks->Item(uno::makeAny(i), uno::Any());
aWorkbook >>= xWorkbook;
ScVbaWorkbook* pWorkbook = static_cast< ScVbaWorkbook* > ( xWorkbook.get() );
ScVbaWorkbook* pWorkbook = excel::getImplFromDocModuleWrapper<ScVbaWorkbook>( xWorkbook );
uno::Reference< frame::XModel > xModel( pWorkbook->getDocModel(), uno::UNO_QUERY_THROW );
uno::Reference< beans::XPropertySet > xPropertySet( xModel, uno::UNO_QUERY_THROW );
xPropertySet->setPropertyValue( aPropName, aIteration );