24#include <unonames.hxx>
36 mpDocShell->GetDocument().AddUnoObject(*
this);
50 if ( rHint.
GetId() == SfxHintId::Dying )
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") ) },
147 auto pNames = aNames.getArray();
void SetDocumentModified()
const ScDocument & GetDocument() const
const ScSheetEvents * GetSheetEvents(SCTAB nTab) const
void SetSheetEvents(SCTAB nTab, std::unique_ptr< ScSheetEvents > pNew)
void RemoveUnoObject(SfxListener &rObject)
virtual css::uno::Type SAL_CALL getElementType() override
virtual sal_Bool SAL_CALL hasByName(const OUString &aName) override
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
virtual ~ScSheetEventsObj() override
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual void SAL_CALL replaceByName(const OUString &aName, const css::uno::Any &aElement) override
virtual sal_Bool SAL_CALL hasElements() override
virtual css::uno::Any SAL_CALL getByName(const OUString &aName) override
const OUString * GetScript(ScSheetEventId nEvent) const
static OUString GetEventName(ScSheetEventId nEvent)
static ScSheetEventId lcl_GetEventFromName(std::u16string_view aName)
#define SC_SIMPLE_SERVICE_INFO(ClassName, ClassNameAscii, ServiceAscii)
css::uno::Sequence< css::beans::PropertyValue > InitPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
const wchar_t *typedef int(__stdcall *DllNativeUnregProc)(int
constexpr OUStringLiteral SC_UNO_SCRIPT
constexpr OUStringLiteral SC_UNO_EVENTTYPE