Kaydet (Commit) 7e2677c0 authored tarafından Michael Meeks's avatar Michael Meeks Kaydeden (comit) Kohei Yoshida

Accelerate checking for VBA macros that are not there.

üst 01ea75c0
......@@ -44,10 +44,7 @@ interface XVBAEventProcessor
@return
`TRUE`, if the VBA event handler exists.
@throws ::com::sun::star::lang::IllegalArgumentException
if the passed event identifier is not supported, or if the passed
specifier is required but invalid.
`FALSE`, for all other cases.
**/
boolean hasVbaEventHandler( [in] long nEventId, [in] sequence< any > aArgs )
raises (::com::sun::star::lang::IllegalArgumentException);
......
......@@ -51,15 +51,6 @@ VbaEventsHelperBase::~VbaEventsHelperBase()
SAL_WARN_IF( !mbDisposed, "vbahelper", "VbaEventsHelperBase::~VbaEventsHelperBase - missing disposing notification" );
}
sal_Bool SAL_CALL VbaEventsHelperBase::hasVbaEventHandler( sal_Int32 nEventId, const uno::Sequence< uno::Any >& rArgs )
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
// getEventHandlerInfo() throws, if unknown event dentifier has been passed
const EventHandlerInfo& rInfo = getEventHandlerInfo( nEventId );
// getEventHandlerPath() searches for the macro in the document
return !getEventHandlerPath( rInfo, rArgs ).isEmpty();
}
sal_Bool SAL_CALL VbaEventsHelperBase::processVbaEvent( sal_Int32 nEventId, const uno::Sequence< uno::Any >& rArgs )
throw (lang::IllegalArgumentException, util::VetoException, uno::RuntimeException)
{
......@@ -241,6 +232,16 @@ void VbaEventsHelperBase::stopListening()
mbDisposed = true;
}
sal_Bool SAL_CALL VbaEventsHelperBase::hasVbaEventHandler( sal_Int32 nEventId, const uno::Sequence< uno::Any >& rArgs )
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
EventHandlerInfoMap::const_iterator aIt = maEventInfos.find( nEventId );
if( aIt == maEventInfos.end() )
return sal_False; // throwing a lot of exceptions is slow.
else // getEventHandlerPath() searches for the macro in the document
return !getEventHandlerPath( aIt->second, rArgs ).isEmpty();
}
const VbaEventsHelperBase::EventHandlerInfo& VbaEventsHelperBase::getEventHandlerInfo(
sal_Int32 nEventId ) const throw (lang::IllegalArgumentException)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment