using ::com::sun::star::uno::Any; using ::com::sun::star::beans::PropertyValue; using ::com::sun::star::container::NoSuchElementException; using ::com::sun::star::lang::IllegalArgumentException; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Type;
DocumentEventsData::iterator elementPos = mrEventsData.find( Name ); if ( elementPos == mrEventsData.end() ) throw NoSuchElementException( Name, *this );
Sequence< PropertyValue > aEventDescriptor; if ( Element.hasValue() && !( Element >>= aEventDescriptor ) ) throw IllegalArgumentException( Element.getValueTypeName(), *this, 2 );
// Weird enough, the event assignment UI has (well: had) the idea of using an empty "EventType"/"Script" // to indicate the event descriptor should be reset, instead of just passing an empty event descriptor.
::comphelper::NamedValueCollection aCheck( aEventDescriptor ); if ( aCheck.has( u"EventType"_ustr ) )
{
OUString sEventType = aCheck.getOrDefault( u"EventType"_ustr, OUString() );
OSL_ENSURE( !sEventType.isEmpty(), "DocumentEvents::replaceByName: doing a reset via an empty EventType is weird!" ); if ( sEventType.isEmpty() )
aEventDescriptor.realloc( 0 );
} if ( aCheck.has( u"Script"_ustr ) )
{
OUString sScript = aCheck.getOrDefault( u"Script"_ustr, OUString() );
OSL_ENSURE( !sScript.isEmpty(), "DocumentEvents::replaceByName: doing a reset via an empty Script is weird!" ); if ( sScript.isEmpty() )
aEventDescriptor.realloc( 0 );
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.