diff options
Diffstat (limited to 'scripting/workben/bindings')
-rw-r--r-- | scripting/workben/bindings/ScriptBinding.xba | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/scripting/workben/bindings/ScriptBinding.xba b/scripting/workben/bindings/ScriptBinding.xba index 1d507ab97f13..0082aa7d4fce 100644 --- a/scripting/workben/bindings/ScriptBinding.xba +++ b/scripting/workben/bindings/ScriptBinding.xba @@ -201,11 +201,33 @@ Sub ExecuteKeyBinding() bindingDialog.execute() end Sub + Sub initialiseNavigationComboArrays() locations = Array ( "User", "Share", "Document" ) - languages = Array( "Java", "BeanShell" ) + ReDim languages(0) as String + languages(0) = "Java" + + ' Setup languages array for all supported languages + oServiceManager = GetProcessServiceManager() + svrArray = oServiceManager.getAvailableServiceNames + + langCount = 1 + for index = 0 to ubound(svrArray) + iPos = inStr(svrArray(index), "ScriptRuntimeFor") + iJava = inStr(svrArray(index), "ScriptRuntimeForJava") + + if (iJava = 0) and (iPos > 0) then + lang = Mid(svrArray(index), iPos + Len("ScriptRuntimeFor") + + 'Add to language vector + ReDim Preserve languages(langCount) as String + languages(langCount) = lang + langCount = langCount +1 + endif + next index End Sub + Sub ExecuteEventBinding createAllEventTypes() createAllEventBindings() @@ -315,7 +337,16 @@ function GetDocumentType( bindingType as string ) as string end function function getScriptURI( selectedScript as String ) as String - 'Dim scripts() as new com.sun.star.beans.PropertyValue + combo = bindingDialog.getControl( "LocationCombo" ) + location = combo.text + if ( location = "User" ) then + location = "user" + elseif ( location = "Share" ) then + location = "share" + else + location = "document" + end if + Dim scriptInfo as Object scripts() = scriptDisplayList(0) for n = LBOUND( scripts() ) to UBOUND( scripts() ) @@ -326,7 +357,7 @@ function getScriptURI( selectedScript as String ) as String end if next n - getScriptURI() = "script://" + scriptInfo.getLogicalName + "?language=" + scriptInfo.getLanguage() + "+function=" + scriptInfo.getFunctionName() + getScriptURI() = "script://" + scriptInfo.getLogicalName + "?language=" + scriptInfo.getLanguage() + "+function=" + scriptInfo.getFunctionName() + "+location=" + location end function @@ -1667,4 +1698,4 @@ sub DeleteEvent( event as String ) disp.dispatch(url,args()) end sub -</script:module> +</script:module>
\ No newline at end of file |