summaryrefslogtreecommitdiff
path: root/xmerge
diff options
context:
space:
mode:
authorLuke Petrolekas <luke.petrolekas@gmail.com>2011-02-12 18:48:48 +0100
committerThomas Arnhold <thomas@arnhold.org>2011-02-12 18:50:11 +0100
commitc0b7906947cdb9dfc4b127d61796740c9ba1aa2d (patch)
tree7a787a7e5816ea12bfe7c98a914f313e267fd75a /xmerge
parent27386be30df1eaf5f7e14d4e64138613ea8aa67d (diff)
Remove dead Java code
Diffstat (limited to 'xmerge')
-rw-r--r--xmerge/source/activesync/XMergeFilter.cpp12
-rw-r--r--xmerge/source/bridge/java/XMergeBridge.java69
2 files changed, 7 insertions, 74 deletions
diff --git a/xmerge/source/activesync/XMergeFilter.cpp b/xmerge/source/activesync/XMergeFilter.cpp
index f6d0a4d5394f..e56049f7f836 100644
--- a/xmerge/source/activesync/XMergeFilter.cpp
+++ b/xmerge/source/activesync/XMergeFilter.cpp
@@ -360,18 +360,6 @@ TCHAR* CXMergeFilter::GetJavaBaseDir()
/* use current version */
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);
if (lRet != ERROR_SUCCESS)
{
diff --git a/xmerge/source/bridge/java/XMergeBridge.java b/xmerge/source/bridge/java/XMergeBridge.java
index 6fc6db43ac70..8c230760e93d 100644
--- a/xmerge/source/bridge/java/XMergeBridge.java
+++ b/xmerge/source/bridge/java/XMergeBridge.java
@@ -93,8 +93,6 @@ public class XMergeBridge {
private static String sFileName=null;
private static String sURL="";
- //private static FileOutputStream adaptedStream =null;
-
/** This inner class provides the component as a concrete implementation
* 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,
com.sun.star.xml.sax.XDocumentHandler xDocHandler,
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="";
sURL="";
String sDirectory = null;
@@ -185,10 +174,7 @@ public class XMergeBridge {
for (int i = 0 ; i < pValue.length; i++)
{
- //System.out.println("\n"+pValue[i].Name+" "+pValue[i].Value;
-
try{
- //System.out.println("\n"+pValue[i].Name+" "+pValue[i].Value);
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);
}
@@ -243,11 +229,9 @@ public class XMergeBridge {
}
catch (IOException e){
- //System.out.println("XMergeBridge IO Exception "+e.getMessage());
return false;
}
catch (Exception e){
- //System.out.println("XMergeBridge Exception "+e+" "+e.getMessage());
return false;
}
return true;
@@ -256,16 +240,6 @@ public class XMergeBridge {
public boolean exporter(com.sun.star.beans.PropertyValue[] aSourceData,
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;
sURL=null;
String sDirectory = null;
@@ -281,28 +255,22 @@ public class XMergeBridge {
for (int i = 0 ; i < pValue.length; i++)
{
- //System.out.println("\n"+pValue[i].Name+" "+pValue[i].Value);
-
try{
- //System.out.println("\n"+pValue[i].Name+" "+pValue[i].Value);
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);
- // System.out.println(pValue[i].Name+" "+xos);
}
+
if (pValue[i].Name.compareTo("FileName")==0){
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){
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);
- //System.out.println(pValue[i].Name+" "+title);
}
}
catch(com.sun.star.lang.IllegalArgumentException AnyExec){
@@ -379,7 +347,6 @@ public class XMergeBridge {
public void startDocument () {
- //System.out.println("\nStart Document!");
}
public void endDocument()throws com.sun.star.uno.RuntimeException
@@ -391,12 +358,10 @@ public class XMergeBridge {
}
catch (IOException e){
- //System.out.println("Exception "+e);
throw new com.sun.star.uno.RuntimeException(e.getMessage());
}
catch (Exception e){
- //System.out.println("Exception "+e);
throw new com.sun.star.uno.RuntimeException("Xmerge Exception");
}
@@ -421,7 +386,7 @@ public class XMergeBridge {
}
}
str=str.concat(">");
- // System.out.println(str);
+
try{
xOutStream.writeBytes(str.getBytes("UTF-8"));
}
@@ -534,12 +499,10 @@ public class XMergeBridge {
int i=1;
while (docEnum.hasMoreElements() && sURL.startsWith("file:")) {
- //URI uri=new URI(sFileName);
+
URI uri=new URI(sURL);
String newFileName= getPath(uri);
-
- //System.out.println("\nURI: "+uri.getPath());
File newFile=null;
if (newFileName.lastIndexOf(".")!=-1){
newFile =new File(newFileName.substring(0,newFileName.lastIndexOf("."))+String.valueOf(i)+newFileName.substring(newFileName.lastIndexOf(".")));
@@ -583,27 +546,15 @@ public class XMergeBridge {
}
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);
- //System.out.println("\nConverting");
ConvertData dataIn = cv.convert();
- //System.out.println("\nFinished Converting");
Enumeration docEnum = dataIn.getDocumentEnumeration();
while (docEnum.hasMoreElements()) {
OfficeDocument docIn = (OfficeDocument)docEnum.nextElement();
docIn.write(newxos,false);
}
- //newxos.write(-1); //EOF character
- //newxos.flush();
newxos.close();
}
ConverterInfoMgr.removeByJar(jarName);
@@ -631,12 +582,6 @@ public class XMergeBridge {
return path;
}
-
-
-
-
-
-
// Implement methods from interface XTypeProvider
public byte[] getImplementationId() {
byte[] byteReturn = {};