diff options
author | Rüdiger Timm <rt@openoffice.org> | 2004-05-19 07:23:04 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2004-05-19 07:23:04 +0000 |
commit | f94b73dd9c3be042dbe9721368d4e057f0d3cce4 (patch) | |
tree | f778f035b44d5077de28be44f8920ca6c5fd1c92 /scripting | |
parent | 748004a012a688a8e9845d2a76d00f2488a43455 (diff) |
INTEGRATION: CWS scriptingf4 (1.4.4); FILE MERGED
2004/05/12 10:24:17 npower 1.4.4.1: #i28818# in testing for implementation of this issue, untitiled documents not handled very well. Reason code uses URL from XModel which however is blank for untitled documents. Now using the oid ( stringified )
Issue number:
Submitted by:
Reviewed by:
Diffstat (limited to 'scripting')
-rw-r--r-- | scripting/java/com/sun/star/script/framework/provider/PathUtils.java | 26 |
1 files changed, 24 insertions, 2 deletions
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 6aa986cdf441..c845e6b73cef 100644 --- a/scripting/java/com/sun/star/script/framework/provider/PathUtils.java +++ b/scripting/java/com/sun/star/script/framework/provider/PathUtils.java @@ -2,9 +2,9 @@ * * $RCSfile: PathUtils.java,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: svesik $ $Date: 2004-04-19 23:08:55 $ + * last change: $Author: rt $ $Date: 2004-05-19 08:23:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -73,6 +73,8 @@ 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; @@ -83,6 +85,7 @@ 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; public class PathUtils { @@ -98,7 +101,26 @@ public class PathUtils { FILE_URL_PREFIX = m_windows ? "file:///" : "file://"; BOOTSTRAP_NAME = m_windows ? "bootstrap.ini" : "bootstraprc"; } + public static String getOidForModel( XModel xModel ) + { + String oid = new String(""); + if ( xModel != null ) + { + try + { + Method getOid = IQueryInterface.class.getMethod("getOid", null); + if ( getOid != null ) + { + oid = (String)getOid.invoke( xModel, new Object[0] ); + } + } + catch ( Exception ignore ) + { + } + } + return oid; + } private PathUtils() { } } |