diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2010-01-29 15:26:37 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2010-01-29 15:26:37 +0000 |
commit | ba5f84db1adade7a007e519eb4449cb75410921a (patch) | |
tree | 7f267c5778fe29326e12a21393351722a6ed3a95 /scripting | |
parent | f515be4ed49482c3a8a62c7dc9e70b0f64b488b2 (diff) | |
parent | 2cb47c5b89bd896be8cd0a3565d9bdf22b8b3a69 (diff) |
ab71: merge with DEV300_m54
Diffstat (limited to 'scripting')
30 files changed, 82 insertions, 205 deletions
diff --git a/scripting/examples/java/MemoryUsage/MemoryUsage.java b/scripting/examples/java/MemoryUsage/MemoryUsage.java index 3337c2eb8a82..727f94a9291c 100644 --- a/scripting/examples/java/MemoryUsage/MemoryUsage.java +++ b/scripting/examples/java/MemoryUsage/MemoryUsage.java @@ -8,7 +8,6 @@ import com.sun.star.lang.XComponent; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.frame.XComponentLoader; import com.sun.star.document.XEmbeddedObjectSupplier; -import com.sun.star.awt.ActionEvent; import com.sun.star.awt.Rectangle; import com.sun.star.beans.XPropertySet; import com.sun.star.beans.PropertyValue; diff --git a/scripting/java/Framework/com/sun/star/script/framework/security/SecurityDialog.java b/scripting/java/Framework/com/sun/star/script/framework/security/SecurityDialog.java index fe38c30315eb..02d91c4aad34 100644 --- a/scripting/java/Framework/com/sun/star/script/framework/security/SecurityDialog.java +++ b/scripting/java/Framework/com/sun/star/script/framework/security/SecurityDialog.java @@ -31,7 +31,6 @@ package com.sun.star.script.framework.security; import com.sun.star.awt.ActionEvent; -import com.sun.star.awt.XActionListener; import com.sun.star.awt.ItemEvent; import com.sun.star.awt.XItemListener; import com.sun.star.awt.XButton; @@ -40,7 +39,6 @@ import com.sun.star.awt.XControl; import com.sun.star.awt.XControlModel; import com.sun.star.awt.XControlContainer; import com.sun.star.awt.XDialog; -import com.sun.star.awt.XFixedText; import com.sun.star.awt.XToolkit; import com.sun.star.awt.XWindow; @@ -52,14 +50,11 @@ import com.sun.star.lang.EventObject; import com.sun.star.lang.XMultiComponentFactory; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.lang.XSingleServiceFactory; -import com.sun.star.lang.XTypeProvider; import com.sun.star.lang.XServiceInfo; import com.sun.star.lang.XInitialization; import com.sun.star.lang.IllegalArgumentException; import com.sun.star.lib.uno.helper.WeakBase; import com.sun.star.registry.XRegistryKey; -import com.sun.star.task.XJobExecutor; -import com.sun.star.uno.Type; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.AnyConverter; import com.sun.star.uno.RuntimeException; diff --git a/scripting/java/com/sun/star/script/framework/browse/DialogFactory.java b/scripting/java/com/sun/star/script/framework/browse/DialogFactory.java index 9a934075333c..bee77e81caf1 100644 --- a/scripting/java/com/sun/star/script/framework/browse/DialogFactory.java +++ b/scripting/java/com/sun/star/script/framework/browse/DialogFactory.java @@ -42,7 +42,6 @@ import com.sun.star.container.XNameContainer; import com.sun.star.awt.*; -import com.sun.star.script.framework.log.LogUtils; public class DialogFactory { diff --git a/scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java b/scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java index cad201333bd8..15e8170af63c 100644 --- a/scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java +++ b/scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java @@ -31,7 +31,6 @@ package com.sun.star.script.framework.browse; import com.sun.star.beans.XIntrospectionAccess; -import com.sun.star.beans.PropertyAttribute; import com.sun.star.lib.uno.helper.PropertySet; @@ -60,7 +59,6 @@ import com.sun.star.script.framework.container.Parcel; import com.sun.star.script.framework.container.ParcelContainer; import com.sun.star.script.framework.browse.DialogFactory; -import java.io.*; import java.util.*; import javax.swing.JOptionPane; diff --git a/scripting/java/com/sun/star/script/framework/browse/PkgProviderBrowseNode.java b/scripting/java/com/sun/star/script/framework/browse/PkgProviderBrowseNode.java index 91396c9454d9..98698e019828 100644 --- a/scripting/java/com/sun/star/script/framework/browse/PkgProviderBrowseNode.java +++ b/scripting/java/com/sun/star/script/framework/browse/PkgProviderBrowseNode.java @@ -30,27 +30,16 @@ package com.sun.star.script.framework.browse; -import com.sun.star.beans.PropertyAttribute; -import com.sun.star.lib.uno.helper.PropertySet; -import com.sun.star.uno.Any; -import com.sun.star.uno.AnyConverter; -import com.sun.star.uno.Type; import com.sun.star.uno.XComponentContext; -import com.sun.star.beans.XIntrospectionAccess; import com.sun.star.script.XInvocation; import com.sun.star.script.browse.XBrowseNode; -import com.sun.star.script.browse.BrowseNodeTypes; import com.sun.star.script.framework.provider.ScriptProvider; import com.sun.star.script.framework.log.*; import com.sun.star.script.framework.container.*; -import com.sun.star.script.framework.browse.DialogFactory; -import java.io.*; -import java.util.*; -import javax.swing.JOptionPane; public class PkgProviderBrowseNode extends ProviderBrowseNode implements XBrowseNode, XInvocation diff --git a/scripting/java/com/sun/star/script/framework/browse/ProviderBrowseNode.java b/scripting/java/com/sun/star/script/framework/browse/ProviderBrowseNode.java index 09836cd7891d..195912720949 100644 --- a/scripting/java/com/sun/star/script/framework/browse/ProviderBrowseNode.java +++ b/scripting/java/com/sun/star/script/framework/browse/ProviderBrowseNode.java @@ -30,7 +30,6 @@ package com.sun.star.script.framework.browse; -import com.sun.star.beans.PropertyAttribute; import com.sun.star.lib.uno.helper.PropertySet; import com.sun.star.uno.Any; import com.sun.star.uno.AnyConverter; @@ -53,7 +52,6 @@ import com.sun.star.script.framework.log.*; import com.sun.star.script.framework.container.*; import com.sun.star.script.framework.browse.DialogFactory; -import java.io.*; import java.util.*; import javax.swing.JOptionPane; diff --git a/scripting/java/com/sun/star/script/framework/browse/ScriptBrowseNode.java b/scripting/java/com/sun/star/script/framework/browse/ScriptBrowseNode.java index 8abe84d9e82b..4f5aaf793291 100644 --- a/scripting/java/com/sun/star/script/framework/browse/ScriptBrowseNode.java +++ b/scripting/java/com/sun/star/script/framework/browse/ScriptBrowseNode.java @@ -33,7 +33,6 @@ import com.sun.star.script.browse.XBrowseNode; import com.sun.star.script.browse.BrowseNodeTypes; import com.sun.star.script.provider.XScriptContext; -import com.sun.star.beans.PropertyAttribute; import com.sun.star.lib.uno.helper.PropertySet; import com.sun.star.uno.AnyConverter; import com.sun.star.uno.Any; @@ -52,13 +51,10 @@ import com.sun.star.reflection.InvocationTargetException; import com.sun.star.container.NoSuchElementException; import com.sun.star.container.ElementExistException; -import java.io.File; import java.util.*; -import javax.swing.JOptionPane; import com.sun.star.script.framework.log.LogUtils; import com.sun.star.script.framework.provider.ScriptProvider; -import com.sun.star.script.framework.browse.DialogFactory; import com.sun.star.script.framework.container.*; public class ScriptBrowseNode extends PropertySet diff --git a/scripting/java/com/sun/star/script/framework/container/DeployedUnoPackagesDB.java b/scripting/java/com/sun/star/script/framework/container/DeployedUnoPackagesDB.java index 8b924600ad47..3612e6650d05 100644 --- a/scripting/java/com/sun/star/script/framework/container/DeployedUnoPackagesDB.java +++ b/scripting/java/com/sun/star/script/framework/container/DeployedUnoPackagesDB.java @@ -33,18 +33,10 @@ package com.sun.star.script.framework.container; import java.io.File; import java.io.InputStream; import java.io.OutputStream; -import java.io.FileInputStream; -import java.io.FileOutputStream; import java.io.IOException; -import java.io.FileNotFoundException; import java.io.ByteArrayInputStream; import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.Hashtable; -import java.util.Enumeration; -import java.util.Iterator; // import javax.xml.parsers.DocumentBuilderFactory; // import javax.xml.parsers.DocumentBuilder; diff --git a/scripting/java/com/sun/star/script/framework/container/Parcel.java b/scripting/java/com/sun/star/script/framework/container/Parcel.java index 75ca7effc811..6d33130c7d40 100644 --- a/scripting/java/com/sun/star/script/framework/container/Parcel.java +++ b/scripting/java/com/sun/star/script/framework/container/Parcel.java @@ -30,23 +30,15 @@ package com.sun.star.script.framework.container; import com.sun.star.script.framework.log.*; import com.sun.star.script.framework.io.*; -import com.sun.star.script.framework.browse.*; import com.sun.star.script.framework.provider.PathUtils; import com.sun.star.container.*; import com.sun.star.uno.Type; import com.sun.star.uno.UnoRuntime; -import com.sun.star.lang.*; -import com.sun.star.io.*; -import com.sun.star.frame.*; - -import com.sun.star.embed.*; import com.sun.star.ucb.XSimpleFileAccess; import com.sun.star.ucb.XSimpleFileAccess2; import java.io.*; -import java.util.*; -import java.net.*; public class Parcel implements XNameContainer { diff --git a/scripting/java/com/sun/star/script/framework/container/ParcelContainer.java b/scripting/java/com/sun/star/script/framework/container/ParcelContainer.java index 70673c48a01c..7c6148ee2fae 100644 --- a/scripting/java/com/sun/star/script/framework/container/ParcelContainer.java +++ b/scripting/java/com/sun/star/script/framework/container/ParcelContainer.java @@ -37,19 +37,14 @@ import com.sun.star.script.framework.provider.PathUtils; import com.sun.star.container.*; import com.sun.star.uno.Type; import com.sun.star.lang.*; -import com.sun.star.frame.*; import com.sun.star.io.*; import java.io.*; import java.util.*; import com.sun.star.ucb.XSimpleFileAccess; import com.sun.star.ucb.XSimpleFileAccess2; import com.sun.star.lang.XMultiComponentFactory; -import com.sun.star.beans.XPropertySet; import com.sun.star.uno.XComponentContext; import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.AnyConverter; -import com.sun.star.deployment.*; -import com.sun.star.embed.*; import com.sun.star.uri.XUriReference; import com.sun.star.uri.XUriReferenceFactory; 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 f0c42da57d4d..a415b02470a4 100644 --- a/scripting/java/com/sun/star/script/framework/container/ScriptMetaData.java +++ b/scripting/java/com/sun/star/script/framework/container/ScriptMetaData.java @@ -30,20 +30,14 @@ package com.sun.star.script.framework.container; -import java.net.URLEncoder; -import java.net.URLDecoder; -import java.net.URLStreamHandler; import java.net.URL; import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; import java.util.Vector; import java.util.StringTokenizer; -import java.io.File; import java.io.InputStream; -import java.io.FileOutputStream; import java.io.OutputStream; import com.sun.star.script.framework.log.LogUtils; @@ -52,22 +46,13 @@ import com.sun.star.script.framework.provider.PathUtils; import com.sun.star.script.framework.io.XInputStreamImpl; - import com.sun.star.script.framework.container.ScriptEntry; import com.sun.star.script.framework.container.Parcel; -import com.sun.star.script.framework.io.XOutputStreamWrapper; -import com.sun.star.script.framework.io.UCBStreamHandler; import com.sun.star.script.framework.io.UCBStreamHandler; -import com.sun.star.io.XTruncate; -import com.sun.star.io.XOutputStream; - import com.sun.star.ucb.XSimpleFileAccess2; - -import com.sun.star.io.XStream; - import com.sun.star.uno.UnoRuntime; public class ScriptMetaData extends ScriptEntry implements Cloneable { diff --git a/scripting/java/com/sun/star/script/framework/container/UnoPkgContainer.java b/scripting/java/com/sun/star/script/framework/container/UnoPkgContainer.java index c2ea432e10cf..40eb7080aa32 100644 --- a/scripting/java/com/sun/star/script/framework/container/UnoPkgContainer.java +++ b/scripting/java/com/sun/star/script/framework/container/UnoPkgContainer.java @@ -36,7 +36,6 @@ import com.sun.star.script.framework.io.XInputStreamWrapper; import java.util.Map; import java.util.HashMap; -import java.util.StringTokenizer; import java.io.OutputStream; import java.io.InputStream; @@ -44,41 +43,10 @@ import com.sun.star.uno.XComponentContext; import com.sun.star.uno.UnoRuntime; -import com.sun.star.frame.XModel; -import com.sun.star.lang.XEventListener; -import com.sun.star.lang.EventObject; -import com.sun.star.lang.XComponent; - import com.sun.star.io.XOutputStream; import com.sun.star.io.XTruncate; - -import com.sun.star.uno.Type; -import com.sun.star.uno.AnyConverter; -import com.sun.star.uno.Any; - -import com.sun.star.ucb.Command; -import com.sun.star.ucb.XContentProvider; -import com.sun.star.ucb.XContent; -import com.sun.star.ucb.XCommandProcessor; -import com.sun.star.ucb.XContentIdentifier; -import com.sun.star.ucb.XContentIdentifierFactory; -import com.sun.star.ucb.XSimpleFileAccess; - -import com.sun.star.beans.XPropertySet; -import com.sun.star.beans.Property; - -import com.sun.star.sdbc.XRow; - import com.sun.star.deployment.XPackage; -import com.sun.star.deployment.XPackageManager; -import com.sun.star.deployment.XPackageManagerFactory; - -import com.sun.star.uno.XComponentContext; - -import com.sun.star.lang.XMultiComponentFactory; - -import com.sun.star.script.provider.XScriptContext; public class UnoPkgContainer extends ParcelContainer { diff --git a/scripting/java/com/sun/star/script/framework/io/XOutputStreamWrapper.java b/scripting/java/com/sun/star/script/framework/io/XOutputStreamWrapper.java index 61435fd55bcb..d12c22fe259a 100644 --- a/scripting/java/com/sun/star/script/framework/io/XOutputStreamWrapper.java +++ b/scripting/java/com/sun/star/script/framework/io/XOutputStreamWrapper.java @@ -29,11 +29,7 @@ ************************************************************************/ package com.sun.star.script.framework.io; import java.io.*; -import com.sun.star.io.XInputStream; import com.sun.star.io.XOutputStream; -import com.sun.star.io.XStream; -import com.sun.star.util.XModifiable; -import com.sun.star.script.framework.log.*; public class XOutputStreamWrapper extends OutputStream { diff --git a/scripting/java/com/sun/star/script/framework/io/XStorageHelper.java b/scripting/java/com/sun/star/script/framework/io/XStorageHelper.java index 8ff5e4672eba..81d2f33435b0 100644 --- a/scripting/java/com/sun/star/script/framework/io/XStorageHelper.java +++ b/scripting/java/com/sun/star/script/framework/io/XStorageHelper.java @@ -39,21 +39,13 @@ import com.sun.star.uno.UnoRuntime; import com.sun.star.lang.XComponent; -import com.sun.star.uno.Any; import com.sun.star.uno.AnyConverter; -import com.sun.star.uno.Type; -import com.sun.star.uno.XComponentContext; - - import com.sun.star.io.XStream; import com.sun.star.io.XInputStream; import com.sun.star.io.XOutputStream; -import com.sun.star.io.XTruncate; -import com.sun.star.io.XSeekable; import com.sun.star.embed.XStorage; -import com.sun.star.embed.ElementModes; import com.sun.star.embed.XTransactedObject; import com.sun.star.document.XDocumentSubStorageSupplier; @@ -68,7 +60,6 @@ import com.sun.star.script.framework.provider.PathUtils; import java.util.*; import java.io.*; -import java.util.zip.*; public class XStorageHelper implements XEventListener diff --git a/scripting/java/com/sun/star/script/framework/provider/ClassLoaderFactory.java b/scripting/java/com/sun/star/script/framework/provider/ClassLoaderFactory.java index 15b601a27294..e3b4989657da 100755 --- a/scripting/java/com/sun/star/script/framework/provider/ClassLoaderFactory.java +++ b/scripting/java/com/sun/star/script/framework/provider/ClassLoaderFactory.java @@ -30,13 +30,7 @@ package com.sun.star.script.framework.provider; -import java.util.ArrayList; -import java.util.Vector; -import java.io.File; -import java.io.IOException; import java.net.*; -import com.sun.star.frame.XModel; -import com.sun.star.uno.XComponentContext; import com.sun.star.script.framework.log.LogUtils; import com.sun.star.script.framework.container.ScriptMetaData; diff --git a/scripting/java/com/sun/star/script/framework/provider/EditorScriptContext.java b/scripting/java/com/sun/star/script/framework/provider/EditorScriptContext.java index 73e5656b1580..5a8b16ff2850 100644 --- a/scripting/java/com/sun/star/script/framework/provider/EditorScriptContext.java +++ b/scripting/java/com/sun/star/script/framework/provider/EditorScriptContext.java @@ -32,27 +32,11 @@ package com.sun.star.script.framework.provider; import com.sun.star.frame.XModel; import com.sun.star.frame.XDesktop; import com.sun.star.uno.XComponentContext; -import com.sun.star.lang.XMultiComponentFactory; -import com.sun.star.beans.XPropertySet; -import com.sun.star.beans.UnknownPropertyException; -import com.sun.star.beans.PropertyVetoException; -import com.sun.star.beans.XPropertyChangeListener; -import com.sun.star.beans.XVetoableChangeListener; -import com.sun.star.lang.WrappedTargetException; -import com.sun.star.lang.IllegalArgumentException; import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.AnyConverter; -import com.sun.star.beans.PropertyAttribute; import com.sun.star.document.XScriptInvocationContext; -import com.sun.star.lib.uno.helper.PropertySet; -import com.sun.star.uno.Type; - -import java.util.HashMap; import com.sun.star.script.provider.XScriptContext; -import com.sun.star.script.framework.log.LogUtils; - /** * Description of the Class diff --git a/scripting/java/com/sun/star/script/framework/provider/PathUtils.java b/scripting/java/com/sun/star/script/framework/provider/PathUtils.java index 85c8ecfe4393..cc45040e3c5c 100644 --- a/scripting/java/com/sun/star/script/framework/provider/PathUtils.java +++ b/scripting/java/com/sun/star/script/framework/provider/PathUtils.java @@ -30,28 +30,10 @@ package com.sun.star.script.framework.provider; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; - -import java.util.Vector; import java.util.StringTokenizer; -import java.net.URLStreamHandler; -import java.net.URL; -import java.net.URLDecoder; -import java.net.MalformedURLException; - import java.lang.reflect.Method; -import com.sun.star.uno.XComponentContext; - -import com.sun.star.script.framework.log.LogUtils; - - -import com.sun.star.util.XMacroExpander; -import com.sun.star.uno.Type; -import com.sun.star.uno.AnyConverter; import com.sun.star.frame.XModel; import com.sun.star.uno.IQueryInterface; diff --git a/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java b/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java index c9484f55a3fe..65c07349d740 100755 --- a/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java +++ b/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java @@ -51,7 +51,6 @@ import com.sun.star.beans.XPropertyChangeListener; import com.sun.star.beans.XPropertySetInfo; import com.sun.star.beans.Property; -import com.sun.star.uno.Type; import com.sun.star.beans.XIntrospectionAccess; import com.sun.star.script.XInvocation; @@ -90,7 +89,7 @@ import com.sun.star.deployment.XPackage; import com.sun.star.document.XScriptInvocationContext; import com.sun.star.frame.XTransientDocumentsDocumentContentFactory; import com.sun.star.uno.TypeClass; -import java.util.*; + public abstract class ScriptProvider implements XScriptProvider, XBrowseNode, XPropertySet, XInvocation, XInitialization, XTypeProvider, XServiceInfo, XNameContainer diff --git a/scripting/java/com/sun/star/script/framework/provider/beanshell/PlainSourceView.java b/scripting/java/com/sun/star/script/framework/provider/beanshell/PlainSourceView.java index cf0f47ddc96f..617c99051250 100755 --- a/scripting/java/com/sun/star/script/framework/provider/beanshell/PlainSourceView.java +++ b/scripting/java/com/sun/star/script/framework/provider/beanshell/PlainSourceView.java @@ -30,17 +30,11 @@ package com.sun.star.script.framework.provider.beanshell; import javax.swing.JTextArea; -import javax.swing.JPanel; import javax.swing.JScrollPane; -import javax.swing.JButton; import javax.swing.JComponent; -import javax.swing.JFileChooser; -import javax.swing.JOptionPane; -import javax.swing.text.Document; import javax.swing.event.DocumentListener; import javax.swing.event.DocumentEvent; -import java.awt.FlowLayout; import java.awt.Graphics; import java.awt.Color; import java.awt.Font; @@ -48,8 +42,6 @@ import java.awt.FontMetrics; import java.awt.Polygon; import java.awt.Rectangle; import java.awt.Dimension; -import java.awt.event.ActionListener; -import java.awt.event.ActionEvent; public class PlainSourceView extends JScrollPane implements ScriptSourceView, DocumentListener { 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 0da72e415278..c7286ccb2a0a 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 @@ -33,7 +33,6 @@ import javax.swing.JComponent; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JButton; -import javax.swing.JFileChooser; import javax.swing.JOptionPane; import java.awt.FlowLayout; @@ -42,18 +41,13 @@ import java.awt.event.ActionEvent; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; -import java.io.File; import java.io.InputStream; -import java.io.FileInputStream; -import java.io.FileOutputStream; import java.io.OutputStream; import java.io.IOException; import java.net.URL; import java.util.Map; import java.util.HashMap; -import bsh.Interpreter; - import com.sun.star.script.provider.XScriptContext; import com.sun.star.script.framework.provider.ScriptEditor; import com.sun.star.script.framework.container.ScriptMetaData; diff --git a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java index 00f6f1c7eb75..732013601c76 100755 --- a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java +++ b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java @@ -42,7 +42,6 @@ import com.sun.star.uno.Any; import com.sun.star.reflection.InvocationTargetException; import java.util.StringTokenizer; -import java.io.*; import java.net.URL; diff --git a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptSourceModel.java b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptSourceModel.java index 1cbf156262e1..186fed25a6e4 100644 --- a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptSourceModel.java +++ b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptSourceModel.java @@ -29,15 +29,11 @@ ************************************************************************/ package com.sun.star.script.framework.provider.beanshell; -import java.io.File; import java.io.InputStream; -import java.io.FileInputStream; -import java.io.FileOutputStream; import java.io.IOException; import java.net.URL; -import java.lang.reflect.InvocationTargetException; import com.sun.star.script.provider.XScriptContext; public class ScriptSourceModel { diff --git a/scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java b/scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java index d36821ece7bd..14fcfa348137 100755 --- a/scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java +++ b/scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java @@ -30,7 +30,6 @@ package com.sun.star.script.framework.provider.java; import com.sun.star.frame.XModel; -import com.sun.star.frame.XDesktop; import com.sun.star.comp.loader.FactoryHelper; import com.sun.star.document.XScriptInvocationContext; import com.sun.star.uno.XComponentContext; diff --git a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java index 23def8559b41..45e99c8c324d 100644 --- a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java +++ b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java @@ -48,7 +48,6 @@ import java.net.URL; import java.util.Map; import java.util.HashMap; -import javax.swing.JFrame; import javax.swing.SwingUtilities; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; diff --git a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java index 04b4a8e60990..d913129c5f87 100755 --- a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java +++ b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java @@ -29,7 +29,6 @@ ************************************************************************/ package com.sun.star.script.framework.provider.javascript; -import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; import com.sun.star.lang.XMultiComponentFactory; import com.sun.star.lang.XMultiServiceFactory; @@ -37,31 +36,14 @@ import com.sun.star.lang.XSingleServiceFactory; import com.sun.star.frame.XModel; import com.sun.star.registry.XRegistryKey; import com.sun.star.comp.loader.FactoryHelper; -import com.sun.star.lang.XTypeProvider; -import com.sun.star.lang.XServiceInfo; -import com.sun.star.lang.XInitialization; -import com.sun.star.uno.AnyConverter; -import com.sun.star.uno.Type; -import com.sun.star.uno.Any; -import com.sun.star.beans.XPropertySet; import com.sun.star.document.XScriptInvocationContext; -import com.sun.star.lang.IllegalArgumentException; -import com.sun.star.lang.WrappedTargetException; import com.sun.star.reflection.InvocationTargetException; -import com.sun.star.script.CannotConvertException; -import java.io.*; -import java.util.Vector; -import java.util.Map; -import java.net.MalformedURLException; import java.net.URL; -import com.sun.star.script.provider.XScriptProvider; import com.sun.star.script.provider.XScript; -import com.sun.star.script.provider.XScriptContext; -import com.sun.star.script.provider.ScriptErrorRaisedException; import com.sun.star.script.provider.ScriptExceptionRaisedException; import com.sun.star.script.provider.ScriptFrameworkErrorException; import com.sun.star.script.provider.ScriptFrameworkErrorType; @@ -72,13 +54,11 @@ import com.sun.star.script.framework.provider.ClassLoaderFactory; import com.sun.star.script.framework.provider.ScriptProvider; import com.sun.star.script.framework.provider.ScriptEditor; import com.sun.star.script.framework.container.ScriptMetaData; -import com.sun.star.script.framework.log.*; import org.mozilla.javascript.Context; import org.mozilla.javascript.ImporterTopLevel; import org.mozilla.javascript.Scriptable; import org.mozilla.javascript.JavaScriptException; -import org.mozilla.javascript.EcmaError; public class ScriptProviderForJavaScript { diff --git a/scripting/source/basprov/makefile.mk b/scripting/source/basprov/makefile.mk index 76efc36e2d27..2b6fe7faa305 100644 --- a/scripting/source/basprov/makefile.mk +++ b/scripting/source/basprov/makefile.mk @@ -61,7 +61,6 @@ DEF1NAME=$(SHL1TARGET) SHL1STDLIBS= \ $(SFX2LIB) \ $(BASICLIB) \ - $(SVTOOLLIB) \ $(VCLLIB) \ $(TOOLSLIB) \ $(UCBHELPERLIB) \ diff --git a/scripting/source/protocolhandler/makefile.mk b/scripting/source/protocolhandler/makefile.mk index 77dad5e7ffd9..35440668f6b1 100644 --- a/scripting/source/protocolhandler/makefile.mk +++ b/scripting/source/protocolhandler/makefile.mk @@ -49,7 +49,6 @@ SHL1TARGET= $(TARGET)$(DLLPOSTFIX) SHL1STDLIBS= \ $(SFXLIB) \ - $(TOOLSLIB) \ $(CPPULIB) \ $(CPPUHELPERLIB) \ $(VCLLIB) \ diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx index e1a8ba99790f..ecc7b0a96355 100644 --- a/scripting/source/protocolhandler/scripthandler.cxx +++ b/scripting/source/protocolhandler/scripthandler.cxx @@ -529,6 +529,9 @@ const Reference< XMultiServiceFactory >& xServiceManager ) extern "C" { +#undef css +#define css ::com::sun::star + void SAL_CALL component_getImplementationEnvironment( const sal_Char** ppEnvironmentTypeName, uno_Environment** ppEnvironment ) { diff --git a/scripting/source/protocolhandler/scripthandler.hxx b/scripting/source/protocolhandler/scripthandler.hxx index 18b5f5fffacc..a2896e93d0bc 100644 --- a/scripting/source/protocolhandler/scripthandler.hxx +++ b/scripting/source/protocolhandler/scripthandler.hxx @@ -75,8 +75,7 @@ namespace com { namespace sun { namespace star { namespace scripting_protocolhandler { -// for simplification -#define css ::com::sun::star +namespace css = ::com::sun::star; class ScriptProtocolHandler : public ::cppu::WeakImplHelper4< css::frame::XDispatchProvider, diff --git a/scripting/source/pyprov/pythonscript.py b/scripting/source/pyprov/pythonscript.py index 6ce354215ccc..6a57fa792873 100644 --- a/scripting/source/pyprov/pythonscript.py +++ b/scripting/source/pyprov/pythonscript.py @@ -126,7 +126,68 @@ def readTextFromStream( inputStream ): break return code.value +def toIniName( str ): + # TODO: what is the official way to get to know whether i am on the windows platform ? + if( hasattr(sys , "dllhandle") ): + return str + ".ini" + return str + "rc" + + +""" definition: storageURI is the system dependent, absolute file url, where the script is stored on disk + scriptURI is the system independent uri +""" +class MyUriHelper: + + def __init__( self, ctx, location ): + self.s_UriMap = \ + { "share" : "vnd.sun.star.expand:${$BRAND_BASE_DIR/program/" + toIniName( "bootstrap") + "::BaseInstallation}/share/Scripts/python" , \ + "share:uno_packages" : "vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE/uno_packages", \ + "user" : "vnd.sun.star.expand:${$BRAND_BASE_DIR/program/" + toIniName( "bootstrap") + "::UserInstallation}/user/Scripts/python" , \ + "user:uno_packages" : "vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE/uno_packages" } + self.m_uriRefFac = ctx.ServiceManager.createInstanceWithContext("com.sun.star.uri.UriReferenceFactory",ctx) + if location.startswith( "vnd.sun.star.tdoc" ): + self.m_baseUri = location + "/Scripts/python" + self.m_scriptUriLocation = "document" + else: + self.m_baseUri = expandUri( self.s_UriMap[location] ) + self.m_scriptUriLocation = location + log.isDebugLevel() and log.debug( "initialized urihelper with baseUri="+self.m_baseUri + ",m_scriptUriLocation="+self.m_scriptUriLocation ) + + def getRootStorageURI( self ): + return self.m_baseUri + + def getStorageURI( self, scriptURI ): + return self.scriptURI2StorageUri(scriptURI) + + def getScriptURI( self, storageURI ): + return self.storageURI2ScriptUri(storageURI) + + def storageURI2ScriptUri( self, storageURI ): + if not storageURI.startswith( self.m_baseUri ): + message = "pythonscript: storage uri '" + storageURI + "' not in base uri '" + self.m_baseUri + "'" + log.isDebugLevel() and log.debug( message ) + raise RuntimeException( message ) + + ret = "vnd.sun.star.script:" + \ + storageURI[len(self.m_baseUri)+1:].replace("/","|") + \ + "?language=" + LANGUAGENAME + "&location=" + self.m_scriptUriLocation + log.isDebugLevel() and log.debug( "converting storageURI="+storageURI + " to scriptURI=" + ret ) + return ret + def scriptURI2StorageUri( self, scriptURI ): + try: + myUri = self.m_uriRefFac.parse(scriptURI) + ret = self.m_baseUri + "/" + myUri.getName().replace( "|", "/" ) + log.isDebugLevel() and log.debug( "converting scriptURI="+scriptURI + " to storageURI=" + ret ) + return ret + except UnoException, e: + log.error( "error during converting scriptURI="+scriptURI + ": " + e.Message) + raise RuntimeException( "pythonscript:scriptURI2StorageUri: " +e.getMessage(), None ) + except Exception, e: + log.error( "error during converting scriptURI="+scriptURI + ": " + str(e)) + raise RuntimeException( "pythonscript:scriptURI2StorageUri: " + str(e), None ) + + class ModuleEntry: def __init__( self, lastRead, module ): self.lastRead = lastRead @@ -342,15 +403,20 @@ class ScriptBrowseNode( unohelper.Base, XBrowseNode , XPropertySet, XInvocation, def getPropertyValue( self, name ): ret = None - if name == "URI": - ret = self.provCtx.uriHelper.getScriptURI( - self.provCtx.getPersistentUrlFromStorageUrl( self.uri + "$" + self.funcName ) ) - elif name == "Description": - ret = getattr( self.func, "__doc__", None ) - elif name == "Editable" and ENABLE_EDIT_DIALOG: - ret = not self.provCtx.sfa.isReadOnly( self.uri ) + try: + if name == "URI": + ret = self.provCtx.uriHelper.getScriptURI( + self.provCtx.getPersistentUrlFromStorageUrl( self.uri + "$" + self.funcName ) ) + elif name == "Description": + ret = getattr( self.func, "__doc__", None ) + elif name == "Editable" and ENABLE_EDIT_DIALOG: + ret = not self.provCtx.sfa.isReadOnly( self.uri ) - log.isDebugLevel() and log.debug( "ScriptBrowseNode.getPropertyValue called for " + name + ", returning " + str(ret) ) + log.isDebugLevel() and log.debug( "ScriptBrowseNode.getPropertyValue called for " + name + ", returning " + str(ret) ) + except Exception,e: + log.error( "ScriptBrowseNode.getPropertyValue error " + lastException2String()) + raise + return ret def setPropertyValue( self, name, value ): log.isDebugLevel() and log.debug( "ScriptBrowseNode.setPropertyValue called " + name + "=" +str(value ) ) @@ -757,9 +823,9 @@ class PythonScriptProvider( unohelper.Base, XBrowseNode, XScriptProvider, XNameC isPackage = storageType.endswith( ":uno_packages" ) try: - urlHelper = ctx.ServiceManager.createInstanceWithArgumentsAndContext( - "com.sun.star.script.provider.ScriptURIHelper", (LANGUAGENAME, storageType), ctx) - +# urlHelper = ctx.ServiceManager.createInstanceWithArgumentsAndContext( +# "com.sun.star.script.provider.ScriptURIHelper", (LANGUAGENAME, storageType), ctx) + urlHelper = MyUriHelper( ctx, storageType ) log.isDebugLevel() and log.debug( "got urlHelper " + str( urlHelper ) ) rootUrl = expandUri( urlHelper.getRootStorageURI() ) |