i.e. com.sun.org.apache.xerces.internal.parsers.DOMParser is a
sun/oracle-only java api. Commit
http://cgit.freedesktop.org/libreoffice/core/commit/?id=04c5a36ab8d514cfbe8e40f4493787b2ab392ab5
(attached) I believe does the right thing, definitely builds anyway.
Proposing just for 3-4, not for specific 3-4-X
C.
From 04c5a36ab8d514cfbe8e40f4493787b2ab392ab5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Tue, 25 Oct 2011 13:49:51 +0100
Subject: [PATCH] avoid using com.sun.org apis
---
.../pentaho/output/OfficeDocumentReportTarget.java | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
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 cdc8eae..ef99a15 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();
--
1.7.6.4
Context
- [Libreoffice] [REVIEW] 3-4 cherry-pick fix to build with gcj 1.5.0 · Caolán McNamara
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.