24 #include <unonames.hxx>
36 mpDocShell->GetDocument().AddUnoObject(*
this);
50 if ( rHint.
GetId() == SfxHintId::Dying )
60 return static_cast<ScSheetEventId>(nEvent);
71 throw uno::RuntimeException();
75 throw container::NoSuchElementException();
80 *pNewEvents = *pOldEvents;
85 uno::Sequence<beans::PropertyValue> aPropSeq;
86 if ( aElement >>= aPropSeq )
88 for (
const beans::PropertyValue& rProp : std::as_const(aPropSeq))
93 if ( rProp.Value >>= aEventType )
97 throw lang::IllegalArgumentException();
101 rProp.Value >>= aScript;
105 if (!aScript.isEmpty())
106 pNewEvents->SetScript( nEvent, &aScript );
108 pNewEvents->SetScript( nEvent,
nullptr );
121 throw container::NoSuchElementException();
123 const OUString* pScript =
nullptr;
135 {
"EventType",
uno::Any( OUString(
"Script") ) },
virtual ~ScSheetEventsObj() override
void SetSheetEvents(SCTAB nTab, std::unique_ptr< ScSheetEvents > pNew)
const wchar_t *typedef int(__stdcall *DllNativeUnregProc)(int
virtual sal_Bool SAL_CALL hasElements() override
void SetDocumentModified()
virtual sal_Bool SAL_CALL hasByName(const OUString &aName) override
virtual css::uno::Type SAL_CALL getElementType() override
virtual css::uno::Any SAL_CALL getByName(const OUString &aName) override
css::uno::Sequence< css::beans::PropertyValue > InitPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
virtual void SAL_CALL replaceByName(const OUString &aName, const css::uno::Any &aElement) override
static OUString GetEventName(ScSheetEventId nEvent)
#define SC_SIMPLE_SERVICE_INFO(ClassName, ClassNameAscii, ServiceAscii)
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
const OUString * GetScript(ScSheetEventId nEvent) const
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
const ScSheetEvents * GetSheetEvents(SCTAB nTab) const
void RemoveUnoObject(SfxListener &rObject)
const ScDocument & GetDocument() const
static ScSheetEventId lcl_GetEventFromName(std::u16string_view aName)