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

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:
üst 748004a0
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: PathUtils.java,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -73,6 +73,8 @@ import java.net.URL; ...@@ -73,6 +73,8 @@ import java.net.URL;
import java.net.URLDecoder; import java.net.URLDecoder;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.lang.reflect.Method;
import com.sun.star.uno.XComponentContext; import com.sun.star.uno.XComponentContext;
import com.sun.star.script.framework.log.LogUtils; import com.sun.star.script.framework.log.LogUtils;
...@@ -83,6 +85,7 @@ import com.sun.star.util.XMacroExpander; ...@@ -83,6 +85,7 @@ import com.sun.star.util.XMacroExpander;
import com.sun.star.uno.Type; import com.sun.star.uno.Type;
import com.sun.star.uno.AnyConverter; import com.sun.star.uno.AnyConverter;
import com.sun.star.frame.XModel; import com.sun.star.frame.XModel;
import com.sun.star.uno.IQueryInterface;
public class PathUtils { public class PathUtils {
...@@ -98,7 +101,26 @@ public class PathUtils { ...@@ -98,7 +101,26 @@ public class PathUtils {
FILE_URL_PREFIX = m_windows ? "file:///" : "file://"; FILE_URL_PREFIX = m_windows ? "file:///" : "file://";
BOOTSTRAP_NAME = m_windows ? "bootstrap.ini" : "bootstraprc"; 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() { private PathUtils() {
} }
} }
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