summaryrefslogtreecommitdiff
path: root/qadevOOo/runner/graphical/OpenOfficePostscriptCreator.java
diff options
context:
space:
mode:
Diffstat (limited to 'qadevOOo/runner/graphical/OpenOfficePostscriptCreator.java')
-rw-r--r--qadevOOo/runner/graphical/OpenOfficePostscriptCreator.java232
1 files changed, 0 insertions, 232 deletions
diff --git a/qadevOOo/runner/graphical/OpenOfficePostscriptCreator.java b/qadevOOo/runner/graphical/OpenOfficePostscriptCreator.java
index 9b224b82120f..f63c623975d0 100644
--- a/qadevOOo/runner/graphical/OpenOfficePostscriptCreator.java
+++ b/qadevOOo/runner/graphical/OpenOfficePostscriptCreator.java
@@ -26,8 +26,6 @@ import java.util.ArrayList;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.document.XTypeDetection;
-import com.sun.star.container.XNameAccess;
import com.sun.star.frame.XDesktop;
import com.sun.star.beans.XPropertySet;
import com.sun.star.beans.PropertyValue;
@@ -584,236 +582,6 @@ public class OpenOfficePostscriptCreator implements IOffice
- private String getInternalFilterName(String _sFilterName, XMultiServiceFactory _xMSF)
- {
- if (_sFilterName.length() == 0)
- {
- return null;
- }
-
- if (_xMSF == null)
- {
- GlobalLogWriter.println("MultiServiceFactory not set.");
- return null;
- }
- Object aObj = null;
- try
- {
- aObj = _xMSF.createInstance("com.sun.star.document.FilterFactory");
- }
- catch(com.sun.star.uno.Exception e)
- {
- GlobalLogWriter.println("Can't get com.sun.star.document.FilterFactory.");
- return null;
- }
- if (aObj != null)
- {
- XNameAccess aNameAccess = UnoRuntime.queryInterface(XNameAccess.class, aObj);
- if (aNameAccess != null)
- {
-
- if (! aNameAccess.hasByName(_sFilterName))
- {
- GlobalLogWriter.println("FilterFactory.hasByName() says there exist no '" + _sFilterName + "'" );
- return null;
- }
-
- Object[] aElements = null;
- try
- {
- aElements = (Object[]) aNameAccess.getByName(_sFilterName);
- if (aElements != null)
- {
- String sInternalFilterName = null;
- for (int i=0;i<aElements.length; i++)
- {
- PropertyValue aPropertyValue = (PropertyValue)aElements[i];
- if (aPropertyValue.Name.equals("Type"))
- {
- String sValue = (String)aPropertyValue.Value;
- sInternalFilterName = sValue;
- }
- }
- return sInternalFilterName;
- }
- else
- {
- GlobalLogWriter.println("There are no elements for FilterName '" + _sFilterName + "'");
- return null;
- }
- }
- catch (com.sun.star.container.NoSuchElementException e)
- {
- GlobalLogWriter.println("NoSuchElementException caught. " + e.getMessage());
- }
- catch (com.sun.star.lang.WrappedTargetException e)
- {
- GlobalLogWriter.println("WrappedTargetException caught. " + e.getMessage());
- }
- }
- }
- return null;
- }
-
-
-
- private String getServiceNameFromFilterName(String _sFilterName, XMultiServiceFactory _xMSF)
- {
- if (_sFilterName.length() == 0)
- {
- return null;
- }
-
- if (_xMSF == null)
- {
- GlobalLogWriter.println("MultiServiceFactory not set.");
- return null;
- }
- Object aObj = null;
- try
- {
- aObj = _xMSF.createInstance("com.sun.star.document.FilterFactory");
- }
- catch(com.sun.star.uno.Exception e)
- {
- GlobalLogWriter.println("Can't get com.sun.star.document.FilterFactory.");
- return null;
- }
- if (aObj != null)
- {
- XNameAccess aNameAccess = UnoRuntime.queryInterface(XNameAccess.class, aObj);
- if (aNameAccess != null)
- {
- if (! aNameAccess.hasByName(_sFilterName))
- {
- GlobalLogWriter.println("FilterFactory.hasByName() says there exist no '" + _sFilterName + "'" );
- return null;
- }
-
- Object[] aElements = null;
- try
- {
- aElements = (Object[]) aNameAccess.getByName(_sFilterName);
- if (aElements != null)
- {
- String sServiceName = null;
- for (int i=0;i<aElements.length; i++)
- {
- PropertyValue aPropertyValue = (PropertyValue)aElements[i];
- if (aPropertyValue.Name.equals("DocumentService"))
- {
- String sValue = (String)aPropertyValue.Value;
- sServiceName = sValue;
- break;
- }
- }
- return sServiceName;
- }
- else
- {
- GlobalLogWriter.println("There are no elements for FilterName '" + _sFilterName + "'");
- return null;
- }
- }
- catch (com.sun.star.container.NoSuchElementException e)
- {
- GlobalLogWriter.println("NoSuchElementException caught. " + e.getMessage());
- }
- catch (com.sun.star.lang.WrappedTargetException e)
- {
- GlobalLogWriter.println("WrappedTargetException caught. " + e.getMessage());
- }
- }
- }
- return null;
- }
-
-
- private static String getFileExtension(String _sInternalFilterName, XMultiServiceFactory _xMSF)
- {
- if (_sInternalFilterName.length() == 0)
- {
- return null;
- }
-
- if (_xMSF == null)
- {
- GlobalLogWriter.println("MultiServiceFactory not set.");
- return null;
- }
- 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 null;
- }
- if (aTypeDetection != null)
- {
- XNameAccess aNameAccess = UnoRuntime.queryInterface(XNameAccess.class, aTypeDetection);
- if (aNameAccess != null)
- {
-
- if (! aNameAccess.hasByName(_sInternalFilterName))
- {
- GlobalLogWriter.println("TypeDetection.hasByName() says there exist no '" + _sInternalFilterName + "'" );
- return null;
- }
-
- Object[] aElements = null;
- String[] aExtensions;
- try
- {
- aElements = (Object[]) aNameAccess.getByName(_sInternalFilterName);
- if (aElements != null)
- {
- String sExtension = null;
- for (int i=0;i<aElements.length; i++)
- {
- PropertyValue aPropertyValue = (PropertyValue)aElements[i];
- if (aPropertyValue.Name.equals("Extensions"))
- {
- aExtensions = (String[])aPropertyValue.Value;
- GlobalLogWriter.println(" Possible extensions are: " + String.valueOf(aExtensions.length));
- if (aExtensions.length > 0)
- {
- for (int j=0;j<aExtensions.length;j++)
- {
- GlobalLogWriter.println(" " + aExtensions[j]);
- }
- sExtension = aExtensions[0];
- GlobalLogWriter.println("");
- }
- }
- }
- return sExtension;
- }
- else
- {
- GlobalLogWriter.println("There are no elements for FilterName '" + _sInternalFilterName + "'");
- return null;
- }
- }
- catch (com.sun.star.container.NoSuchElementException e)
- {
- GlobalLogWriter.println("NoSuchElementException caught. " + e.getMessage());
- }
- catch (com.sun.star.lang.WrappedTargetException e)
- {
- GlobalLogWriter.println("WrappedTargetException caught. " + e.getMessage());
- }
-}
- }
- return null;
- }
-
-
-
-
private OfficeProvider m_aProvider = null;
private void startOffice()
{