[Libreoffice-commits] .: xmerge/source
Thomas Arnhold
tarnhold at kemper.freedesktop.org
Sat Feb 12 09:50:05 PST 2011
xmerge/source/activesync/XMergeFilter.cpp | 12 ----
xmerge/source/bridge/java/XMergeBridge.java | 71 +++-------------------------
2 files changed, 8 insertions(+), 75 deletions(-)
New commits:
commit 6e78b5884766405915eb7046420333a83e1986eb
Author: Luke Petrolekas <luke.petrolekas at gmail.com>
Date: Sat Feb 12 18:48:48 2011 +0100
Remove dead Java code
diff --git a/xmerge/source/activesync/XMergeFilter.cpp b/xmerge/source/activesync/XMergeFilter.cpp
index cd1ecf6..b750b4a 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 9302ebb..1cc559e 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){
-
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);
@@ -630,12 +581,6 @@ public class XMergeBridge {
}
return path;
}
-
-
-
-
-
-
// Implement methods from interface XTypeProvider
public byte[] getImplementationId() {
More information about the Libreoffice-commits
mailing list