diff options
author | Noel Grandin <noel@peralex.com> | 2014-08-05 09:54:58 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-08-05 11:31:50 +0200 |
commit | 0c5f51ebbcb7e22baa913e2012e3dcfcc6cf7897 (patch) | |
tree | 3d441110176e37c1a6ba2d15a3653d5023863075 /qadevOOo/runner/graphical | |
parent | d26540bb05b0443e7988da34372c86f88cbf1f6c (diff) |
java: remove commented out code
Change-Id: I44e2043e5da23bc9421c03e550ef1d8b7ebaad36
Diffstat (limited to 'qadevOOo/runner/graphical')
-rw-r--r-- | qadevOOo/runner/graphical/BuildID.java | 43 | ||||
-rw-r--r-- | qadevOOo/runner/graphical/DateHelper.java | 1 | ||||
-rw-r--r-- | qadevOOo/runner/graphical/FileHelper.java | 122 | ||||
-rw-r--r-- | qadevOOo/runner/graphical/GlobalLogWriter.java | 5 | ||||
-rw-r--r-- | qadevOOo/runner/graphical/HTMLResult.java | 11 | ||||
-rw-r--r-- | qadevOOo/runner/graphical/ImageHelper.java | 7 | ||||
-rw-r--r-- | qadevOOo/runner/graphical/IniFile.java | 107 | ||||
-rw-r--r-- | qadevOOo/runner/graphical/MSOfficePostscriptCreator.java | 40 | ||||
-rw-r--r-- | qadevOOo/runner/graphical/OpenOfficePostscriptCreator.java | 347 | ||||
-rw-r--r-- | qadevOOo/runner/graphical/ParameterHelper.java | 50 | ||||
-rw-r--r-- | qadevOOo/runner/graphical/PerformanceContainer.java | 22 | ||||
-rw-r--r-- | qadevOOo/runner/graphical/PixelCounter.java | 51 |
12 files changed, 0 insertions, 806 deletions
diff --git a/qadevOOo/runner/graphical/BuildID.java b/qadevOOo/runner/graphical/BuildID.java index 04a18b91909f..2a83aa9ce2c3 100644 --- a/qadevOOo/runner/graphical/BuildID.java +++ b/qadevOOo/runner/graphical/BuildID.java @@ -117,7 +117,6 @@ public class BuildID private static String getBuildIDFromVersion(String _sOfficePath, String _sIniSection) { - // String fs = System.getProperty("file.separator"); String sBuildID = ""; String sOfficePath; if (OSHelper.isWindows()) @@ -140,29 +139,6 @@ public class BuildID return sBuildID; } -// public static void main(String[] args) -// { -// String sApp; -// sApp = "/opt/staroffice8_m116/program/soffice --headless --accept=socket,host=localhost,port=8100;urp;"; -// String sBuildID; -// sBuildID = getBuildID(sApp); -// System.out.println("BuildID is: " + sBuildID); - -// Date aDate = new Date(); -// long nStart = aDate.getTime(); -// System.out.println("Time:" + nStart); -// // LLA: Just some more tests for getBuildID -// // sApp = "/opt/staroffice8_net/program/soffice"; -// // sBuildID = getBuildID(sApp); -// // System.out.println("BuildID is: " + sBuildID); - -// // sApp = "\"/opt/staroffice8_net/program/soffice\" test blah"; -// // sBuildID = getBuildID(sApp); - -// // System.out.println("BuildID is: " + sBuildID); -// System.exit(1); -// } - public static String getMinor(String _sOfficePath) { final String sOfficePath = getOfficePath(_sOfficePath); @@ -184,23 +160,4 @@ public class BuildID return sCWSName; } -// public static void main(String[] args) -// { -// String sApp; -// sApp = "D:/staroffice9_m63/Sun/StarOffice 9/program/soffice.exe"; -// String sBuildID; -// sBuildID = getBuildID(sApp); -// System.out.println("BuildID is: " + sBuildID); - -// String sMinor; -// sMinor = getMinor(sApp); -// System.out.println("Minor is: " + sMinor); - -// String sCWSName; -// sCWSName = getCWSName(sApp); -// System.out.println("CWSName is: " + sCWSName); - -// System.exit(1); -// } - } diff --git a/qadevOOo/runner/graphical/DateHelper.java b/qadevOOo/runner/graphical/DateHelper.java index 4bbd6668ff0c..1e12d16834a8 100644 --- a/qadevOOo/runner/graphical/DateHelper.java +++ b/qadevOOo/runner/graphical/DateHelper.java @@ -43,7 +43,6 @@ public class DateHelper Locale aLocale = new Locale("en","US"); SimpleDateFormat aFormat = new SimpleDateFormat(_sFormat, aLocale); aBuf = aFormat.format(aCalendar.getTime(), aBuf, new FieldPosition(0) ); - // DebugHelper.writeInfo("Date: " + aBuf.toString()); return aBuf.toString(); } } diff --git a/qadevOOo/runner/graphical/FileHelper.java b/qadevOOo/runner/graphical/FileHelper.java index 9ae716f92cef..aa565f98efa5 100644 --- a/qadevOOo/runner/graphical/FileHelper.java +++ b/qadevOOo/runner/graphical/FileHelper.java @@ -34,9 +34,6 @@ public class FileHelper { public FileHelper() { - // fs = System.getProperty("file.separator"); - - String sOSName = System.getProperty("os.name"); String sOSArch = System.getProperty("os.arch"); String sOSVersion = System.getProperty("os.version"); @@ -66,22 +63,6 @@ public class FileHelper { return true; } - // This is just nice for DEBUG behaviour - // due to the fact this is absolutely context dependency no one should use it. - // else - // { - // System.out.println("FileHelper:exists() tell this path doesn't exists. Check it. path is:" ); - // System.out.println( _sFile ); - // System.out.println( aFile.getAbsolutePath() ); - // MessageBox("Der JavaProzess wartet auf eine interaktion ihrerseits."); - - // File aFile2 = new File(_sFile); - // if (aFile2.exists()) - // { - // System.out.println("Thanks, file exists." ); - // return true; - // } - // } return false; } @@ -113,7 +94,6 @@ public class FileHelper { return ""; } - // String fs = System.getProperty("file.separator"); int nIdx = _sFilename.lastIndexOf("\\"); if (nIdx == -1) @@ -161,7 +141,6 @@ public class FileHelper { return ""; } - // String fs = System.getProperty("file.separator"); int nIdx = _sFilename.lastIndexOf("\\"); if (nIdx == -1) @@ -175,40 +154,6 @@ public class FileHelper return ""; } -/* - static ArrayList files = new ArrayList(); - public static Object[] traverse( String afileDirectory ) - { - - File fileDirectory = new File(afileDirectory); - // Testing, if the file is a directory, and if so, it throws an exception - if ( !fileDirectory.isDirectory() ) - { - throw new IllegalArgumentException( "not a directory: " + fileDirectory.getName() ); - } - - // Getting all files and directories in the current directory - File[] entries = fileDirectory.listFiles(); - - // Iterating for each file and directory - for ( int i = 0; i < entries.length; ++i ) - { - // adding file to List - try - { - // Composing the URL by replacing all backslashs - String stringUrl = "file:///" - + entries[ i ].getAbsolutePath().replace( '\\', '/' ); - files.add(stringUrl); - } - catch( Exception exception ) - { - exception.printStackTrace(); - } - } - return files.toArray(); - } -*/ // makeDirectories("", "/tmp/a/b"); // creates all directories /tmp/a/b @@ -237,7 +182,6 @@ public class FileHelper String part = path_tokenizer.nextToken(); File new_dir = new File(already_done + File.separatorChar + part); already_done = new_dir.toString(); - // System.out.println(already_done); //create the directory new_dir.mkdirs(); if (OSHelper.isUnix() && @@ -409,28 +353,6 @@ public class FileHelper } } -// try -// { -// File inputFile = new File(_sSource); -// File outputFile = new File(_sDestination); - -// java.io.FileReader in = new java.io.FileReader(inputFile); -// java.io.FileWriter out = new java.io.FileWriter(outputFile); -// int c; - -// while ((c = in.read()) != -1) -// { -// out.write(c); -// } - -// in.close(); -// out.close(); -// } -// catch (java.io.IOException e) -// { -// GlobalLogWriter.get().println("Exception caught. FileHelper.copy('" + _sSource + ", " + _sDestination + "')"); -// GlobalLogWriter.get().println("Message: " + e.getMessage()); -// } } @@ -633,10 +555,6 @@ public class FileHelper } aIniFile.insertValue("global", "buildid", sBuildID); - // if (_sSpecial != null && _sSpecial.length() > 0) - // { - // out.write("special=" + _sSpecial + ls); - // } out.println(); out.println("# resolution given in DPI"); out.println("resolution=" + _aGTA.getResolutionInDPI()); @@ -648,13 +566,6 @@ public class FileHelper aIniFile.insertValue("global", "buildid", _sSpecial); } - // long nTime = stopTimer(); - // if (nTime != 0) - // { - // out.write("# time is given in milli seconds" + ls); - // out.write("time=" + nTime + ls); - // } - out.println(); out.println("# Values out of System.getProperty(...)"); out.println("os.name=" + System.getProperty("os.name")); @@ -684,24 +595,10 @@ public class FileHelper } aIniFile.close(); -// String sExtension = FileHelper.getSuffix(_aGTA.getInputFile()); -// if (sExtension.startsWith(".")) -// { -// sExtension = sExtension.substring(1); -// } - -// DB.writeToDB(_aGTA.getInputFile(), -// sNameNoSuffix, -// sExtension, -// sBuildID, -// _aGTA.getReferenceType(), -// _aGTA.getResolutionInDPI() -// ); } public static void addBasenameToFile(String _sIndexFilename, String _sBasename, String _sCreator, String _sType, String _sSource) { - // String sOutputDir = FileHelper.getPath(_sOutputFilename); String sPath; if (_sIndexFilename.startsWith("file:")) { @@ -717,36 +614,17 @@ public class FileHelper aIniFile.insertValue(_sBasename, "type", _sType); aIniFile.insertValue(_sBasename, "source", _sSource); aIniFile.close(); -// File aFile = new File(sIndexFilename); -// try -// { -// RandomAccessFile aRandomAccess = new RandomAccessFile(aFile, "rw"); -// // String sBasename = FileHelper.getBasename(_sOutputFilename); -// aRandomAccess.seek(aRandomAccess.length()); // jump to the end. -//// TODO: seems to be wrong, there exist no writeLine() with 'return' ending? -// aRandomAccess.writeUTF(_sBasename); -// aRandomAccess.close(); -// } -// catch (java.io.FileNotFoundException e) -// { -// } -// catch (java.io.IOException e) -// { -// } } public static void addBasenameToPostscript(String _sOutputFilename) { String sIndexFilename = FileHelper.appendPath(_sOutputFilename, "postscript.ini"); - // String sPath = FileHelper.getPath(sIndexFilename); String sBasename = FileHelper.getBasename(_sOutputFilename); addBasenameToFile(sIndexFilename, sBasename, "", "", ""); } public static void addBasenameToIndex(String _sOutputFilename, String _sBasename, String _sCreator, String _sType, String _sSource) { String sIndexFilename = FileHelper.appendPath(_sOutputFilename, "index.ini"); - // String sPath = FileHelper.getPath(sIndexFilename); - // String sBasename = FileHelper.getBasename(_sOutputFilename); addBasenameToFile(sIndexFilename, _sBasename, _sCreator, _sType, _sSource); } diff --git a/qadevOOo/runner/graphical/GlobalLogWriter.java b/qadevOOo/runner/graphical/GlobalLogWriter.java index 8a6e799e3cec..027e8c07d897 100644 --- a/qadevOOo/runner/graphical/GlobalLogWriter.java +++ b/qadevOOo/runner/graphical/GlobalLogWriter.java @@ -45,11 +45,6 @@ public class GlobalLogWriter return m_aGlobalLogWriter; } -// public static synchronized void initialize() -// { -// get().initialize(null, true); -// } - protected static synchronized void set(LogWriter _aLog) { m_aGlobalLogWriter = _aLog; diff --git a/qadevOOo/runner/graphical/HTMLResult.java b/qadevOOo/runner/graphical/HTMLResult.java index d81e677ea85e..3482dc45de10 100644 --- a/qadevOOo/runner/graphical/HTMLResult.java +++ b/qadevOOo/runner/graphical/HTMLResult.java @@ -20,14 +20,10 @@ package graphical; import java.io.File; import java.io.FileWriter; -// import util.utils; -// import helper.OSHelper; public class HTMLResult { private FileWriter m_aOut; - // private String m_sFilename; - // private String m_sNamePrefix; // the HTML files used a suffix to build it's right name /** * ls is the current line separator (carridge return) @@ -37,7 +33,6 @@ public class HTMLResult public HTMLResult( String _sOutputPath, String _sHTMLFilename ) { FileHelper.makeDirectories("", _sOutputPath); - // HTMLResult a = new HTMLResult(); String sFilename = FileHelper.appendPath(_sOutputPath, _sHTMLFilename); try @@ -50,15 +45,9 @@ public class HTMLResult { e.printStackTrace(); GlobalLogWriter.println("ERROR: Can't create HTML Outputter"); - // return null; } - // m_sFilename = sFilename; - // a.m_sNamePrefix = _sNamePrefix; - // return a; } - // public String getFilename() {return m_sFilename;} - private void writeln(String _sStr) { try diff --git a/qadevOOo/runner/graphical/ImageHelper.java b/qadevOOo/runner/graphical/ImageHelper.java index beea44fe056d..e06a6880f27b 100644 --- a/qadevOOo/runner/graphical/ImageHelper.java +++ b/qadevOOo/runner/graphical/ImageHelper.java @@ -22,7 +22,6 @@ import java.awt.Image; import java.awt.image.PixelGrabber; import java.awt.image.ImageObserver; import java.io.File; -//import javax.imageio.ImageIO; import java.lang.reflect.Method; class ImageHelper @@ -68,11 +67,6 @@ class ImageHelper return m_aPixels[y * m_w + x]; } - // Write down the current image to a file. - // public void storeImage(String _sFilename) - // { - // } - public static ImageHelper createImageHelper(String _sFilename) throws java.io.IOException { @@ -105,7 +99,6 @@ class ImageHelper "Cannot construct object with current Java version " + javaVersion + ": " + ex.getMessage()); } -// aImage = ImageIO.read(aFile); return new ImageHelper(aImage); } } diff --git a/qadevOOo/runner/graphical/IniFile.java b/qadevOOo/runner/graphical/IniFile.java index 23a4290548ae..7c3e31e588cf 100644 --- a/qadevOOo/runner/graphical/IniFile.java +++ b/qadevOOo/runner/graphical/IniFile.java @@ -17,7 +17,6 @@ */ package graphical; -// import java.io.BufferedReader; import java.io.File; import java.io.RandomAccessFile; import java.util.ArrayList; @@ -49,10 +48,6 @@ public class IniFile implements Enumeration<String> m_sFilename = _sFilename; m_aList = loadLines(); m_aEnumerationPos = findNextSection(0); -// if (_sFilename.endsWith(".odb.ps.ini")) -// { -// int dummy = 0; -// } } public void insertFirstComment(String[] _aList) @@ -73,13 +68,9 @@ public class IniFile implements Enumeration<String> ArrayList<String> aLines = new ArrayList<String>(); if (!aFile.exists()) { - // GlobalLogWriter.println("couldn't find file '" + m_sFilename + "', will be created."); - // DebugHelper.exception(BasicErrorCode.SbERR_FILE_NOT_FOUND, ""); - // m_bListContainUnsavedChanges = false; return aLines; } RandomAccessFile aReader = null; - // BufferedReader aReader; try { aReader = new RandomAccessFile(aFile, "r"); @@ -97,13 +88,11 @@ public class IniFile implements Enumeration<String> { GlobalLogWriter.println("couldn't open file " + m_sFilename); GlobalLogWriter.println("Message: " + fne.getMessage()); - // DebugHelper.exception(BasicErrorCode.SbERR_FILE_NOT_FOUND, ""); } catch (java.io.IOException ie) { GlobalLogWriter.println("Exception occurs while reading from file " + m_sFilename); GlobalLogWriter.println("Message: " + ie.getMessage()); - // DebugHelper.exception(BasicErrorCode.SbERR_INTERNAL_ERROR, ie.getMessage()); } try { @@ -113,7 +102,6 @@ public class IniFile implements Enumeration<String> { GlobalLogWriter.println("Couldn't close file " + m_sFilename); GlobalLogWriter.println("Message: " + ie.getMessage()); - // DebugHelper.exception(BasicErrorCode.SbERR_INTERNAL_ERROR, ie.getMessage()); } return aLines; } @@ -323,8 +311,6 @@ public class IniFile implements Enumeration<String> @param _sKey string @return the value found in the inifile which is given by the section and key parameter */ - // private int m_nCurrentPosition; - // private String m_sOldKey; public String getValue(String _sSection, String _sKey) { String sValue = ""; @@ -341,16 +327,6 @@ public class IniFile implements Enumeration<String> return sValue; } -// private String getNextValue() -// { -// if (m_nCurrentPosition >= 0) -// { -// ++m_nCurrentPosition; -// String sValue = getValue(m_nCurrentPosition); -// return sValue; -// } -// return ""; -// } /** * Returns the value at Section, Key converted to an integer * Check with hasValue(Section, Key) to check before you get into trouble. @@ -399,21 +375,14 @@ public class IniFile implements Enumeration<String> File aFile = new File(m_sFilename); if (aFile.exists()) { - // System.out.println("couldn't find file " + m_sFilename); // TODO: little bit unsafe here, first rename, after write is complete, delete the old. aFile.delete(); if (aFile.exists()) { GlobalLogWriter.println("Couldn't delete the file " + m_sFilename); return; - // DebugHelper.exception(BasicErrorCode.SbERR_INTERNAL_ERROR, "Couldn't delete the file " + m_sFilename); } } - // if (! aFile.canWrite()) - // { - // System.out.println("Couldn't write to file " + m_sFilename); - // DebugHelper.exception(BasicErrorCode.SbERR_INTERNAL_ERROR, ""); - // } try { RandomAccessFile aWriter = new RandomAccessFile(aFile, "rw"); @@ -434,13 +403,11 @@ public class IniFile implements Enumeration<String> { GlobalLogWriter.println("couldn't open file for writing " + m_sFilename); GlobalLogWriter.println("Message: " + fne.getMessage()); - // DebugHelper.exception(BasicErrorCode.SbERR_FILE_NOT_FOUND, ""); } catch (java.io.IOException ie) { GlobalLogWriter.println("Exception occurs while writing to file " + m_sFilename); GlobalLogWriter.println("Message: " + ie.getMessage()); - // DebugHelper.exception(BasicErrorCode.SbERR_INTERNAL_ERROR, ie.getMessage()); } } @@ -504,58 +471,6 @@ public class IniFile implements Enumeration<String> } } - // String replaceEvaluatedValue(String _sSection, String _sValue) - // { - // String sValue = _sValue; - // int nIndex = 0; - // while (( nIndex = sValue.indexOf("$(", nIndex)) >= 0) - // { - // int nNextIndex = sValue.indexOf(")", nIndex); - // if (nNextIndex >= 0) - // { - // String sKey = sValue.substring(nIndex + 2, nNextIndex); - // String sNewValue = getValue(_sSection, sKey); - // if (sNewValue != null && sNewValue.length() > 0) - // { - // String sRegexpKey = "\\$\\(" + sKey + "\\)"; - // sValue = sValue.replaceAll(sRegexpKey, sNewValue); - // } - // nIndex = nNextIndex; - // } - // else - // { - // nIndex += 2; - // } - // } - // return sValue; - // } - - - // public String getLocalEvaluatedValue(String _sSection, String _sKey) - // { - // String sValue = getValue(_sSection, _sKey); - // sValue = replaceEvaluatedValue(_sSection, sValue); - // return sValue; - // } - - - - // this is a special behaviour. - // public String getGlobalLocalEvaluatedValue(String _sSection, String _sKey) - // { - // String sGlobalValue = getKey("global", _sKey); - // String sLocalValue = getKey(_sSection, _sKey); - // if (sLocalValue.length() == 0) - // { - // sGlobalValue = replaceEvaluatedKey(_sSection, sGlobalValue); - // sGlobalValue = replaceEvaluatedKey("global", sGlobalValue); - // return sGlobalValue; - // } - // sLocalValue = replaceEvaluatedKey(_sSection, sLocalValue); - // sLocalValue = replaceEvaluatedKey("global", sLocalValue); - - // return sLocalValue; - // } public void removeSection(String _sSectionToRemove) { // first, search for the name @@ -584,30 +499,8 @@ public class IniFile implements Enumeration<String> /** * some tests for this class */ -// public static void main(String[] args) -// { -// String sTempFile = System.getProperty("java.io.tmpdir"); -// sTempFile += "inifile"; -// IniFile aIniFile = new IniFile(sTempFile); -// String sValue = aIniFile.getValue("Section", "Key"); -// // insert a new value to a already exist section -// aIniFile.insertValue("Section", "Key2", "a new value in a existing section"); -// // replace a value -// aIniFile.insertValue("Section", "Key", "replaced value"); -// // create a new value -// aIniFile.insertValue("New Section", "Key", "a new key value pair"); -// aIniFile.insertValue("New Section", "Key2", "a new second key value pair"); - -// String sValue2 = aIniFile.getValue("Section2", "Key"); - -// aIniFile.removeSection("Section"); -// aIniFile.removeSection("New Section"); - -// aIniFile.close(); -// } - /** * Enumeration Interface * @return true, if there are more Key values diff --git a/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java b/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java index e7bb68cfcde6..42a777ade477 100644 --- a/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java +++ b/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java @@ -60,15 +60,6 @@ public class MSOfficePostscriptCreator implements IOffice { m_aParameterHelper = _aParam; m_sResult = _sResult; -// String sKillCommand = (String)_aParam.getTestParameters().get(util.PropertyName.APP_KILL_COMMAND); -// if (sKillCommand == null) -// { -// sKillCommand = ""; -// } -// if (sKillCommand.length() > 0) -// { -// sKillCommand += ";"; -// } String sKillCommand = "C:/bin/kill.exe -9 winword;C:/bin/kill.exe -9 excel"; _aParam.getTestParameters().put(util.PropertyName.APP_KILL_COMMAND, sKillCommand); } @@ -144,11 +135,6 @@ public class MSOfficePostscriptCreator implements IOffice { return true; } - /* temporal insertion by SUS - if (_sSuffix.endsWith(".xml")) - { - return true; - }*/ return false; } @@ -198,7 +184,6 @@ public class MSOfficePostscriptCreator implements IOffice { // special case, if xml we prefer word, but with DEFAULT_XML_FORMAT_APP=excel it's changeable. String sDocFormat = getXMLDocumentFormat(_sInputFile); - // if (_aGTA.getDefaultXMLFormatApp().toLowerCase().equals("excel")) if (sDocFormat.equals("excel")) { aStartCommand = createExcelStoreHelper(); @@ -207,9 +192,6 @@ public class MSOfficePostscriptCreator implements IOffice { aStartCommand = createWordStoreHelper(); } - // else - // { - // } } else { @@ -225,11 +207,6 @@ public class MSOfficePostscriptCreator implements IOffice sFilterName = ""; // xlXMLSpreadsheet"; } - // String sCommand = sStartCommand + " " + - // _sInputFile + " " + - // StringHelper.doubleQuote(sFilterName) + " " + - // _sOutputFile; - aStartCommand.add(_sInputFile); aStartCommand.add(sFilterName); aStartCommand.add(_sOutputFile); @@ -273,7 +250,6 @@ public class MSOfficePostscriptCreator implements IOffice String sOfficeType = getOfficeType(_sInputFile); // special case, if xml we prefer word, but with DEFAULT_XML_FORMAT_APP=excel it's changeable. - // if (_aGTA.getDefaultXMLFormatApp().toLowerCase().equals("excel")) if (sOfficeType.equals("excel")) { aStartCommand = createExcelPrintHelper(); @@ -302,10 +278,6 @@ public class MSOfficePostscriptCreator implements IOffice sPrinterName = ""; } - // String sCommand = sStartCommand + " " + - // _sInputFile + " " + - // StringHelper.doubleQuote(m_sPrinterName) + " " + - // _sPrintFilename; aStartCommand.add(_sInputFile); aStartCommand.add(m_sPrinterName); aStartCommand.add(_sPrintFilename); @@ -359,8 +331,6 @@ public class MSOfficePostscriptCreator implements IOffice { throw new WrongEnvironmentException("Given list is too short."); } - - // return aHandler.getExitCode(); } @@ -494,8 +464,6 @@ public class MSOfficePostscriptCreator implements IOffice } String sName = aPerlScript.getAbsolutePath(); - // String sCommand = "perl " + sName; - // System.out.println(sCommand); aList.add("perl"); aList.add(sName); return aList; @@ -955,16 +923,12 @@ public class MSOfficePostscriptCreator implements IOffice { // ---- Parse XML file ---- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - // factory.setNamespaceAware( true ); - // factory.setValidating( true ); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse( new File (_sInputFile) ); Node rootNode = document.getDocumentElement(); // ---- Get list of nodes to given tag ---- // document. - // NodeList ndList = document.getElementsByTagName( sToSearch /* argv[2] */ ); - // System.out.println( "\nNode list at the beginning:" ); String sRootNodeName = rootNode.getNodeName(); if (sRootNodeName.equals("w:wordDocument")) { @@ -988,8 +952,4 @@ public class MSOfficePostscriptCreator implements IOffice return sType; } -// public static void main(String [] _args) -// { -// String sTest = getXMLDocumentFormat("c:/cws/temp/input/Blah Fasel.xml"); -// } } diff --git a/qadevOOo/runner/graphical/OpenOfficePostscriptCreator.java b/qadevOOo/runner/graphical/OpenOfficePostscriptCreator.java index 4c04e2249eaa..37cba43a2dc2 100644 --- a/qadevOOo/runner/graphical/OpenOfficePostscriptCreator.java +++ b/qadevOOo/runner/graphical/OpenOfficePostscriptCreator.java @@ -43,7 +43,6 @@ import helper.URLHelper; import helper.PropertyHelper; import helper.OSHelper; -// import helper.Parameter; import java.io.File; /** @@ -158,8 +157,6 @@ public class OpenOfficePostscriptCreator implements IOffice for (int i=0;i<aArgs.length;i++) { PropertyValue aValue = aArgs[i]; - // System.out.print("Property: '" + aValue.Name); - // System.out.println("' := '" + aValue.Value + "'"); if (aValue.Name.equals("FilterName") || aValue.Name.equals("MediaType")) { @@ -198,31 +195,11 @@ public class OpenOfficePostscriptCreator implements IOffice if (aDesktop != null) { GlobalLogWriter.println("com.sun.star.frame.Desktop created."); - // String sInputURL = aCurrentParameter.sInputURL; - // String sOutputURL = aCurrentParameter.sOutputURL; - // String sPrintFileURL = aCurrentParameter.sPrintToFileURL; - // System.out.println(_sInputURL); - - // set here the loadComponentFromURL() properties // at the moment only 'Hidden' is set, so no window is opened at work ArrayList<PropertyValue> aPropertyList = new ArrayList<PropertyValue>(); - // check which properties should set and count it. - // if (_aGTA.isHidden()) - // { - // nPropertyCount ++; - // } - // if (_aGTA.getImportFilterName() != null && _aGTA.getImportFilterName().length() > 0) - // { - // nPropertyCount ++; - // } - - // initialize the propertyvalue - // int nPropertyIndex = 0; - // aProps = new PropertyValue[ nPropertyCount ]; - // set all property values if (_aGTA.isHidden()) { @@ -369,31 +346,10 @@ public class OpenOfficePostscriptCreator implements IOffice -// public boolean storeAsPDF(ParameterHelper _aGTA, -// String _sInputURL, -// String _sOutputURL) -// { -// boolean bBack = false; -// XComponent aDoc = loadFromURL(_aGTA, _sInputURL); - -// if (aDoc == null) -// { -// GlobalLogWriter.println("Can't load document."); -// return bBack; -// } -// bBack = storeAsPDF(_aGTA, aDoc, _sOutputURL); -// FileHelper.createInfoFile(_sOutputURL, _aGTA, "as pdf"); - -// GlobalLogWriter.println("Close document."); -// aDoc.dispose(); -// return bBack; -// } - public boolean storeAsPDF(ParameterHelper _aGTA, XComponent _aDoc, String _sOutputURL) throws OfficeException { - // try { boolean bBack = true; _aGTA.getPerformance().startTime(PerformanceContainer.StoreAsPDF); bBack = exportToPDF(_aDoc, _sOutputURL); @@ -402,7 +358,6 @@ public class OpenOfficePostscriptCreator implements IOffice if (!bBack) { GlobalLogWriter.println("Can't store document as PDF."); -// bBack = false; throw new OfficeException("Can't store document as PDF"); } else @@ -413,50 +368,6 @@ public class OpenOfficePostscriptCreator implements IOffice } - - /** - * print the document found in file (_sInputURL) to as postscript to file (_sPrintFileURL) - * Due to the fact we use a printer to convert the file to postscript, the default printer - * to create such postscript format must be installed, this is not tested here. - * - * @return true, if print has been done. - * Be careful, true means only print returns with no errors, to be sure print is really done - * check existence of _sPrintFileURL - */ - -// public boolean printToFileWithOOo(ParameterHelper _aGTA, -// String _sInputURL, -// String _sOutputURL, -// String _sPrintFileURL) -// { -// // waitInSeconds(1); -// boolean bBack = false; - -// XComponent aDoc = loadFromURL(_aGTA, _sInputURL); -// if (aDoc != null) -// { -// if ( _sInputURL.equals(_sOutputURL) ) -// { -// // don't store document -// // input and output are equal OR -// GlobalLogWriter.println("Warning: Inputpath and Outputpath are equal. Document will not stored again."); -// disallowStore(); -// } -// bBack = impl_printToFileWithOOo(_aGTA, aDoc, _sOutputURL, _sPrintFileURL); - -// GlobalLogWriter.println("Close document."); -// aDoc.dispose(); -// } -// else -// { -// GlobalLogWriter.println("loadDocumentFromURL() failed with document: " + _sInputURL); -// } -// return bBack; -// } - - - - private boolean impl_printToFileWithOOo(ParameterHelper _aGTA, XComponent _aDoc, String _sOutputURL, @@ -488,7 +399,6 @@ public class OpenOfficePostscriptCreator implements IOffice _aGTA.getPerformance().stopTime(PerformanceContainer.Store); GlobalLogWriter.println(DateHelper.getDateTimeForHumanreadableLog() + " Store document done."); - // TimeHelper.waitInSeconds(1, "After store as URL to:" + _sOutputURL); GlobalLogWriter.println("Reload stored file test."); XComponent aDoc = loadFromURL(_aGTA, _sOutputURL); if (aDoc == null) @@ -506,7 +416,6 @@ public class OpenOfficePostscriptCreator implements IOffice { aDoc.dispose(); } - // TimeHelper.waitInSeconds(1, "after close temp document"); } } } @@ -533,27 +442,12 @@ public class OpenOfficePostscriptCreator implements IOffice try { - // System.out.println("Document loaded."); // Change Pagesettings to DIN A4 GlobalLogWriter.println(DateHelper.getDateTimeForHumanreadableLog() + " Print document."); XPrintable aPrintable = UnoRuntime.queryInterface( XPrintable.class, _aDoc); if (aPrintable != null) { - // System.out.println(" Set PaperFormat to DIN A4"); - // { - // PropertyValue[] aPrinterProps = aPrintable.getPrinter(); - // System.out.println("PrinterProps size: " + String.valueOf(aPrinterProps.length)); - // int nPropIndex = 0; - // while (!"PaperFormat".equals(aPrinterProps[nPropIndex].Name)) - // { - // // System.out.println(aPrinterProps[nPropIndex].Name); - // nPropIndex++; - // } - // aPrinterProps[nPropIndex].Value = com.sun.star.view.PaperFormat.A4; - // aPrintable.setPrinter(aPrinterProps); - // } - // configure Office to allow to execute macos // TODO: We need a possibility to set the printer name also for StarOffice/OpenOffice @@ -576,14 +470,6 @@ public class OpenOfficePostscriptCreator implements IOffice // set property values for XPrintable.print() // more can be found at "http://api.libreoffice.org/docs/common/ref/com/sun/star/view/PrintOptions.html" - // int nProperties = 1; // default for 'FileName' property - // if (_aGTA.printAllPages() == false) - // { - // // we don't want to print all pages, build Pages string by ourself - // nProperties ++; - // } - // int nPropsCount = 0; - // If we are a SpreadSheet (calc), we need to set PrintAllSheets property to 'true' XServiceInfo xServiceInfo = UnoRuntime.queryInterface( XServiceInfo.class, _aDoc ); if ( xServiceInfo.supportsService( "com.sun.star.sheet.SpreadsheetDocument" ) ) @@ -599,13 +485,10 @@ public class OpenOfficePostscriptCreator implements IOffice } ArrayList<PropertyValue> aPrintProps = new ArrayList<PropertyValue>(); - // GlobalLogWriter.println("Property FileName:=" + _sPrintFileURL); - // PropertyValue [] aPrintProps = new PropertyValue[nProperties]; PropertyValue Arg = new PropertyValue(); Arg.Name = "FileName"; Arg.Value = _sPrintFileURL; - // aPrintProps[nPropsCount ++] = Arg; aPrintProps.add(Arg); showProperty(Arg); @@ -634,8 +517,6 @@ public class OpenOfficePostscriptCreator implements IOffice showProperty(Arg); } - // GlobalLogWriter.println("Start printing."); - _aGTA.getPerformance().startTime(PerformanceContainer.Print); aPrintable.print(PropertyHelper.createPropertyValueArrayFormArrayList(aPrintProps)); TimeHelper.waitInSeconds(1, "Start waiting for print ready."); @@ -649,7 +530,6 @@ public class OpenOfficePostscriptCreator implements IOffice int nPropIndex = 0; while (!"IsBusy".equals(aPrinterProps[nPropIndex].Name)) { - // System.out.println(aPrinterProps[nPropIndex].Name); nPropIndex++; } isBusy = (aPrinterProps[nPropIndex].Value == Boolean.TRUE); @@ -662,9 +542,6 @@ public class OpenOfficePostscriptCreator implements IOffice throw new com.sun.star.uno.Exception("Convwatch exception, wait too long for printing."); } } -// TODO: -// TimeHelper.waitInSeconds(40, "Start waiting after print ready."); - _aGTA.getPerformance().stopTime(PerformanceContainer.Print); GlobalLogWriter.println(DateHelper.getDateTimeForHumanreadableLog() + " Print document done."); @@ -713,32 +590,22 @@ public class OpenOfficePostscriptCreator implements IOffice { if (! FileHelper.exists(_sAbsoluteInputFile)) { - // throw new ConvWatchCancelException("Input file: " + _sAbsoluteInputFile + " does not exist."); return false; } - // String fs = System.getProperty("file.separator"); - - // String sInputFileURL = URLHelper.getFileURLFromSystemPath(_sAbsoluteInputFile); - String sInputFileBasename = FileHelper.getBasename(_sAbsoluteInputFile); - // String sOutputFileURL = null; String sOutputPath; if (_sAbsoluteOutputPath != null) { sOutputPath = _sAbsoluteOutputPath; - // FileHelper.makeDirectories("", sOutputPath); } else { String sInputPath = FileHelper.getPath(_sAbsoluteInputFile); sOutputPath = sInputPath; } - // sOutputFileURL = URLHelper.getFileURLFromSystemPath(sOutputPath + fs + sInputFileBasename); - // sOutputFileURL = null; String sPrintFilename = FileHelper.getNameNoSuffix(sInputFileBasename); - // String sPrintFileURL; String sAbsolutePrintFilename = FileHelper.appendPath(sOutputPath, sPrintFilename + ".prn"); if (FileHelper.exists(sAbsolutePrintFilename) && _aGTA.getOverwrite() == false) @@ -750,142 +617,6 @@ public class OpenOfficePostscriptCreator implements IOffice } - /** - * create a reference file - * _sAbsoluteInputPath contains the source file, if not exists, return with failure. - * _sAbsoluteOutputPath contains the destination, where the file will store after load with StarOffice/OpenOffice.org - * if is null, print only near the Input file path - * _sPrintType ".prn" Print input file with StarOffice/OpenOffice.org and the default printer as PostScript - * - * @param _aGTA - * @return - */ -// public static boolean buildReference(ParameterHelper _aGTA, -// String _sAbsoluteOutputPath, -// String _sAbsoluteInputFile) -// throws OfficeException -// { -// if (! FileHelper.exists(_sAbsoluteInputFile)) -// { -// throw new OfficeException("buildReference(): Input file: " + _sAbsoluteInputFile + " does not exist."); -// } - -// String fs = System.getProperty("file.separator"); - -// String sInputFileURL = URLHelper.getFileURLFromSystemPath(_sAbsoluteInputFile); - -// String sInputFileBasename = FileHelper.getBasename(_sAbsoluteInputFile); -// String sOutputFileURL = null; -// String sOutputPath; -// if (_sAbsoluteOutputPath != null) -// { -// sOutputPath = _sAbsoluteOutputPath; -// FileHelper.makeDirectories("", sOutputPath); -// } -// else -// { -// String sInputPath = FileHelper.getPath(_sAbsoluteInputFile); -// sOutputPath = sInputPath; -// } -// // sOutputFileURL = URLHelper.getFileURLFromSystemPath(sOutputPath + fs + sInputFileBasename); -// sOutputFileURL = null; - -// String sPrintFilename = FileHelper.getNameNoSuffix(sInputFileBasename); -// String sPrintFileURL; - -// String sAbsolutePrintFilename = sOutputPath + fs + sPrintFilename + ".prn"; -// if (FileHelper.exists(sAbsolutePrintFilename) && _aGTA.getOverwrite() == false) -// { -// GlobalLogWriter.println("Reference already exist, don't overwrite. Set " + PropertyName.DOC_COMPARATOR_OVERWRITE_REFERENCE + "=true to force overwrite."); -// return true; -// } - -// if (_aGTA.getReferenceType().toLowerCase().equals("msoffice")) -// { -// sPrintFileURL = URLHelper.getFileURLFromSystemPath(sAbsolutePrintFilename); -// } -// else if (_aGTA.getReferenceType().toLowerCase().equals("pdf")) -// { -//// TODO: If we rename the stored file to *.pdf, we have to be sure that we use *.pdf also as a available reference -// sPrintFileURL = URLHelper.getFileURLFromSystemPath(sAbsolutePrintFilename ); -// } -// else if (_aGTA.getReferenceType().toLowerCase().equals("ooo")) -// { -// sPrintFileURL = URLHelper.getFileURLFromSystemPath(sAbsolutePrintFilename ); -// } -// else -// { -// GlobalLogWriter.println("OfficePrint.buildreference(): Unknown print type."); -// return false; -// } -// return printToFile(_aGTA, sInputFileURL, sOutputFileURL, sPrintFileURL); -// } - - - - // TODO: Das Teil muss hier raus! - - -// public static boolean printToFile(ParameterHelper _aGTA, -// String _sInputFileURL, -// String _sOutputFileURL, -// String _sPrintFileURL) throws OfficeException -// { -// boolean bBack = false; -// String sPrintFileURL = null; - - -// // remember the current timer, to know how long a print process need. -// // startTimer(); - -// if (_aGTA.getReferenceType().toLowerCase().equals("ooo")) -// { -// bBack = printToFileWithOOo(_aGTA, _sInputFileURL, _sOutputFileURL, _sPrintFileURL); -// } -// else if (_aGTA.getReferenceType().toLowerCase().equals("pdf")) -// { -// GlobalLogWriter.println("USE PDF AS EXPORT FORMAT."); -// bBack = storeAsPDF(_aGTA, _sInputFileURL, _sPrintFileURL); -// } -// else if (_aGTA.getReferenceType().toLowerCase().equals("msoffice")) -// { -// if (MSOfficePostscriptCreator.isMSOfficeDocumentFormat(_sInputFileURL)) -// { -// GlobalLogWriter.println("USE MSOFFICE AS EXPORT FORMAT."); -// MSOfficePostscriptCreator a = new MSOfficePostscriptCreator(); -// try -// { -// a.printToFileWithMSOffice(_aGTA, FileHelper.getSystemPathFromFileURL(_sInputFileURL), -// FileHelper.getSystemPathFromFileURL(_sPrintFileURL)); -// } -// catch(OfficeException e) -// { -// e.printStackTrace(); -// GlobalLogWriter.println(e.getMessage()); -// throw new OfficeException("Exception caught. Problem with MSOffice printer methods."); -// } -// catch(java.io.IOException e) -// { -// GlobalLogWriter.println(e.getMessage()); -// throw new OfficeException("IOException caught. Problem with MSOffice printer methods."); -// } -// bBack = true; -// } -// else -// { -// GlobalLogWriter.println("This document type is not recognized as MSOffice format, as default fallback StarOffice/OpenOffice.org instead is used."); -// bBack = printToFileWithOOo(_aGTA, _sInputFileURL, _sOutputFileURL, _sPrintFileURL); -// } -// } -// else -// { -// // System.out.println(""); -// throw new OfficeException("OfficePrint.printToFile(): Unknown print type."); -// } -// return bBack; -// } - - // TODO: move this away! void showType(String _sInputURL, XMultiServiceFactory _xMSF) @@ -924,7 +655,6 @@ public class OpenOfficePostscriptCreator implements IOffice { if (_sFilterName.length() == 0) { - // System.out.println("No FilterName set."); return null; } @@ -933,7 +663,6 @@ public class OpenOfficePostscriptCreator implements IOffice GlobalLogWriter.println("MultiServiceFactory not set."); return null; } - // XFilterFactory aFilterFactory = null; Object aObj = null; try { @@ -950,18 +679,6 @@ public class OpenOfficePostscriptCreator implements IOffice if (aNameAccess != null) { - // if (_sFilterName.toLowerCase().equals("help")) - // { - // System.out.println("Show all possible ElementNames from current version." ); - // String[] aElementNames = aNameAccess.getElementNames(); - // for (int i = 0; i<aElementNames.length; i++) - // { - // System.out.println(aElementNames[i]); - // } - // System.out.println("Must quit."); - // System.out.exit(1); - // } - if (! aNameAccess.hasByName(_sFilterName)) { GlobalLogWriter.println("FilterFactory.hasByName() says there exist no '" + _sFilterName + "'" ); @@ -975,15 +692,12 @@ public class OpenOfficePostscriptCreator implements IOffice if (aElements != null) { String sInternalFilterName = null; - // System.out.println("getByName().length: " + String.valueOf(aElements.length)); for (int i=0;i<aElements.length; i++) { PropertyValue aPropertyValue = (PropertyValue)aElements[i]; - // System.out.println("PropertyValue.Name: " + aPropertyValue.Name); if (aPropertyValue.Name.equals("Type")) { String sValue = (String)aPropertyValue.Value; - // System.out.println("Type: " + sValue); sInternalFilterName = sValue; } } @@ -1014,7 +728,6 @@ public class OpenOfficePostscriptCreator implements IOffice { if (_sFilterName.length() == 0) { - // System.out.println("No FilterName set."); return null; } @@ -1023,7 +736,6 @@ public class OpenOfficePostscriptCreator implements IOffice GlobalLogWriter.println("MultiServiceFactory not set."); return null; } - // XFilterFactory aFilterFactory = null; Object aObj = null; try { @@ -1052,14 +764,12 @@ public class OpenOfficePostscriptCreator implements IOffice if (aElements != null) { String sServiceName = null; - // System.out.println("getByName().length: " + String.valueOf(aElements.length)); for (int i=0;i<aElements.length; i++) { PropertyValue aPropertyValue = (PropertyValue)aElements[i]; if (aPropertyValue.Name.equals("DocumentService")) { String sValue = (String)aPropertyValue.Value; - // System.out.println("DocumentService: " + sValue); sServiceName = sValue; break; } @@ -1090,7 +800,6 @@ public class OpenOfficePostscriptCreator implements IOffice { if (_sInternalFilterName.length() == 0) { - // System.out.println("No FilterName set."); return null; } @@ -1116,13 +825,6 @@ public class OpenOfficePostscriptCreator implements IOffice if (aNameAccess != null) { - // System.out.println("Show ElementNames" ); - // String[] aElementNames = aNameAccess.getElementNames(); - // for (int i = 0; i<aElementNames.length; i++) - // { - // System.out.println(aElementNames[i]); - // } - if (! aNameAccess.hasByName(_sInternalFilterName)) { GlobalLogWriter.println("TypeDetection.hasByName() says there exist no '" + _sInternalFilterName + "'" ); @@ -1137,11 +839,9 @@ public class OpenOfficePostscriptCreator implements IOffice if (aElements != null) { String sExtension = null; - // System.out.println("getByName().length: " + String.valueOf(aElements.length)); for (int i=0;i<aElements.length; i++) { PropertyValue aPropertyValue = (PropertyValue)aElements[i]; - // System.out.println("PropertyValue.Name: " + aPropertyValue.Name); if (aPropertyValue.Name.equals("Extensions")) { aExtensions = (String[])aPropertyValue.Value; @@ -1189,7 +889,6 @@ public class OpenOfficePostscriptCreator implements IOffice } String sInputURL = URLHelper.getFileURLFromSystemPath(_sInputFile); - // showType(sInputURL, xMSF); XComponent aDoc = loadFromURL( _aGTA, sInputURL); if (aDoc == null) { @@ -1208,12 +907,8 @@ public class OpenOfficePostscriptCreator implements IOffice GlobalLogWriter.println("It's not allowed to store, check Input/Output path."); return; } -// TODO: Do we need to wait? -// TimeHelper.waitInSeconds(1, "wait after loadFromURL."); XServiceInfo xServiceInfo = UnoRuntime.queryInterface( XServiceInfo.class, aDoc ); - // String sFilter = getFilterName_forExcel(xServiceInfo); - // System.out.println("Filter is " + sFilter); // store the document in an other directory XStorable xStorable = UnoRuntime.queryInterface( XStorable.class, aDoc); @@ -1225,9 +920,6 @@ public class OpenOfficePostscriptCreator implements IOffice String sFilterName = _aGTA.getExportFilterName(); - // initialize PropertyArray - // PropertyValue [] aStoreProps = new PropertyValue[ nPropertyCount ]; - // int nPropertyIndex = 0; ArrayList<PropertyValue> aPropertyList = new ArrayList<PropertyValue>(); String sExtension = ""; @@ -1270,7 +962,6 @@ public class OpenOfficePostscriptCreator implements IOffice PropertyValue Arg = new PropertyValue(); Arg.Name = "FilterName"; Arg.Value = sFilterName; - // aStoreProps[nPropertyIndex ++] = Arg; aPropertyList.add(Arg); showProperty(Arg); GlobalLogWriter.println("FilterName is set to: " + sFilterName); @@ -1281,9 +972,7 @@ public class OpenOfficePostscriptCreator implements IOffice { // create the new filename with the extension, which is ok to the file format String sInputFileBasename = FileHelper.getBasename(_sInputFile); - // System.out.println("InputFileBasename " + sInputFileBasename); String sInputFileNameNoSuffix = FileHelper.getNameNoSuffix(sInputFileBasename); - // System.out.println("InputFilename no suffix " + sInputFileNameNoSuffix); String fs = System.getProperty("file.separator"); String sOutputFile = _sOutputPath; if (! sOutputFile.endsWith(fs)) @@ -1315,38 +1004,12 @@ public class OpenOfficePostscriptCreator implements IOffice { GlobalLogWriter.println("Can't store document '" + sOutputURL + "'. Message is :'" + e.getMessage() + "'"); } -// TODO: Do we need to wait? -// TimeHelper.waitInSeconds(1, "unknown in OfficePrint.convertDocument()"); } - /** - * - * @return false, if 'NoOffice=yes' is given - */ -// private boolean shouldOfficeStart() -// { -// String sNoOffice = (String)m_aParameterHelper.getTestParameters().get( "NoOffice" ); -// if (sNoOffice != null) -// { -// if (sNoOffice.toLowerCase().startsWith("t") || sNoOffice.toLowerCase().startsWith("y")) -// { -// return false; -// } -// } -// return true; -// } - OfficeProvider m_aProvider = null; private void startOffice() { - // SimpleFileSemaphore aSemaphore = new SimpleFileSemaphore(); -// if (shouldOfficeStart()) -// { - // if (OSHelper.isWindows()) - // { - // aSemaphore.P(aSemaphore.getSemaphoreFile()); - // } m_aParameterHelper.getTestParameters().put(util.PropertyName.DONT_BACKUP_USERLAYER, Boolean.TRUE); m_aParameterHelper.getPerformance().startTime(PerformanceContainer.OfficeStart); @@ -1356,9 +1019,7 @@ public class OpenOfficePostscriptCreator implements IOffice m_aParameterHelper.getPerformance().stopTime(PerformanceContainer.OfficeStart); long nStartTime = m_aParameterHelper.getPerformance().getTime(PerformanceContainer.OfficeStart); - // aGTA = getParameterHelper(); // get new TestArguments m_aParameterHelper.getPerformance().setTime(PerformanceContainer.OfficeStart, nStartTime); -// } // Watcher Object is need in log object to give a simple way to say if a running office is alive. // As long as a log comes, it pings the Watcher and says the office is alive, if not an @@ -1381,13 +1042,6 @@ public class OpenOfficePostscriptCreator implements IOffice { m_aProvider.closeExistingOffice(m_aParameterHelper.getTestParameters(), true); } - // if (OSHelper.isWindows()) - // { - // aSemaphore.V(aSemaphore.getSemaphoreFile()); - // aSemaphore.sleep(2); - // // wait some time maybe an other process will take the semaphore - // // I know, this is absolutely dirty, but the whole convwatch is dirty and need a big cleanup. - // } } } @@ -1400,7 +1054,6 @@ public class OpenOfficePostscriptCreator implements IOffice public boolean isStoreAllowed() { return false; - // return m_bStoreFile; } } diff --git a/qadevOOo/runner/graphical/ParameterHelper.java b/qadevOOo/runner/graphical/ParameterHelper.java index ac8c6eeffec0..3ca201ff276e 100644 --- a/qadevOOo/runner/graphical/ParameterHelper.java +++ b/qadevOOo/runner/graphical/ParameterHelper.java @@ -65,8 +65,6 @@ public class ParameterHelper */ private String m_sReferenceType = null; - // private String m_sTargetFrameName = "_blank"; - private String m_sPrinterName = null; private int m_nResolutionInDPI = 180; @@ -75,18 +73,12 @@ public class ParameterHelper private String m_sInputPath = null; private String m_sOutputPath = null; -// private String m_sReferencePath = null; private TestParameters m_aCurrentParams; - // private GlobalLogWriter m_aLog; - public ParameterHelper(TestParameters param) { m_aCurrentParams = param; - // m_aLog = log; - // interpretReferenceType(); - // interpretPrinterName(); } @@ -133,24 +125,6 @@ public class ParameterHelper return m_sOutputPath; } -// public String getReferencePath() -// { -// if (m_sReferencePath == null) -// { -// String sReferencePath = (String)getTestParameters().get( PropertyName.DOC_COMPARATOR_REFERENCE_PATH ); -// if (sReferencePath == null || sReferencePath.length() == 0) -// { -// GlobalLogWriter.println("Please set reference path (path to reference documents) " + PropertyName.DOC_COMPARATOR_REFERENCE_PATH + "=path."); -// } -// else -// { -// m_sReferencePath = sReferencePath; -// } -// } -// return m_sReferencePath; -// } - - public boolean isIncludeSubDirectories() { m_bIncludeSubdirectories = true; @@ -183,7 +157,6 @@ public class ParameterHelper } else { - // log.println("found REFERENCE_TYPE " + sReferenceType ); m_sReferenceType = sReferenceType; } } @@ -203,7 +176,6 @@ public class ParameterHelper } else { - // log.println("found PRINTER_NAME " + sPrinterName ); m_sPrinterName = sPrinterName; } } @@ -232,7 +204,6 @@ public class ParameterHelper public String getBuildID() { String sAPP = (String)m_aCurrentParams.get(util.PropertyName.APP_EXECUTION_COMMAND); - // return getBuildID(sAPP); // TODO: here we need the getBuildID(string) method String sBuildID = BuildID.getBuildID(sAPP); return sBuildID; @@ -322,27 +293,6 @@ public class ParameterHelper } -// String m_sDefaultXMLFormatApplication = null; -// public String getDefaultXMLFormatApp() -// { -// if (m_sDefaultXMLFormatApplication == null) -// { -// // DEFAULT_XML_FORMAT_APP ------ - -// String sDefaultXMLFormatApp = (String)m_aCurrentParams.get( PropertyName.DOC_COMPARATOR_DEFAULT_XML_FORMAT_APP ); -// if (sDefaultXMLFormatApp == null || sDefaultXMLFormatApp.length() == 0) -// { -// m_sDefaultXMLFormatApplication = "word"; -// } -// else -// { -// m_sDefaultXMLFormatApplication = sDefaultXMLFormatApp; -// } -// } -// return m_sDefaultXMLFormatApplication; -// } - - // Pages ------------------------------------------------------------------- /** diff --git a/qadevOOo/runner/graphical/PerformanceContainer.java b/qadevOOo/runner/graphical/PerformanceContainer.java index 26c9d39cfced..f4b4b4e5b426 100644 --- a/qadevOOo/runner/graphical/PerformanceContainer.java +++ b/qadevOOo/runner/graphical/PerformanceContainer.java @@ -19,13 +19,8 @@ package graphical; import java.io.File; -// import java.io.FileWriter; -// import java.io.OutputStream; -// import java.io.PrintStream; import java.io.PrintStream; import java.io.RandomAccessFile; -// import java.io.StringWriter; -// import java.lang.Double; public class PerformanceContainer /* extends *//* implements */ { @@ -115,8 +110,6 @@ public class PerformanceContainer /* extends *//* implements */ { public void print(PrintStream out) { - // String ls = System.getProperty("line.separator"); - // out. out.println("loadtime=" + String.valueOf(m_nTime[ Load ])); out.println("storetime=" + String.valueOf(m_nTime[ Store ])); out.println("printtime=" + String.valueOf(m_nTime[ Print ])); @@ -128,8 +121,6 @@ public class PerformanceContainer /* extends *//* implements */ { public void print(IniFile _aIniFile, String _sSection) { - // String ls = System.getProperty("line.separator"); - // out. _aIniFile.insertValue(_sSection, "loadtime" , String.valueOf(m_nTime[ Load ])); _aIniFile.insertValue(_sSection, "storetime" , String.valueOf(m_nTime[ Store ])); _aIniFile.insertValue(_sSection, "printtime" , String.valueOf(m_nTime[ Print ])); @@ -243,17 +234,4 @@ public class PerformanceContainer /* extends *//* implements */ { } } -// public static void main(String[] args) -// { -// BorderRemover a = new BorderRemover(); -// try -// { -// a.createNewImageWithoutBorder(args[0], args[1]); -// } -// catch(java.io.IOException e) -// { -// System.out.println("Exception caught."); -// } - -// } } diff --git a/qadevOOo/runner/graphical/PixelCounter.java b/qadevOOo/runner/graphical/PixelCounter.java index 69c1b232b67d..10dab09451d9 100644 --- a/qadevOOo/runner/graphical/PixelCounter.java +++ b/qadevOOo/runner/graphical/PixelCounter.java @@ -32,7 +32,6 @@ class CountNotWhite extends CountPixel { public CountNotWhite() { - // System.out.println("CountWhite()"); } public void countold(final int pixel) @@ -42,7 +41,6 @@ class CountNotWhite extends CountPixel final int green = (pixel >> 8) & 0xff; final int blue = (pixel ) & 0xff; - // System.out.println(String.valueOf(red) + ":" + String.valueOf(green) + ":" + String.valueOf(blue)); if (red == 0xff && green == 0xff && blue == 0xff) { return; @@ -78,7 +76,6 @@ class CountNotBlack extends CountPixel { public CountNotBlack() { - // System.out.println("CountBlack()"); } public void countold(final int pixel) @@ -121,38 +118,10 @@ class CountNotBlack extends CountPixel class graphics_stuff { -// public int stuff() -// { -//// (1) decoding -// int rgba = 0; // ...; // comes from PixelGrabber, BufferedImage.getRGB etc. -// int red = (rgba >> 16) & 0xff; -// int green = (rgba >> 8) & 0xff; -// int blue = rgba & 0xff; -// int alpha = (rgba >> 24) & 0xff; -//// (2) now modify red, green, blue and alpha as you like; -//// make sure that each of the four values stays in the -//// interval 0 to 255 -//// ... -//// (3) and encode back to an int, e.g. to give it to MemoryImageSource or -//// BufferedImage.setRGB -// rgba = (alpha << 24) | (red << 16) | (green << 8) | blue; -// return 0; -// } - -// public static void handlesinglepixel(int x, int y, int pixel) -// { -// int alpha = (pixel >> 24) & 0xff; -// int red = (pixel >> 16) & 0xff; -// int green = (pixel >> 8) & 0xff; -// int blue = (pixel ) & 0xff; -// // Deal with the pixel as necessary... -// } - public static void countPixel(ImageHelper img, int _x, int _y, int _w, int _h, CountPixel _aPixelCounter) { for (int y = 0; y < _h; y++) { for (int x = 0; x < _w; x++) { - // handlesinglepixel(x+i, y+j, pixels[j * w + i]); _aPixelCounter.count(img.getPixel(x,y)); } } @@ -181,9 +150,6 @@ class graphics_stuff public class PixelCounter { - // private Image m_aImage; - // ImageHelper m_aImage; - public int countNotWhitePixel(String _sFile) throws java.io.IOException @@ -216,23 +182,6 @@ public class PixelCounter { } - -// public static void main(String[] args) { - -// String a = helper.StringHelper.createValueString(10, 4); -// int dummy = 1; -// -// BorderRemover a = new BorderRemover(); -// try -// { -// a.createNewImageWithoutBorder(args[0], args[1]); -// } -// catch(java.io.IOException e) -// { -// System.out.println("Exception caught."); -// } -// */ -// } } |