summaryrefslogtreecommitdiff
path: root/scripting/workben/bindings
diff options
context:
space:
mode:
authorDuncan Foster <dfoster@openoffice.org>2003-06-13 14:48:12 +0000
committerDuncan Foster <dfoster@openoffice.org>2003-06-13 14:48:12 +0000
commit6c20a79daaf4e1afb6b89ab3bc5203e337f75937 (patch)
tree4d88f8b58a8964afc6f57f31561ce2e834c42315 /scripting/workben/bindings
parent09e6cd2edc5b561346944b495892b85ea121ab9c (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.xba30
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 ) &gt; 0 ) then
- if ( scriptProps(0).Value = &quot;Script&quot; ) then
- &apos;Script binding
- allEventTypesDoc(n).Name = scriptProps(1).Value
- allEventTypesDoc(n).value = 2
- elseif( scriptProps(0).Value = &quot;StarBasic&quot; ) then
- &apos;StarBasic macro
- allEventTypesDoc(n).Name = &quot;Allocated to Office function&quot;
- allEventTypesDoc(n).value = 1
+ if (isOKscriptProps(allEventTypes( n ).Name)) then
+ if ( ubound( scriptProps ) &gt; 0 ) then
+ if ( scriptProps(0).Value = &quot;Script&quot; ) then
+ &apos;Script binding
+ allEventTypesDoc(n).Name = scriptProps(1).Value
+ allEventTypesDoc(n).value = 2
+ elseif( scriptProps(0).Value = &quot;StarBasic&quot; ) then
+ &apos;StarBasic macro
+ allEventTypesDoc(n).Name = &quot;Allocated to Office function&quot;
+ allEventTypesDoc(n).value = 1
+ end if
end if
end if
next n