diff options
Diffstat (limited to 'scripting/java/com')
-rw-r--r-- | scripting/java/com/sun/star/script/framework/container/ScriptMetaData.java | 9 | ||||
-rw-r--r-- | scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/scripting/java/com/sun/star/script/framework/container/ScriptMetaData.java b/scripting/java/com/sun/star/script/framework/container/ScriptMetaData.java index 6341b51d4e4a..de51b1247af5 100644 --- a/scripting/java/com/sun/star/script/framework/container/ScriptMetaData.java +++ b/scripting/java/com/sun/star/script/framework/container/ScriptMetaData.java @@ -102,6 +102,15 @@ public class ScriptMetaData extends ScriptEntry { private static final String UNO_SHARED_PACKAGES2 = SHARE + "/uno_packages"; + public static String getFileName(URL url) { + String fileName = url.toExternalForm(); + if (fileName.lastIndexOf(UCBStreamHandler.separator) != -1) { + fileName = fileName.substring(0, fileName.lastIndexOf(UCBStreamHandler.separator)); + fileName = fileName.substring(fileName.lastIndexOf("/") + 1); + } + return fileName; + } + public static String getLocationPlaceHolder(String url, String pkgname) { String result = "Unknown"; diff --git a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java index 279e75fb3584..9ba128b42669 100644 --- a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java +++ b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java @@ -228,7 +228,7 @@ public class ScriptEditorForBeanShell implements ScriptEditor, ActionListener { this.context = context; this.scriptURL = url; this.model = new ScriptSourceModel(url); - this.filename = url.getFile(); + this.filename = ScriptMetaData.getFileName(url); this.cl = cl; try { |