[Libreoffice-commits] .: Branch 'libreoffice-3-4' - reportbuilder/java
Caolán McNamara
caolan at kemper.freedesktop.org
Fri Nov 4 09:54:59 PDT 2011
reportbuilder/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
New commits:
commit 2270e85f5cf742ec58582ccf54bd22515148e346
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 4 16:36:44 2011 +0000
back-port this fix to build with non sun/oracle derived jdk's, e.g. libgcj
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java b/reportbuilder/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java
index 852f58e..6d3321c 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java
@@ -41,7 +41,6 @@ import com.sun.star.report.pentaho.model.OfficeStyles;
import com.sun.star.report.pentaho.model.OfficeStylesCollection;
import com.sun.star.report.pentaho.styles.LengthCalculator;
import com.sun.star.report.pentaho.styles.StyleMapper;
-import com.sun.org.apache.xerces.internal.parsers.DOMParser;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.xml.transform.OutputKeys;
@@ -49,6 +48,8 @@ import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.DocumentBuilder;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -1058,9 +1059,10 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget
try
{
inputStream = getInputRepository().createInputStream("meta.xml");
- DOMParser dOMParser = new DOMParser();
- dOMParser.parse(new InputSource(inputStream));
- Document document = dOMParser.getDocument();
+ DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
+ Document document = dBuilder.parse(new InputSource(inputStream));
+
NodeList nl = document.getElementsByTagName("document-meta/meta/generator");
Node node = document.getFirstChild().getFirstChild().getFirstChild().getFirstChild();
String creator = node.getNodeValue();
More information about the Libreoffice-commits
mailing list