summaryrefslogtreecommitdiff
path: root/scripting
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2004-05-19 07:23:04 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2004-05-19 07:23:04 +0000
commit7959acfbf95a9ecdc3c366be055b980eabddc654 (patch)
tree54b00bf8d790f63fe3e2c8a5196c87c90003ac10 /scripting
parent5810040322d39167aa46754afee87d39a5e558d4 (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.java26
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 6aa986cdf4..1c38b06752 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() {
}
}