39 for (
const auto& rEvent : _rEvents)
42 OUString
sName = rEvent.ListenerType
48 sLocalMacroName = rEvent.ScriptCode;
52 sal_Int32 nPrefixLen = sLocalMacroName.indexOf(
':' );
53 SAL_WARN_IF( 0 > nPrefixLen,
"xmloff",
"OEventDescriptorMapper::OEventDescriptorMapper: invalid script code prefix!" );
54 if ( 0 <= nPrefixLen )
57 sLibrary = sLocalMacroName.copy( 0, nPrefixLen );
61 sLocalMacroName = sLocalMacroName.copy( nPrefixLen + 1 );
64 rMappedEvent.realloc(
sLibrary.isEmpty() ? 2 : 3 );
65 auto pMappedEvent = rMappedEvent.getArray();
68 pMappedEvent[0] = PropertyValue(
EVENT_TYPE, -1,
Any(rEvent.ScriptType), PropertyState_DIRECT_VALUE);
79 rMappedEvent = { PropertyValue(
EVENT_TYPE, -1,
Any(rEvent.ScriptType), PropertyState_DIRECT_VALUE),
81 PropertyValue(
EVENT_SCRIPTURL, -1,
Any(rEvent.ScriptCode), PropertyState_DIRECT_VALUE) };
88 throw IllegalArgumentException(
89 "replacing is not implemented for this wrapper class.", getXWeak(), 1);
94 MapString2PropertyValueSequence::const_iterator aPos =
m_aMappedEvents.find(_rName);
96 throw NoSuchElementException(
97 "There is no element named " + _rName,
100 return Any(aPos->second);
110 MapString2PropertyValueSequence::const_iterator aPos =
m_aMappedEvents.find(_rName);
116 return ::cppu::UnoType<PropertyValue>::get();
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
OEventDescriptorMapper(const css::uno::Sequence< css::script::ScriptEventDescriptor > &_rEvents)
virtual sal_Bool SAL_CALL hasElements() override
virtual css::uno::Type SAL_CALL getElementType() override
virtual sal_Bool SAL_CALL hasByName(const OUString &aName) override
MapString2PropertyValueSequence m_aMappedEvents
virtual css::uno::Any SAL_CALL getByName(const OUString &aName) override
virtual void SAL_CALL replaceByName(const OUString &aName, const css::uno::Any &aElement) override
#define SAL_WARN_IF(condition, area, stream)
css::uno::Sequence< typename M::key_type > mapKeysToSequence(M const &map)
constexpr OUStringLiteral EVENT_APPLICATION
constexpr OUStringLiteral EVENT_LIBRARY
constexpr OUStringLiteral EVENT_TYPE
constexpr OUStringLiteral EVENT_SCRIPTURL
constexpr OUStringLiteral EVENT_STAROFFICE
constexpr OUStringLiteral EVENT_LOCALMACRONAME
#define EVENT_NAME_SEPARATOR
constexpr OUStringLiteral sLibrary