Disable fake VBA events for the old-style form controls.

This commit is contained in:
Noel Power
2011-08-12 00:36:51 -04:00
committed by Kohei Yoshida
parent aadd740407
commit 4fae740db7
8 changed files with 40 additions and 2 deletions

View File

@@ -828,6 +828,14 @@ void OInterfaceContainer::implInsert(sal_Int32 _nIndex, const Reference< XProper
sal_Bool _bEvents, ElementDescription* _pApprovalResult, sal_Bool _bFire ) throw( IllegalArgumentException )
{
const bool bHandleEvents = _bEvents && m_xEventAttacher.is();
bool bHandleVbaEvents = false;
try
{
_rxElement->getPropertyValue(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("GenerateVbaEvents") ) ) >>= bHandleVbaEvents;
}
catch( const Exception& )
{
}
// SYNCHRONIZED ----->
::osl::ClearableMutexGuard aGuard( m_rMutex );
@@ -883,7 +891,7 @@ void OInterfaceContainer::implInsert(sal_Int32 _nIndex, const Reference< XProper
// <----- SYNCHRONIZED
// insert faked VBA events?
if ( bHandleEvents )
if ( bHandleVbaEvents )
{
Reference< XEventAttacherManager > xMgr ( pElementMetaData->xInterface, UNO_QUERY );
if ( xMgr.is() )