Remove dead Java code
This commit is contained in:
committed by
Thomas Arnhold
parent
27386be30d
commit
c0b7906947
@@ -360,18 +360,6 @@ TCHAR* CXMergeFilter::GetJavaBaseDir()
|
|||||||
/* use current version */
|
/* use current version */
|
||||||
lRet = ::RegQueryValueEx(hKey, _T("CurrentVersion"), 0, NULL, (LPBYTE)szCurrentJava, &dwSize);
|
lRet = ::RegQueryValueEx(hKey, _T("CurrentVersion"), 0, NULL, (LPBYTE)szCurrentJava, &dwSize);
|
||||||
|
|
||||||
/*
|
|
||||||
for (DWORD i = 0; lRet != ERROR_NO_MORE_ITEMS; i++)
|
|
||||||
{
|
|
||||||
lRet = ::RegEnumKeyEx(hKey, i, szKeyName, &dwKeyName, 0, szClassName, &dwClassName, NULL);
|
|
||||||
if(!strncmp(szKeyName, "1.4", 3))
|
|
||||||
break;
|
|
||||||
dwKeyName = _MAX_PATH;
|
|
||||||
}
|
|
||||||
// Found a Java 1.4 installation. Can now read its home directory.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
lRet = ::RegOpenKeyEx(hKey, _T(szCurrentJava), 0, KEY_READ, &hDataKey);
|
lRet = ::RegOpenKeyEx(hKey, _T(szCurrentJava), 0, KEY_READ, &hDataKey);
|
||||||
if (lRet != ERROR_SUCCESS)
|
if (lRet != ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
|
@@ -93,8 +93,6 @@ public class XMergeBridge {
|
|||||||
private static String sFileName=null;
|
private static String sFileName=null;
|
||||||
private static String sURL="";
|
private static String sURL="";
|
||||||
|
|
||||||
//private static FileOutputStream adaptedStream =null;
|
|
||||||
|
|
||||||
/** This inner class provides the component as a concrete implementation
|
/** This inner class provides the component as a concrete implementation
|
||||||
* of the service description. It implements the needed interfaces.
|
* of the service description. It implements the needed interfaces.
|
||||||
*/
|
*/
|
||||||
@@ -160,16 +158,7 @@ public class XMergeBridge {
|
|||||||
public boolean importer(com.sun.star.beans.PropertyValue[] aSourceData,
|
public boolean importer(com.sun.star.beans.PropertyValue[] aSourceData,
|
||||||
com.sun.star.xml.sax.XDocumentHandler xDocHandler,
|
com.sun.star.xml.sax.XDocumentHandler xDocHandler,
|
||||||
java.lang.String[] msUserData) throws com.sun.star.uno.RuntimeException {
|
java.lang.String[] msUserData) throws com.sun.star.uno.RuntimeException {
|
||||||
/*
|
|
||||||
System.out.println("\nFound the Importer!\n");
|
|
||||||
|
|
||||||
System.out.println("\n"+msUserData[0]);
|
|
||||||
System.out.println("\n"+msUserData[1]);
|
|
||||||
System.out.println("\n"+msUserData[2]);
|
|
||||||
System.out.println("\n"+msUserData[3]);
|
|
||||||
System.out.println("\n"+msUserData[4]);
|
|
||||||
System.out.println("\n"+msUserData[5]);
|
|
||||||
*/
|
|
||||||
sFileName="";
|
sFileName="";
|
||||||
sURL="";
|
sURL="";
|
||||||
String sDirectory = null;
|
String sDirectory = null;
|
||||||
@@ -185,10 +174,7 @@ public class XMergeBridge {
|
|||||||
for (int i = 0 ; i < pValue.length; i++)
|
for (int i = 0 ; i < pValue.length; i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
//System.out.println("\n"+pValue[i].Name+" "+pValue[i].Value;
|
|
||||||
|
|
||||||
try{
|
try{
|
||||||
//System.out.println("\n"+pValue[i].Name+" "+pValue[i].Value);
|
|
||||||
if (pValue[i].Name.compareTo("InputStream")==0){
|
if (pValue[i].Name.compareTo("InputStream")==0){
|
||||||
xis=(com.sun.star.io.XInputStream)AnyConverter.toObject(new Type(com.sun.star.io.XInputStream.class), pValue[i].Value);
|
xis=(com.sun.star.io.XInputStream)AnyConverter.toObject(new Type(com.sun.star.io.XInputStream.class), pValue[i].Value);
|
||||||
}
|
}
|
||||||
@@ -243,11 +229,9 @@ public class XMergeBridge {
|
|||||||
|
|
||||||
}
|
}
|
||||||
catch (IOException e){
|
catch (IOException e){
|
||||||
//System.out.println("XMergeBridge IO Exception "+e.getMessage());
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
catch (Exception e){
|
catch (Exception e){
|
||||||
//System.out.println("XMergeBridge Exception "+e+" "+e.getMessage());
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -256,16 +240,6 @@ public class XMergeBridge {
|
|||||||
public boolean exporter(com.sun.star.beans.PropertyValue[] aSourceData,
|
public boolean exporter(com.sun.star.beans.PropertyValue[] aSourceData,
|
||||||
java.lang.String[] msUserData) throws com.sun.star.uno.RuntimeException{
|
java.lang.String[] msUserData) throws com.sun.star.uno.RuntimeException{
|
||||||
|
|
||||||
/*
|
|
||||||
System.out.println("\nFound the Exporter!\n");
|
|
||||||
|
|
||||||
System.out.println("\n"+msUserData[0]);
|
|
||||||
System.out.println("\n"+msUserData[1]);
|
|
||||||
System.out.println("\n"+msUserData[2]);
|
|
||||||
System.out.println("\n"+msUserData[3]);
|
|
||||||
System.out.println("\n"+msUserData[4]);
|
|
||||||
System.out.println("\n"+msUserData[5]);
|
|
||||||
*/
|
|
||||||
sFileName=null;
|
sFileName=null;
|
||||||
sURL=null;
|
sURL=null;
|
||||||
String sDirectory = null;
|
String sDirectory = null;
|
||||||
@@ -281,28 +255,22 @@ public class XMergeBridge {
|
|||||||
for (int i = 0 ; i < pValue.length; i++)
|
for (int i = 0 ; i < pValue.length; i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
//System.out.println("\n"+pValue[i].Name+" "+pValue[i].Value);
|
|
||||||
|
|
||||||
|
|
||||||
try{
|
try{
|
||||||
//System.out.println("\n"+pValue[i].Name+" "+pValue[i].Value);
|
|
||||||
if (pValue[i].Name.compareTo("OutputStream")==0){
|
if (pValue[i].Name.compareTo("OutputStream")==0){
|
||||||
xos=(com.sun.star.io.XOutputStream)AnyConverter.toObject(new Type(com.sun.star.io.XOutputStream.class), pValue[i].Value);
|
xos=(com.sun.star.io.XOutputStream)AnyConverter.toObject(new Type(com.sun.star.io.XOutputStream.class), pValue[i].Value);
|
||||||
// System.out.println(pValue[i].Name+" "+xos);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pValue[i].Name.compareTo("FileName")==0){
|
if (pValue[i].Name.compareTo("FileName")==0){
|
||||||
sFileName=(String)AnyConverter.toObject(new Type(java.lang.String.class), pValue[i].Value);
|
sFileName=(String)AnyConverter.toObject(new Type(java.lang.String.class), pValue[i].Value);
|
||||||
//System.out.println(pValue[i].Name+" "+sFileName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pValue[i].Name.compareTo("URL")==0){
|
if (pValue[i].Name.compareTo("URL")==0){
|
||||||
sURL=(String)AnyConverter.toObject(new Type(java.lang.String.class), pValue[i].Value);
|
sURL=(String)AnyConverter.toObject(new Type(java.lang.String.class), pValue[i].Value);
|
||||||
// System.out.println("\nMediaDescriptor url "+pValue[i].Name+" "+sURL);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if (pValue[i].Name.compareTo("Title")==0){
|
|
||||||
|
|
||||||
|
if (pValue[i].Name.compareTo("Title")==0){
|
||||||
title=(String)AnyConverter.toObject(new Type(java.lang.String.class), pValue[i].Value);
|
title=(String)AnyConverter.toObject(new Type(java.lang.String.class), pValue[i].Value);
|
||||||
//System.out.println(pValue[i].Name+" "+title);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(com.sun.star.lang.IllegalArgumentException AnyExec){
|
catch(com.sun.star.lang.IllegalArgumentException AnyExec){
|
||||||
@@ -379,7 +347,6 @@ public class XMergeBridge {
|
|||||||
|
|
||||||
|
|
||||||
public void startDocument () {
|
public void startDocument () {
|
||||||
//System.out.println("\nStart Document!");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void endDocument()throws com.sun.star.uno.RuntimeException
|
public void endDocument()throws com.sun.star.uno.RuntimeException
|
||||||
@@ -391,12 +358,10 @@ public class XMergeBridge {
|
|||||||
|
|
||||||
}
|
}
|
||||||
catch (IOException e){
|
catch (IOException e){
|
||||||
//System.out.println("Exception "+e);
|
|
||||||
throw new com.sun.star.uno.RuntimeException(e.getMessage());
|
throw new com.sun.star.uno.RuntimeException(e.getMessage());
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception e){
|
catch (Exception e){
|
||||||
//System.out.println("Exception "+e);
|
|
||||||
throw new com.sun.star.uno.RuntimeException("Xmerge Exception");
|
throw new com.sun.star.uno.RuntimeException("Xmerge Exception");
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -421,7 +386,7 @@ public class XMergeBridge {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
str=str.concat(">");
|
str=str.concat(">");
|
||||||
// System.out.println(str);
|
|
||||||
try{
|
try{
|
||||||
xOutStream.writeBytes(str.getBytes("UTF-8"));
|
xOutStream.writeBytes(str.getBytes("UTF-8"));
|
||||||
}
|
}
|
||||||
@@ -534,12 +499,10 @@ public class XMergeBridge {
|
|||||||
|
|
||||||
int i=1;
|
int i=1;
|
||||||
while (docEnum.hasMoreElements() && sURL.startsWith("file:")) {
|
while (docEnum.hasMoreElements() && sURL.startsWith("file:")) {
|
||||||
//URI uri=new URI(sFileName);
|
|
||||||
URI uri=new URI(sURL);
|
URI uri=new URI(sURL);
|
||||||
String newFileName= getPath(uri);
|
String newFileName= getPath(uri);
|
||||||
|
|
||||||
|
|
||||||
//System.out.println("\nURI: "+uri.getPath());
|
|
||||||
File newFile=null;
|
File newFile=null;
|
||||||
if (newFileName.lastIndexOf(".")!=-1){
|
if (newFileName.lastIndexOf(".")!=-1){
|
||||||
newFile =new File(newFileName.substring(0,newFileName.lastIndexOf("."))+String.valueOf(i)+newFileName.substring(newFileName.lastIndexOf(".")));
|
newFile =new File(newFileName.substring(0,newFileName.lastIndexOf("."))+String.valueOf(i)+newFileName.substring(newFileName.lastIndexOf(".")));
|
||||||
@@ -583,27 +546,15 @@ public class XMergeBridge {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
ByteArrayOutputStream bout = new ByteArrayOutputStream();
|
|
||||||
byte[][] buf = new byte[1][4096];
|
|
||||||
int n=0;
|
|
||||||
while ((n=xml.readSomeBytes(buf, 4096))>0)
|
|
||||||
bout.write(buf[0], 0, n);
|
|
||||||
ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
|
|
||||||
cv.addInputStream(name, bin, false);
|
|
||||||
*/
|
|
||||||
cv.addInputStream(name,(InputStream)xis,false);
|
cv.addInputStream(name,(InputStream)xis,false);
|
||||||
//System.out.println("\nConverting");
|
|
||||||
ConvertData dataIn = cv.convert();
|
ConvertData dataIn = cv.convert();
|
||||||
//System.out.println("\nFinished Converting");
|
|
||||||
Enumeration docEnum = dataIn.getDocumentEnumeration();
|
Enumeration docEnum = dataIn.getDocumentEnumeration();
|
||||||
while (docEnum.hasMoreElements()) {
|
while (docEnum.hasMoreElements()) {
|
||||||
OfficeDocument docIn = (OfficeDocument)docEnum.nextElement();
|
OfficeDocument docIn = (OfficeDocument)docEnum.nextElement();
|
||||||
|
|
||||||
docIn.write(newxos,false);
|
docIn.write(newxos,false);
|
||||||
}
|
}
|
||||||
//newxos.write(-1); //EOF character
|
|
||||||
//newxos.flush();
|
|
||||||
newxos.close();
|
newxos.close();
|
||||||
}
|
}
|
||||||
ConverterInfoMgr.removeByJar(jarName);
|
ConverterInfoMgr.removeByJar(jarName);
|
||||||
@@ -631,12 +582,6 @@ public class XMergeBridge {
|
|||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Implement methods from interface XTypeProvider
|
// Implement methods from interface XTypeProvider
|
||||||
public byte[] getImplementationId() {
|
public byte[] getImplementationId() {
|
||||||
byte[] byteReturn = {};
|
byte[] byteReturn = {};
|
||||||
|
Reference in New Issue
Block a user