[PATCH] Change in core[libreoffice-3-6]: fdo#49517: Revert "fdo#46102: Load Java scripts with class l...

Stephan Bergmann (via Code Review) gerrit at gerrit.libreoffice.org
Fri Oct 26 09:36:11 PDT 2012


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/922

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/22/922/1

fdo#49517: Revert "fdo#46102: Load Java scripts with class loaders [...]"

This reverts commit dd6c4f4db1d62268d73e09ae52d23f760a967dcc "fdo#46102: Load
Java scripts with class loaders that actually find them."  That commit broke
support for macros embedded in documents (as
new java.net.URL("vnd.sun.star.tdoc:...") throws a MalformedURLExcetpion), and
it looks like that commit was not necessary after all -- or rather that what it
tried to work around must have been some other problem that has been fixed
meanwhile.  "It is unclear to me how the Java script provider shall ever have
found the script jars in the past" indicates that something must have been
fishy, and what I failed to notice back then is that createURL creates
java.net.URL instances with a UCBStreamHandler that does allow to obtain content
from weird-looking URLs.

Anyway, with that reverted, all three following scenarios work on both current
master (towards LO 3.7) and libreoffice-3-6 (towards LO 3.6.4); I haven't yet
come around to test on libreoffice-3-5:

1  Stock macros, "Tools - Macros - Run Macro... - LibreOffice Macros -
HelloWorld", running all of the four "helloworld.bsh", "helloworld.js",
"HelloWorldPyhton", and
"org.libreoffice.example.java_scripts.HelloWorld.printHW".

2  Per-document macros, loading test.odt attached to fdo#49517, then "Tools -
Macros - Run Macro... - test.odt - HelloWorld", running
"org.libreoffice.example.java_scripts.HelloWorld.printHW".

3  Extension macros, installing ScriptDispatch.oxt attached to fdo#46012 as
shared extension, then loading StartScriptDispatch.odt attached to fdo#46012 and
pressing the "Start Java via ScriptProvider" button.

Change-Id: I31cd16b3720ffeb1058722d4d1fdffb773f8a067
(cherry picked from commit 7ea7fb009ddcfb0723e88ba0c5778b5fdbe2b553)
---
M scripting/java/com/sun/star/script/framework/container/ScriptMetaData.java
M scripting/java/com/sun/star/script/framework/provider/ClassLoaderFactory.java
M scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java
M scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java
M scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java
M scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java
6 files changed, 9 insertions(+), 54 deletions(-)


--
To view, visit https://gerrit.libreoffice.org/922
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I31cd16b3720ffeb1058722d4d1fdffb773f8a067
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-3-6
Gerrit-Owner: Stephan Bergmann <sbergman at redhat.com>



More information about the LibreOffice mailing list