You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by hi...@apache.org on 2001/05/02 17:31:34 UTC

cvs commit: xml-batik/sources/org/apache/batik/apps/svgbrowser JSVGViewerFrame.java

hillion     01/05/02 08:31:34

  Modified:    sources/org/apache/batik/apps/svgbrowser
                        JSVGViewerFrame.java
  Log:
  Fixed a bug dealing with relative URIs (Windows).
  
  Revision  Changes    Path
  1.29      +13 -3     xml-batik/sources/org/apache/batik/apps/svgbrowser/JSVGViewerFrame.java
  
  Index: JSVGViewerFrame.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/apps/svgbrowser/JSVGViewerFrame.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- JSVGViewerFrame.java	2001/05/02 13:12:25	1.28
  +++ JSVGViewerFrame.java	2001/05/02 15:31:29	1.29
  @@ -129,7 +129,7 @@
    * This class represents a SVG viewer swing frame.
    *
    * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
  - * @version $Id: JSVGViewerFrame.java,v 1.28 2001/05/02 13:12:25 hillion Exp $
  + * @version $Id: JSVGViewerFrame.java,v 1.29 2001/05/02 15:31:29 hillion Exp $
    */
   public class JSVGViewerFrame
       extends    JFrame
  @@ -514,7 +514,12 @@
                               s = null;
                           } else {
                               try {
  -                                s = "file:" + f.getCanonicalPath();
  +                                s = f.getCanonicalPath();
  +                                if (s.startsWith("/")) {
  +                                    s = "file:" + s;
  +                                } else {
  +                                    s = "file:/" + s;
  +                                }
                               } catch (IOException ex) {
                               }
                           }
  @@ -622,7 +627,12 @@
                               s = null;
                           } else {
                               try {
  -                                s = "file:" + f.getCanonicalPath();
  +                                s = f.getCanonicalPath();
  +                                if (s.startsWith("/")) {
  +                                    s = "file:" + s;
  +                                } else {
  +                                    s = "file:/" + s;
  +                                }
                               } catch (IOException ex) {
                               }
                           }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org