Modified: 
openoffice/branches/gbuild-reintegration/test/testgui/source/bvt/gui/FileExport.java
URL: 
http://svn.apache.org/viewvc/openoffice/branches/gbuild-reintegration/test/testgui/source/bvt/gui/FileExport.java?rev=1754701&r1=1754700&r2=1754701&view=diff
==============================================================================
--- 
openoffice/branches/gbuild-reintegration/test/testgui/source/bvt/gui/FileExport.java
 (original)
+++ 
openoffice/branches/gbuild-reintegration/test/testgui/source/bvt/gui/FileExport.java
 Mon Aug  1 04:31:52 2016
@@ -54,33 +54,31 @@ import org.openoffice.test.common.Logger
 import org.openoffice.test.common.Testspace;
 import org.openoffice.test.vcl.widgets.VclDialog;
 
-/**
- * 
- */
-class TestType {
-
-       public TestType(boolean doc, boolean spread, boolean slide) {
-               documentT = doc;
-               spreadsheetT = spread;
-               slideT = slide;
-       }
-
-       public boolean documentT;
-       public boolean spreadsheetT;
-       public boolean slideT;
-};
-
-class ContinuePoint {
-       public String path;
-       public int i;
-
-       ContinuePoint() {
-               path = "";
-               i = 0;
-       }
-}
 
 public class FileExport {
+       private static class TestType {
+
+               public TestType(boolean doc, boolean spread, boolean slide) {
+                       documentT = doc;
+                       spreadsheetT = spread;
+                       slideT = slide;
+               }
+
+               public boolean documentT;
+               public boolean spreadsheetT;
+               public boolean slideT;
+       };
+
+       private static class ContinuePoint {
+               public String path;
+               public int i;
+
+               ContinuePoint() {
+                       path = "";
+                       i = 0;
+               }
+       }
+
        // for example
        // the path is "D:\\aoo\\utaoo\\testspace\\ooxmlsamples"
        String samplespath = "";// a dir
@@ -114,7 +112,7 @@ public class FileExport {
                                if (!f.isHidden() && 
!f.getName().startsWith(".")) {
                                        String apath = f.getPath();
 
-                                       int sepIndex = apath.indexOf("\\");
+                                       int sepIndex = 
apath.indexOf(File.separatorChar);
                                        String userpath = 
apath.substring(sepIndex);
                                        String newpath = outpath + userpath;
 
@@ -133,8 +131,8 @@ public class FileExport {
        private String getrealoutpath(String p) {
                String apath = p;
 
-               int sepIndex = apath.indexOf("\\");
-               int sepIndexLast = apath.lastIndexOf("\\");
+               int sepIndex = apath.indexOf(File.separatorChar);
+               int sepIndexLast = apath.lastIndexOf(File.separatorChar);
                String userpath = apath.substring(sepIndex, sepIndexLast);
                String newpath = outpath + userpath;
                File tempFolderFile = new File(newpath);
@@ -221,17 +219,16 @@ public class FileExport {
                samplelist = new ArrayList<String>();
                sampledirs = new ArrayList<String>();
                thepoint = new ContinuePoint();
-               File spacepath = Testspace.getFile("output");// 
..\\testspace\\output
-               String absspath = spacepath.getAbsolutePath();
-               int n = absspath.indexOf("testgui");
-               String abspre = absspath.substring(0, n);
+               File spacepath = new File(Testspace.getPath());
+               File absspath = spacepath.getAbsoluteFile();
+               String abspre = absspath.getParent();
 
-               result = new DataSheet(getFile("outputlog/"
+               result = new DataSheet(getFile("outputlog" + File.separatorChar
                                + FileExport.class.getName() + ".xml"));
                result.addRow("data", "File Path", "File Size", "Scenario",
                                "Exported File Path", "Exported File Size", 
"Result", "Error");
 
-               testedlogfile = abspre + "testgui\\cases_tested.txt";
+               testedlogfile = abspre + "testgui" + File.separatorChar + 
"cases_tested.txt";
                samplespath = "samples";
                
                if (outpath.length() == 0) {
@@ -411,9 +408,9 @@ public class FileExport {
                        String pre = file.substring(0, dotIndex + 1);
                        String newfile = pre + extName;
 
-                       String saveTo = reportDir + "\\" + file;
+                       String saveTo = reportDir + File.separator + file;
                        if (formatchanged)
-                               saveTo = reportDir + "\\" + newfile;
+                               saveTo = reportDir + File.separator + newfile;
                        // Save the text document
                        deleteFile(saveTo);
                        SaveAs(saveTo);
@@ -478,7 +475,7 @@ public class FileExport {
                        
                        int dotIndex = file.lastIndexOf(".");
                        String pre = file.substring(0, dotIndex + 1);
-                       String saveTo = reportDir + "\\" + pre + targetExtName;
+                       String saveTo = reportDir + File.separator + pre + 
targetExtName;
                        deleteFile(saveTo);
                        // long base = System.currentTimeMillis();
                        SaveAs(saveTo);
@@ -612,7 +609,7 @@ public class FileExport {
 
                        scenario = FileUtil.getFileExtName(file).toLowerCase() 
+ " to pdf";
                        
-                       String saveTo = reportDir + "\\" + newfile;
+                       String saveTo = reportDir + File.separator + newfile;
                        // Save the text document
                        app.dispatch(".uno:ExportToPDF");
                        pdfGeneralPage.ok();


Reply via email to