diff options
author | Duncan Foster <dfoster@openoffice.org> | 2003-06-13 14:48:12 +0000 |
---|---|---|
committer | Duncan Foster <dfoster@openoffice.org> | 2003-06-13 14:48:12 +0000 |
commit | 6c20a79daaf4e1afb6b89ab3bc5203e337f75937 (patch) | |
tree | 4d88f8b58a8964afc6f57f31561ce2e834c42315 /scripting/workben/bindings | |
parent | 09e6cd2edc5b561346944b495892b85ea121ab9c (diff) |
#i15552# cannot unassign script to event
Added function with errorhandler to check if scriptProps is ok.
Diffstat (limited to 'scripting/workben/bindings')
-rw-r--r-- | scripting/workben/bindings/ScriptBinding.xba | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/scripting/workben/bindings/ScriptBinding.xba b/scripting/workben/bindings/ScriptBinding.xba index 9e2a376c20f2..78c6557d456b 100644 --- a/scripting/workben/bindings/ScriptBinding.xba +++ b/scripting/workben/bindings/ScriptBinding.xba @@ -597,6 +597,16 @@ sub evaluateForEvent( xmlline as string, lineCount as integer ) next n end sub +function isOKscriptProps( eventName as string ) + On Error Goto ErrorHandler + scriptProps = ThisComponent.getEvents().getByName( eventName ) + test = ubound( scriptProps ) + isOKscriptProps = true + exit function + + ErrorHandler: + isOKscriptProps = false +end function sub ReadEventsFromDoc() On Error Goto ErrorHandler @@ -604,15 +614,17 @@ sub ReadEventsFromDoc() eventSupplier = ThisComponent for n = 0 to ubound( allEventTypes() ) scriptProps = eventSupplier.getEvents().getByName( allEventTypes( n ).Name ) - if ( ubound( scriptProps ) > 0 ) then - if ( scriptProps(0).Value = "Script" ) then - 'Script binding - allEventTypesDoc(n).Name = scriptProps(1).Value - allEventTypesDoc(n).value = 2 - elseif( scriptProps(0).Value = "StarBasic" ) then - 'StarBasic macro - allEventTypesDoc(n).Name = "Allocated to Office function" - allEventTypesDoc(n).value = 1 + if (isOKscriptProps(allEventTypes( n ).Name)) then + if ( ubound( scriptProps ) > 0 ) then + if ( scriptProps(0).Value = "Script" ) then + 'Script binding + allEventTypesDoc(n).Name = scriptProps(1).Value + allEventTypesDoc(n).value = 2 + elseif( scriptProps(0).Value = "StarBasic" ) then + 'StarBasic macro + allEventTypesDoc(n).Name = "Allocated to Office function" + allEventTypesDoc(n).value = 1 + end if end if end if next n |