diff options
author | Tomas O'Connor <toconnor@openoffice.org> | 2003-01-21 14:40:49 +0000 |
---|---|---|
committer | Tomas O'Connor <toconnor@openoffice.org> | 2003-01-21 14:40:49 +0000 |
commit | dacfe05ba0be605908350be80f1558609aa31690 (patch) | |
tree | f250a3e2f43008ecfaf924e9e7a7ed9d839da4fa /scripting/source/runtimemgr/ScriptNameResolverImpl.cxx | |
parent | 3dd0fb60bc2c8d246bcabcb063955e077c04b6b6 (diff) |
IssueZilla 10518 - Add BeanShell scripting support
Diffstat (limited to 'scripting/source/runtimemgr/ScriptNameResolverImpl.cxx')
-rw-r--r-- | scripting/source/runtimemgr/ScriptNameResolverImpl.cxx | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/scripting/source/runtimemgr/ScriptNameResolverImpl.cxx b/scripting/source/runtimemgr/ScriptNameResolverImpl.cxx index ed62cf89f7d0..f927b4bc1fab 100644 --- a/scripting/source/runtimemgr/ScriptNameResolverImpl.cxx +++ b/scripting/source/runtimemgr/ScriptNameResolverImpl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ScriptNameResolverImpl.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: dfoster $ $Date: 2002-11-06 16:26:30 $ + * last change: $Author: toconnor $ $Date: 2003-01-21 15:40:49 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -80,7 +80,7 @@ using namespace ::drafts::com::sun::star::script::framework; namespace scripting_runtimemgr { -const sal_Char* const LANGUAGE_TO_RESOLVE_ON = "Java"; // should be configurable +const sal_Char* const LANGUAGE_TO_RESOLVE_ON[] = { "Java", "BeanShell" }; // should be configurable OUString nrs_implName = OUString::createFromAscii( "drafts.com.sun.star.script.framework.DefaultScriptNameResolver" ); OUString nrs_serviceName = OUString::createFromAscii( @@ -348,11 +348,13 @@ SAL_THROW ( ( lang::IllegalArgumentException, RuntimeException ) ) // just choose first one that has language=LANGUAGE_TO_RESOLVE_ON ::rtl::OUString language( scriptInfo->getLanguage() ); - if ( ( language.compareToAscii( LANGUAGE_TO_RESOLVE_ON ) == 0 ) ) - { - OSL_TRACE( "Found desired language\n" ); - resolvedScriptInfo = scriptInfo; - break; + for ( sal_Int32 i = (sizeof LANGUAGE_TO_RESOLVE_ON / sizeof *LANGUAGE_TO_RESOLVE_ON); i--; ) { + if ( ( language.compareToAscii( LANGUAGE_TO_RESOLVE_ON[i] ) == 0 ) ) + { + OSL_TRACE( "Found desired language\n" ); + resolvedScriptInfo = scriptInfo; + break; + } } } } |