summaryrefslogtreecommitdiff
path: root/qadevOOo/runner/graphical
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-08-13 10:08:31 +0200
committerNoel Grandin <noel@peralex.com>2014-08-13 10:24:10 +0200
commit34bcf9b498bccb5c924f4cec850ff15d88df6f07 (patch)
tree4d9604ec8c3b73639338ec45a0618b5daa5cf0ed /qadevOOo/runner/graphical
parent347926e8e57c1825261daa46c1886aa2ebf9571b (diff)
java: remove dead methods
found by UCDetector Change-Id: I219caa8e680dba5a395541a778df6144841c4dde
Diffstat (limited to 'qadevOOo/runner/graphical')
-rw-r--r--qadevOOo/runner/graphical/BuildID.java21
-rw-r--r--qadevOOo/runner/graphical/DirectoryHelper.java8
-rw-r--r--qadevOOo/runner/graphical/FileHelper.java63
-rw-r--r--qadevOOo/runner/graphical/IniFile.java5
-rw-r--r--qadevOOo/runner/graphical/JPEGCreator.java10
-rw-r--r--qadevOOo/runner/graphical/MSOfficePostscriptCreator.java50
-rw-r--r--qadevOOo/runner/graphical/OpenOfficePostscriptCreator.java196
-rw-r--r--qadevOOo/runner/graphical/PixelCounter.java24
8 files changed, 9 insertions, 368 deletions
diff --git a/qadevOOo/runner/graphical/BuildID.java b/qadevOOo/runner/graphical/BuildID.java
index 2a83aa9ce2c3..1e08fb8c20bc 100644
--- a/qadevOOo/runner/graphical/BuildID.java
+++ b/qadevOOo/runner/graphical/BuildID.java
@@ -139,25 +139,8 @@ public class BuildID
return sBuildID;
}
- public static String getMinor(String _sOfficePath)
- {
- final String sOfficePath = getOfficePath(_sOfficePath);
- final String sMinor = "m" + getBuildID(sOfficePath, "ProductMinor");
- return sMinor;
- }
- public static String getCWSName(String _sOfficePath)
- {
- final String sOfficePath = getOfficePath(_sOfficePath);
- final String sBuildID = getBuildID(sOfficePath, "buildid");
- String sCWSName = "MWS";
- int nIdx = sBuildID.indexOf("[CWS:");
- if (nIdx > 0)
- {
- int nIdx2 = sBuildID.indexOf("]", nIdx);
- sCWSName = sBuildID.substring(nIdx + 5, nIdx2);
- }
- return sCWSName;
- }
+
+
}
diff --git a/qadevOOo/runner/graphical/DirectoryHelper.java b/qadevOOo/runner/graphical/DirectoryHelper.java
index a52add895a0b..2acb91154ae8 100644
--- a/qadevOOo/runner/graphical/DirectoryHelper.java
+++ b/qadevOOo/runner/graphical/DirectoryHelper.java
@@ -72,13 +72,7 @@ public class DirectoryHelper
return a.m_aFileList.toArray();
}
- public static Object[] traverse( String _sDirectory, boolean _bRecursiveIsAllowed )
- {
- DirectoryHelper a = new DirectoryHelper();
- a.setRecursiveIsAllowed(_bRecursiveIsAllowed);
- a.traverse_impl(_sDirectory, null);
- return a.m_aFileList.toArray();
- }
+
private void traverse_impl( String afileDirectory, FileFilter _aFileFilter )
{
diff --git a/qadevOOo/runner/graphical/FileHelper.java b/qadevOOo/runner/graphical/FileHelper.java
index bee04eb64622..440e6273743a 100644
--- a/qadevOOo/runner/graphical/FileHelper.java
+++ b/qadevOOo/runner/graphical/FileHelper.java
@@ -44,12 +44,7 @@ public class FileHelper
}
- public static void MessageBox(String _sStr)
- {
- String sVersion = System.getProperty("java.version");
- String sOSName = System.getProperty("os.name");
- JOptionPane.showMessageDialog( null, _sStr, sVersion + " " + sOSName + " Hello World Debugger", JOptionPane.INFORMATION_MESSAGE );
- }
+
public static boolean exists(String _sFile)
{
@@ -66,27 +61,7 @@ public class FileHelper
return false;
}
- public static boolean isDir(String _sDir)
- {
- if (_sDir == null)
- {
- return false;
- }
- try
- {
- File aFile = new File(_sDir);
- if (aFile.exists() && aFile.isDirectory())
- {
- return true;
- }
- }
- catch (NullPointerException e)
- {
- GlobalLogWriter.println("Exception caught. FileHelper.isDir('" + _sDir + "')");
- e.printStackTrace();
- }
- return false;
- }
+
public static String getBasename(String _sFilename)
{
@@ -456,33 +431,7 @@ public class FileHelper
};
return aFileFilter;
}
- /**
- * Within the directory run through, it's possible to say which file extension types should not
- * consider like '*.ini' because it's not a document.
- *
- * @return a FileFilter function
- */
- public static FileFilter getFileFilterINI()
- {
- FileFilter aFileFilter = new FileFilter()
- {
- public boolean accept( File pathname )
- {
- String sPathname = pathname.getName().toLowerCase();
- if (sPathname.endsWith("index.ini"))
- {
- // don't consider the index.ini file
- return false;
- }
- if (sPathname.endsWith(".ini"))
- {
- return true;
- }
- return false;
- }
- };
- return aFileFilter;
- }
+
public static String appendPath(String _sPath, String _sRelativePathToAdd)
{
@@ -616,12 +565,6 @@ public class FileHelper
aIniFile.close();
}
- public static void addBasenameToPostscript(String _sOutputFilename)
- {
- String sIndexFilename = FileHelper.appendPath(_sOutputFilename, "postscript.ini");
- 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");
diff --git a/qadevOOo/runner/graphical/IniFile.java b/qadevOOo/runner/graphical/IniFile.java
index b2508b173c38..326365adb832 100644
--- a/qadevOOo/runner/graphical/IniFile.java
+++ b/qadevOOo/runner/graphical/IniFile.java
@@ -409,10 +409,7 @@ public class IniFile implements Enumeration<String>
insertValue(_sSection, _sKey, String.valueOf(_nValue));
}
- public void insertValue(String _sSection, String _sKey, long _nValue)
- {
- insertValue(_sSection, _sKey, String.valueOf(_nValue));
- }
+
/**
insert a value
diff --git a/qadevOOo/runner/graphical/JPEGCreator.java b/qadevOOo/runner/graphical/JPEGCreator.java
index 6d9c5c698d37..c33b09632850 100644
--- a/qadevOOo/runner/graphical/JPEGCreator.java
+++ b/qadevOOo/runner/graphical/JPEGCreator.java
@@ -31,17 +31,7 @@ public class JPEGCreator extends EnhancedComplexTestCase
return new String[]{"PostscriptOrPDFToJPEG"};
}
- /**
- * test function.
- */
- public void PostscriptOrPDFToJPEG()
- {
- GlobalLogWriter.set(log);
- ParameterHelper aParam = new ParameterHelper(param);
- // run through all documents found in Inputpath
- foreachPSorPDFinInputPath(aParam);
- }
public void checkOneFile(String _sDocumentName, String _sResult, ParameterHelper _aParams) throws OfficeException
diff --git a/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java b/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java
index 2132297f893d..13db6222dbee 100644
--- a/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java
+++ b/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java
@@ -162,57 +162,7 @@ public class MSOfficePostscriptCreator implements IOffice
return false;
}
- public void storeToFileWithMSOffice( ParameterHelper _aGTA,
- String _sInputFile,
- String _sOutputFile) throws OfficeException, java.io.IOException
- {
- String sDocumentSuffix = FileHelper.getSuffix(_sInputFile);
- String sFilterName = _aGTA.getExportFilterName();
- ArrayList<String> aStartCommand = new ArrayList<String>();
- if (isWordDocument(sDocumentSuffix))
- {
- aStartCommand = createWordStoreHelper();
- }
- else if (isExcelDocument(sDocumentSuffix))
- {
- aStartCommand = createExcelStoreHelper();
- }
- else if (isPowerPointDocument(sDocumentSuffix))
- {
- }
- else if (sDocumentSuffix.toLowerCase().equals(".xml"))
- {
- // special case, if xml we prefer word, but with DEFAULT_XML_FORMAT_APP=excel it's changeable.
- String sDocFormat = getXMLDocumentFormat(_sInputFile);
- if (sDocFormat.equals("excel"))
- {
- aStartCommand = createExcelStoreHelper();
- }
- else
- {
- aStartCommand = createWordStoreHelper();
- }
- }
- else
- {
- GlobalLogWriter.println("No Microsoft Office document format found.");
- throw new WrongSuffixException("No MS office document format found.");
- }
- if (aStartCommand != null)
- {
- if (sFilterName == null)
- {
-// TODO: hardcoded FilterName in perl script
- sFilterName = ""; // xlXMLSpreadsheet";
- }
-
- aStartCommand.add(_sInputFile);
- aStartCommand.add(sFilterName);
- aStartCommand.add(_sOutputFile);
- realStartCommand(aStartCommand);
- }
- }
/**
diff --git a/qadevOOo/runner/graphical/OpenOfficePostscriptCreator.java b/qadevOOo/runner/graphical/OpenOfficePostscriptCreator.java
index 4408b527a1f6..126c3b78b20a 100644
--- a/qadevOOo/runner/graphical/OpenOfficePostscriptCreator.java
+++ b/qadevOOo/runner/graphical/OpenOfficePostscriptCreator.java
@@ -576,74 +576,12 @@ public class OpenOfficePostscriptCreator implements IOffice
}
- /**
- * @return true, if the reference (*.prrn file) based on given output path and given input path exist.
- * If OVERWRITE_REFERENCE is set, always return false.
- */
- public boolean isReferenceExists(ParameterHelper _aGTA,
- String _sAbsoluteOutputPath,
- String _sAbsoluteInputFile)
- {
- if (! FileHelper.exists(_sAbsoluteInputFile))
- {
- return false;
- }
- String sInputFileBasename = FileHelper.getBasename(_sAbsoluteInputFile);
- String sOutputPath;
- if (_sAbsoluteOutputPath != null)
- {
- sOutputPath = _sAbsoluteOutputPath;
- }
- else
- {
- String sInputPath = FileHelper.getPath(_sAbsoluteInputFile);
- sOutputPath = sInputPath;
- }
-
- String sPrintFilename = FileHelper.getNameNoSuffix(sInputFileBasename);
-
- String sAbsolutePrintFilename = FileHelper.appendPath(sOutputPath, 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;
- }
- return false;
- }
// TODO: move this away!
- void showType(String _sInputURL, XMultiServiceFactory _xMSF)
- {
- if (_sInputURL.length() == 0)
- {
- return;
- }
- if (_xMSF == null)
- {
- GlobalLogWriter.println("MultiServiceFactory not set.");
- return;
- }
- XTypeDetection aTypeDetection = null;
- try
- {
- Object oObj = _xMSF.createInstance("com.sun.star.document.TypeDetection");
- aTypeDetection = UnoRuntime.queryInterface(XTypeDetection.class, oObj);
- }
- catch(com.sun.star.uno.Exception e)
- {
- GlobalLogWriter.println("Can't get com.sun.star.document.TypeDetection.");
- return;
- }
- if (aTypeDetection != null)
- {
- String sType = aTypeDetection.queryTypeByURL(_sInputURL);
- GlobalLogWriter.println("Type is: " + sType);
- }
- }
@@ -875,133 +813,7 @@ public class OpenOfficePostscriptCreator implements IOffice
}
- public void convertDocument(String _sInputFile, String _sOutputPath, ParameterHelper _aGTA)
- {
- XMultiServiceFactory xMSF = _aGTA.getMultiServiceFactory();
- if (xMSF == null)
- {
- GlobalLogWriter.println("MultiServiceFactory in GraphicalTestArgument not set.");
- return;
- }
-
- String sInputURL = URLHelper.getFileURLFromSystemPath(_sInputFile);
- XComponent aDoc = loadFromURL( _aGTA, sInputURL);
- if (aDoc == null)
- {
- GlobalLogWriter.println("Can't load document '"+ sInputURL + "'");
- return;
- }
-
- if (_sOutputPath == null)
- {
- GlobalLogWriter.println("Outputpath not set.");
- return;
- }
-
- if (! isStoreAllowed())
- {
- GlobalLogWriter.println("It's not allowed to store, check Input/Output path.");
- return;
- }
-
- XServiceInfo xServiceInfo = UnoRuntime.queryInterface( XServiceInfo.class, aDoc );
-
- // store the document in an other directory
- XStorable xStorable = UnoRuntime.queryInterface( XStorable.class, aDoc);
- if (xStorable == null)
- {
- GlobalLogWriter.println("com.sun.star.frame.XStorable is null");
- return;
- }
- String sFilterName = _aGTA.getExportFilterName();
-
- ArrayList<PropertyValue> aPropertyList = new ArrayList<PropertyValue>();
-
- String sExtension = "";
-
- if (sFilterName != null && sFilterName.length() > 0)
- {
- String sInternalFilterName = getInternalFilterName(sFilterName, xMSF);
- String sServiceName = getServiceNameFromFilterName(sFilterName, xMSF);
-
- GlobalLogWriter.println("Filter detection:");
- // check if service name from file filter is the same as from the loaded document
- boolean bServiceFailed = false;
- if (sServiceName == null || sInternalFilterName == null)
- {
- GlobalLogWriter.println("Given FilterName '" + sFilterName + "' seems to be unknown.");
- bServiceFailed = true;
- }
- if (! xServiceInfo.supportsService(sServiceName))
- {
- GlobalLogWriter.println("Service from FilterName '" + sServiceName + "' is not supported by loaded document.");
- bServiceFailed = true;
- }
- if (bServiceFailed == true)
- {
- GlobalLogWriter.println("Please check '" + PropertyName.DOC_CONVERTER_EXPORT_FILTER_NAME + "' in the property file.");
- return;
- }
-
- if (sInternalFilterName != null && sInternalFilterName.length() > 0)
- {
- // get the FileExtension, by the filter name, if we don't get a file extension
- // we assume the is also no right filter name.
- sExtension = getFileExtension(sInternalFilterName, xMSF);
- if (sExtension == null)
- {
- GlobalLogWriter.println("Can't found an extension for filtername, take it from the source.");
- }
- }
-
- PropertyValue Arg = new PropertyValue();
- Arg.Name = "FilterName";
- Arg.Value = sFilterName;
- aPropertyList.add(Arg);
- showProperty(Arg);
- GlobalLogWriter.println("FilterName is set to: " + sFilterName);
- }
-
- String sOutputURL = "";
- try
- {
- // create the new filename with the extension, which is ok to the file format
- String sInputFileBasename = FileHelper.getBasename(_sInputFile);
- String sInputFileNameNoSuffix = FileHelper.getNameNoSuffix(sInputFileBasename);
- String fs = System.getProperty("file.separator");
- String sOutputFile = _sOutputPath;
- if (! sOutputFile.endsWith(fs))
- {
- sOutputFile += fs;
- }
- if (sExtension != null && sExtension.length() > 0)
- {
- sOutputFile += sInputFileNameNoSuffix + "." + sExtension;
- }
- else
- {
- sOutputFile += sInputFileBasename;
- }
-
- if (FileHelper.exists(sOutputFile) && _aGTA.getOverwrite() == false)
- {
- GlobalLogWriter.println("File already exist, don't overwrite. Set " + PropertyName.DOC_COMPARATOR_OVERWRITE_REFERENCE + "=true to force overwrite.");
- return;
- }
-
- sOutputURL = URLHelper.getFileURLFromSystemPath(sOutputFile);
-
- GlobalLogWriter.println("Store document as '" + sOutputURL + "'");
- xStorable.storeAsURL(sOutputURL, PropertyHelper.createPropertyValueArrayFormArrayList(aPropertyList));
- GlobalLogWriter.println("Document stored.");
- }
- catch (com.sun.star.io.IOException e)
- {
- GlobalLogWriter.println("Can't store document '" + sOutputURL + "'. Message is :'" + e.getMessage() + "'");
- }
-
- }
private OfficeProvider m_aProvider = null;
private void startOffice()
@@ -1041,12 +853,8 @@ public class OpenOfficePostscriptCreator implements IOffice
}
}
- public void disallowStore()
- {
- }
- public void allowStore()
- {
- }
+
+
public boolean isStoreAllowed()
{
return false;
diff --git a/qadevOOo/runner/graphical/PixelCounter.java b/qadevOOo/runner/graphical/PixelCounter.java
index 0807b26cbdeb..b0b9e41d7e66 100644
--- a/qadevOOo/runner/graphical/PixelCounter.java
+++ b/qadevOOo/runner/graphical/PixelCounter.java
@@ -34,19 +34,7 @@ class CountNotWhite extends CountPixel
{
}
- public void countold(final int pixel)
- {
- // final int alpha = (pixel >> 24) & 0xff;
- final int red = (pixel >> 16) & 0xff;
- final int green = (pixel >> 8) & 0xff;
- final int blue = (pixel ) & 0xff;
- if (red == 0xff && green == 0xff && blue == 0xff)
- {
- return;
- }
- ++m_nCount;
- }
@Override
public void count(final int pixel)
{
@@ -79,19 +67,7 @@ class CountNotBlack extends CountPixel
{
}
- public void countold(final int pixel)
- {
- // final int alpha = (pixel >> 24) & 0xff;
- final int red = (pixel >> 16) & 0xff;
- final int green = (pixel >> 8) & 0xff;
- final int blue = (pixel ) & 0xff;
- if (red == 0x00 && green == 0x00 && blue == 0x00)
- {
- return;
- }
- ++m_nCount;
- }
@Override
public void count(final int pixel)
{