Kaydet (Commit) 8ce0337d authored tarafından Rüdiger Timm's avatar Rüdiger Timm

INTEGRATION: CWS scriptingf4 (1.5.4); FILE MERGED

2004/05/07 17:18:26 npower 1.5.4.1: #i28818#
Changes to support Scripting context created from the ScriptProvider, not created in BrowseNodes any more. Behavior of the ScriptContext class has been changed so that for and application script ( e.g. user or share ) the getDocument() method will rerturn  the currently selected document. If it is a document script then the getDocument() method will return the document for the location of the script.
üst f94b73dd
......@@ -2,9 +2,9 @@
*
* $RCSfile: ScriptContext.java,v $
*
* $Revision: 1.5 $
* $Revision: 1.6 $
*
* last change: $Author: svesik $ $Date: 2004-04-19 23:09:11 $
* last change: $Author: rt $ $Date: 2004-05-19 08:23:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -155,14 +155,21 @@ public class ScriptContext extends PropertySet implements XScriptContext
(short)(PropertyAttribute.MAYBEVOID | PropertyAttribute.TRANSIENT), "m_xComponentContext");
}
public static ScriptContext createContext(Object invocationCtx,
public static XScriptContext createContext(Object invocationCtx,
XComponentContext xCtxt, XMultiComponentFactory xMCF)
{
ScriptContext sc = null;
XScriptContext sc = null;
XModel xModel = null;
try {
XPropertySet invocationCtxPropSet = (XPropertySet)
UnoRuntime.queryInterface( XPropertySet.class, invocationCtx);
XPropertySet invocationCtxPropSet = null;
if ( invocationCtx != null )
{
invocationCtxPropSet = (XPropertySet)
UnoRuntime.queryInterface( XPropertySet.class, invocationCtx);
xModel = ( XModel ) UnoRuntime.queryInterface(
XModel.class, invocationCtxPropSet.getPropertyValue( DOC_REF ) );
}
Object xInterface = null;
XDesktop xDesktop = null;
......@@ -172,10 +179,17 @@ public class ScriptContext extends PropertySet implements XScriptContext
xDesktop = (XDesktop)
UnoRuntime.queryInterface(XDesktop.class, xInterface);
sc = new ScriptContext(xCtxt, xDesktop, invocationCtxPropSet);
if ( xModel != null )
{
sc = new ScriptContext(xCtxt, xDesktop, invocationCtxPropSet);
}
else
{
sc = new EditorScriptContext( xCtxt, xDesktop );
}
}
catch ( Exception e ) {
LogUtils.DEBUG( LogUtils.getTrace( e ) );
e.printStackTrace();
}
return sc;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment