diff options
Diffstat (limited to 'scripting/workben')
-rw-r--r-- | scripting/workben/bindings/ScriptBinding.xba | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/scripting/workben/bindings/ScriptBinding.xba b/scripting/workben/bindings/ScriptBinding.xba index 687146a72d06..c086761faf02 100644 --- a/scripting/workben/bindings/ScriptBinding.xba +++ b/scripting/workben/bindings/ScriptBinding.xba @@ -1069,21 +1069,25 @@ sub PopulateScriptList( lang as String, loc as String ) next langIndex dim locnDisplayList( length ) as new com.sun.star.beans.PropertyValue for index = lbound(filesysScripts()) to ubound(filesysScripts()) - scriptextn = filesysScripts(n) + scriptextn = filesysScripts( index ) pos = lastIndexOf( scriptextn, "." ) scriptextn = mid( scriptextn, pos + 1, len( scriptextn ) - pos ) - for extnsIndex = lbound(extns) to ubound(extns) + + for extnsIndex = lbound(extns()) to ubound(extns()) extn = extns(extnsIndex) - if ( detailedView ) and ( scriptextn = extn ) then - locnDisplayList( index ).Name = filesysScripts( index ) - locnDisplayList( index ).Value = filesysScripts( index ) - elseif ( scriptextn = extn ) then - REM replace name with simplified view - locnDisplayList( index ).Name = filesysScripts( index ) - locnDisplayList( index ).Value = filesysScripts( index ) + if ( scriptextn = extn ) then + if ( detailedView ) then + locnDisplayList( index ).Name = filesysScripts( index ) + locnDisplayList( index ).Value = filesysScripts( index ) + else + REM replace name with simplified view + locnDisplayList( index ).Name = filesysScripts( index ) + locnDisplayList( index ).Value = filesysScripts( index ) + end if + scriptList.addItem( locnDisplayList( index ).Name, index ) + exit for end if next extnsIndex - scriptList.addItem( locnDisplayList( index ).Name, index ) next index ScriptDisplayList(0) = locnDisplayList() scriptList.selectItemPos( 0, true ) @@ -1594,10 +1598,12 @@ sub MenuComboListener() end sub sub LangLocComboListener() + combo = bindingDialog.getControl( "LanguageCombo" ) language = combo.text combo = bindingDialog.getControl( "LocationCombo" ) location = combo.text + PopulateScriptList( language,location ) 'Enable/disable Assign button @@ -1899,15 +1905,21 @@ sub BrowseButton() ReDim preserve filesysScripts(filesysCount) as String filesysScripts( filesysCount ) = sFileURL filesysCount=filesysCount+1 + ' if user changed filter in file picker then populate + ' language with language associated with that in file picker sFilter = oFilePicker.getCurrentFilter() langCombo = bindingDialog.getControl( "LanguageCombo" ) dim items() as String items() = langCombo.getItems() for index = lbound(items()) to ubound(items()) - iPos = inStr(sFilter,items(index)) + iPos = inStr(sFilter," ") + Dim theLanguage as String if( iPos > 0 ) then - langCombo.text = items( index ) - exit for + theLanguage = Left( sFilter, iPos - 1) + if ( theLanguage = items( index ) ) then + langCombo.text = items( index ) + exit for + end if end if next index End If @@ -2036,4 +2048,4 @@ end sub sub HelpOKButton() helpDialog.endExecute() end sub -</script:module> +</script:module>
\ No newline at end of file |