diff options
author | Mikhail Voytenko <mav@openoffice.org> | 2010-09-01 14:32:36 +0200 |
---|---|---|
committer | Mikhail Voytenko <mav@openoffice.org> | 2010-09-01 14:32:36 +0200 |
commit | ea2b13e9854aec115fe235b011f55708b948b24f (patch) | |
tree | 9074453fa9e1d83adecbea1f656aed4b963b8328 /vbahelper | |
parent | 060fad2232894bcd6a74b7daad294fd400513e09 (diff) |
mib19: #163432# on document close the control might be already removed during the call
Diffstat (limited to 'vbahelper')
-rw-r--r-- | vbahelper/source/msforms/vbauserform.cxx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/vbahelper/source/msforms/vbauserform.cxx b/vbahelper/source/msforms/vbauserform.cxx index e10c3a373f94..16bc97babd7d 100644 --- a/vbahelper/source/msforms/vbauserform.cxx +++ b/vbahelper/source/msforms/vbauserform.cxx @@ -201,11 +201,14 @@ ScVbaUserForm::getValue( const ::rtl::OUString& aPropertyName ) throw (beans::Un uno::Reference< awt::XControl > xDialogControl( m_xDialog, uno::UNO_QUERY_THROW ); uno::Reference< awt::XControlContainer > xContainer( m_xDialog, uno::UNO_QUERY_THROW ); uno::Reference< awt::XControl > xControl = xContainer->getControl( aPropertyName ); - ScVbaControlFactory aFac( mxContext, xControl, m_xModel ); - uno::Reference< msforms::XControl > xVBAControl( aFac.createControl( xDialogControl->getModel() ) ); - ScVbaControl* pControl = dynamic_cast< ScVbaControl* >( xVBAControl.get() ); - pControl->setGeometryHelper( new UserFormGeometryHelper( mxContext, xControl ) ); - aResult = uno::makeAny( xVBAControl ); + if ( xControl.is() ) + { + ScVbaControlFactory aFac( mxContext, xControl, m_xModel ); + uno::Reference< msforms::XControl > xVBAControl( aFac.createControl( xDialogControl->getModel() ) ); + ScVbaControl* pControl = dynamic_cast< ScVbaControl* >( xVBAControl.get() ); + pControl->setGeometryHelper( new UserFormGeometryHelper( mxContext, xControl ) ); + aResult = uno::makeAny( xVBAControl ); + } } return aResult; |