Remove visual noise from xmerge
Change-Id: I74b5e30d08ade403ec35298d5c783f02b22e886a Reviewed-on: https://gerrit.libreoffice.org/8343 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
committed by
Caolán McNamara
parent
2ef9df8aee
commit
c2a0a2bb49
@@ -192,7 +192,7 @@ public class Convert implements Cloneable {
|
|||||||
if (toOffice) {
|
if (toOffice) {
|
||||||
|
|
||||||
// From device format to Office format
|
// From device format to Office format
|
||||||
//
|
|
||||||
DocumentDeserializerFactory myDocDeserializerFactory =
|
DocumentDeserializerFactory myDocDeserializerFactory =
|
||||||
ci.getDocDeserializerFactory();
|
ci.getDocDeserializerFactory();
|
||||||
DocumentDeserializer deser =
|
DocumentDeserializer deser =
|
||||||
@@ -206,7 +206,7 @@ public class Convert implements Cloneable {
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
// From Office format to device format
|
// From Office format to device format
|
||||||
//
|
|
||||||
DocumentSerializerFactory myDocSerializerFactory =
|
DocumentSerializerFactory myDocSerializerFactory =
|
||||||
ci.getDocSerializerFactory();
|
ci.getDocSerializerFactory();
|
||||||
|
|
||||||
@@ -244,7 +244,7 @@ public class Convert implements Cloneable {
|
|||||||
if (toOffice) {
|
if (toOffice) {
|
||||||
|
|
||||||
// From device format to Office format
|
// From device format to Office format
|
||||||
//
|
|
||||||
DocumentDeserializerFactory myDocDeserializerFactory =
|
DocumentDeserializerFactory myDocDeserializerFactory =
|
||||||
ci.getDocDeserializerFactory();
|
ci.getDocDeserializerFactory();
|
||||||
DocumentDeserializer deser =
|
DocumentDeserializer deser =
|
||||||
@@ -260,7 +260,7 @@ public class Convert implements Cloneable {
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
// From Office format to device format
|
// From Office format to device format
|
||||||
//
|
|
||||||
DocumentSerializerFactory myDocSerializerFactory =
|
DocumentSerializerFactory myDocSerializerFactory =
|
||||||
ci.getDocSerializerFactory();
|
ci.getDocSerializerFactory();
|
||||||
|
|
||||||
|
@@ -231,7 +231,7 @@ public class ParaStyle extends Style implements Cloneable {
|
|||||||
// Look for children. Only ones we care about are "style:properties"
|
// Look for children. Only ones we care about are "style:properties"
|
||||||
// nodes. If any are found, recursively traverse them, passing
|
// nodes. If any are found, recursively traverse them, passing
|
||||||
// along the style element to add properties to.
|
// along the style element to add properties to.
|
||||||
//
|
|
||||||
if (node.hasChildNodes()) {
|
if (node.hasChildNodes()) {
|
||||||
NodeList children = node.getChildNodes();
|
NodeList children = node.getChildNodes();
|
||||||
int len = children.getLength();
|
int len = children.getLength();
|
||||||
|
@@ -133,12 +133,12 @@ public class DocumentMergerImpl implements DocumentMerger {
|
|||||||
Node workSheet= workSheetList2.item(j);
|
Node workSheet= workSheetList2.item(j);
|
||||||
|
|
||||||
// try to match the workSheet
|
// try to match the workSheet
|
||||||
//
|
|
||||||
Node matchingWorkSheet = matchWorkSheet(workSheet, workSheetList1);
|
Node matchingWorkSheet = matchWorkSheet(workSheet, workSheetList1);
|
||||||
|
|
||||||
// add the new WorkSheet to the original document iff match not
|
// add the new WorkSheet to the original document iff match not
|
||||||
// found
|
// found
|
||||||
//
|
|
||||||
if (matchingWorkSheet == null) {
|
if (matchingWorkSheet == null) {
|
||||||
Node cloneNode = XmlUtil.deepClone(officeBody, workSheet);
|
Node cloneNode = XmlUtil.deepClone(officeBody, workSheet);
|
||||||
officeBody.appendChild(cloneNode);
|
officeBody.appendChild(cloneNode);
|
||||||
|
@@ -167,7 +167,7 @@ public abstract class SxcDocumentDeserializer implements OfficeConstants,
|
|||||||
// use any value for password here. If StarCalc XML supports
|
// use any value for password here. If StarCalc XML supports
|
||||||
// passwords in the future, we should try to get the correct
|
// passwords in the future, we should try to get the correct
|
||||||
// password value here.
|
// password value here.
|
||||||
//
|
|
||||||
decoder = createDecoder(workbookName, worksheetNames, "password");
|
decoder = createDecoder(workbookName, worksheetNames, "password");
|
||||||
|
|
||||||
Debug.log(Debug.TRACE, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
|
Debug.log(Debug.TRACE, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
|
||||||
@@ -438,7 +438,7 @@ public abstract class SxcDocumentDeserializer implements OfficeConstants,
|
|||||||
// The number of columns in the spreadsheet
|
// The number of columns in the spreadsheet
|
||||||
int lastColumn = decoder.getNumberOfColumns();
|
int lastColumn = decoder.getNumberOfColumns();
|
||||||
|
|
||||||
//
|
|
||||||
Node autoStylesNode = null;
|
Node autoStylesNode = null;
|
||||||
|
|
||||||
// Loop over all cells in the spreadsheet
|
// Loop over all cells in the spreadsheet
|
||||||
|
@@ -717,7 +717,7 @@ public abstract class SxcDocumentSerializer implements OfficeConstants,
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Text node, Date node, or Time node
|
// Text node, Date node, or Time node
|
||||||
//
|
|
||||||
Debug.log(Debug.INFO,
|
Debug.log(Debug.INFO,
|
||||||
"TextNode, DateNode, TimeNode or BooleanNode\n");
|
"TextNode, DateNode, TimeNode or BooleanNode\n");
|
||||||
// This handles the case where we have style information but no content
|
// This handles the case where we have style information but no content
|
||||||
|
@@ -54,7 +54,7 @@ public abstract class SxcPluginFactory
|
|||||||
throws IOException {
|
throws IOException {
|
||||||
|
|
||||||
// read zipped XML stream
|
// read zipped XML stream
|
||||||
//
|
|
||||||
SxcDocument doc = new SxcDocument(name);
|
SxcDocument doc = new SxcDocument(name);
|
||||||
doc.read(is);
|
doc.read(is);
|
||||||
return doc;
|
return doc;
|
||||||
@@ -64,7 +64,7 @@ public abstract class SxcPluginFactory
|
|||||||
throws IOException {
|
throws IOException {
|
||||||
|
|
||||||
// read zipped XML stream
|
// read zipped XML stream
|
||||||
//
|
|
||||||
SxcDocument doc = new SxcDocument(name);
|
SxcDocument doc = new SxcDocument(name);
|
||||||
doc.read(is,isZip);
|
doc.read(is,isZip);
|
||||||
return doc;
|
return doc;
|
||||||
|
@@ -153,7 +153,7 @@ public final class PluginFactoryImpl extends PluginFactory
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
||||||
// It is okay for the property file to not exist.
|
// It is okay for the property file to not exist.
|
||||||
//
|
|
||||||
}
|
}
|
||||||
return ext;
|
return ext;
|
||||||
}
|
}
|
||||||
|
@@ -143,7 +143,7 @@ public final class CharacterBaseParagraphMerge
|
|||||||
String tmpString;
|
String tmpString;
|
||||||
|
|
||||||
// Handle situation where getNodeValue returns null
|
// Handle situation where getNodeValue returns null
|
||||||
//
|
|
||||||
if (orgNode.getNodeValue() != null)
|
if (orgNode.getNodeValue() != null)
|
||||||
tmpString = orgNode.getNodeValue();
|
tmpString = orgNode.getNodeValue();
|
||||||
else
|
else
|
||||||
@@ -167,11 +167,11 @@ public final class CharacterBaseParagraphMerge
|
|||||||
int lastDiffPosition = -1;
|
int lastDiffPosition = -1;
|
||||||
|
|
||||||
// starting to diff
|
// starting to diff
|
||||||
//
|
|
||||||
for (int j = startDiffNum; j < endDiffNum; j++) {
|
for (int j = startDiffNum; j < endDiffNum; j++) {
|
||||||
|
|
||||||
// copy any contents before the diff
|
// copy any contents before the diff
|
||||||
//
|
|
||||||
if (diffs[j].getOrgPosition() > orgTextPosition) {
|
if (diffs[j].getOrgPosition() > orgTextPosition) {
|
||||||
// need to flush first
|
// need to flush first
|
||||||
if (cacheLength > 0) {
|
if (cacheLength > 0) {
|
||||||
@@ -199,7 +199,7 @@ public final class CharacterBaseParagraphMerge
|
|||||||
|
|
||||||
// for any deleted characters, just skip without copy
|
// for any deleted characters, just skip without copy
|
||||||
// but still need to take care the cached characters
|
// but still need to take care the cached characters
|
||||||
//
|
|
||||||
if (diffs[j].getOperation() == Difference.DELETE) {
|
if (diffs[j].getOperation() == Difference.DELETE) {
|
||||||
orgTextPosition++;
|
orgTextPosition++;
|
||||||
|
|
||||||
|
@@ -68,7 +68,7 @@ public final class Driver {
|
|||||||
public static void main(String args[]) {
|
public static void main(String args[]) {
|
||||||
|
|
||||||
// Register jarfiles
|
// Register jarfiles
|
||||||
//
|
|
||||||
String propFile = "ConverterInfoList.properties";
|
String propFile = "ConverterInfoList.properties";
|
||||||
ConverterInfoList cil = null;
|
ConverterInfoList cil = null;
|
||||||
try {
|
try {
|
||||||
|
@@ -44,7 +44,7 @@ public class ConverterInfo {
|
|||||||
|
|
||||||
static {
|
static {
|
||||||
// This needs to be updated to reflect all valid office types.
|
// This needs to be updated to reflect all valid office types.
|
||||||
//
|
|
||||||
validOfficeTypes = new String[2];
|
validOfficeTypes = new String[2];
|
||||||
validOfficeTypes[0] = SxwType;
|
validOfficeTypes[0] = SxwType;
|
||||||
validOfficeTypes[1] = SxcType;
|
validOfficeTypes[1] = SxcType;
|
||||||
@@ -110,7 +110,7 @@ public class ConverterInfo {
|
|||||||
piClassLoader = this.getClass().getClassLoader();
|
piClassLoader = this.getClass().getClassLoader();
|
||||||
|
|
||||||
// Get instance of the PluginFactory.
|
// Get instance of the PluginFactory.
|
||||||
//
|
|
||||||
try {
|
try {
|
||||||
URL jarURL = new URL(jarName);
|
URL jarURL = new URL(jarName);
|
||||||
URLClassLoader loader = new URLClassLoader(new URL[] { jarURL },
|
URLClassLoader loader = new URLClassLoader(new URL[] { jarURL },
|
||||||
@@ -123,7 +123,7 @@ public class ConverterInfo {
|
|||||||
piPluginFactory = ( PluginFactory ) construct.newInstance(arguments);
|
piPluginFactory = ( PluginFactory ) construct.newInstance(arguments);
|
||||||
|
|
||||||
// See which interfaces the plug-in PluginFactory supports.
|
// See which interfaces the plug-in PluginFactory supports.
|
||||||
//
|
|
||||||
Class<?>[] cl = piPluginFactory.getClass().getInterfaces();
|
Class<?>[] cl = piPluginFactory.getClass().getInterfaces();
|
||||||
for (int i=0; i < cl.length; i++) {
|
for (int i=0; i < cl.length; i++) {
|
||||||
|
|
||||||
@@ -185,7 +185,7 @@ public class ConverterInfo {
|
|||||||
piClassLoader = this.getClass().getClassLoader();
|
piClassLoader = this.getClass().getClassLoader();
|
||||||
|
|
||||||
// Get instance of the PluginFactory.
|
// Get instance of the PluginFactory.
|
||||||
//
|
|
||||||
try {
|
try {
|
||||||
URL jarURL = new URL(jarName);
|
URL jarURL = new URL(jarName);
|
||||||
URLClassLoader loader = new URLClassLoader(new URL[] { jarURL },
|
URLClassLoader loader = new URLClassLoader(new URL[] { jarURL },
|
||||||
@@ -198,7 +198,7 @@ public class ConverterInfo {
|
|||||||
piPluginFactory = ( PluginFactory ) construct.newInstance(arguments);
|
piPluginFactory = ( PluginFactory ) construct.newInstance(arguments);
|
||||||
|
|
||||||
// See which interfaces the plug-in PluginFactory supports.
|
// See which interfaces the plug-in PluginFactory supports.
|
||||||
//
|
|
||||||
Class<?>[] cl = piPluginFactory.getClass().getInterfaces();
|
Class<?>[] cl = piPluginFactory.getClass().getInterfaces();
|
||||||
for (int i=0; i < cl.length; i++) {
|
for (int i=0; i < cl.length; i++) {
|
||||||
|
|
||||||
|
@@ -56,7 +56,7 @@ public final class ConverterInfoMgr {
|
|||||||
ConverterInfo converterInfo;
|
ConverterInfo converterInfo;
|
||||||
|
|
||||||
// Validate
|
// Validate
|
||||||
//
|
|
||||||
if (ci.getDisplayName() == null) {
|
if (ci.getDisplayName() == null) {
|
||||||
RegistryException re = new RegistryException(
|
RegistryException re = new RegistryException(
|
||||||
"Converter must have valid name.");
|
"Converter must have valid name.");
|
||||||
@@ -80,7 +80,7 @@ public final class ConverterInfoMgr {
|
|||||||
|
|
||||||
// Verify there is no converter with the same Display Name in
|
// Verify there is no converter with the same Display Name in
|
||||||
// the registry.
|
// the registry.
|
||||||
//
|
|
||||||
Iterator<ConverterInfo> ciEnum = converterInfoList.iterator();
|
Iterator<ConverterInfo> ciEnum = converterInfoList.iterator();
|
||||||
while (ciEnum.hasNext()) {
|
while (ciEnum.hasNext()) {
|
||||||
converterInfo = ciEnum.next();
|
converterInfo = ciEnum.next();
|
||||||
@@ -93,7 +93,7 @@ public final class ConverterInfoMgr {
|
|||||||
|
|
||||||
// Since this is a adding to a static Vector, make sure this
|
// Since this is a adding to a static Vector, make sure this
|
||||||
// add method call is synchronized.
|
// add method call is synchronized.
|
||||||
//
|
|
||||||
synchronized (converterInfoList) {
|
synchronized (converterInfoList) {
|
||||||
converterInfoList.add(ci);
|
converterInfoList.add(ci);
|
||||||
}
|
}
|
||||||
@@ -216,7 +216,7 @@ public final class ConverterInfoMgr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Loop over elements comparing with deviceFromMime
|
// Loop over elements comparing with deviceFromMime
|
||||||
//
|
|
||||||
Iterator<ConverterInfo> ciEnum = converterInfoList.iterator();
|
Iterator<ConverterInfo> ciEnum = converterInfoList.iterator();
|
||||||
while (ciEnum.hasNext()) {
|
while (ciEnum.hasNext()) {
|
||||||
|
|
||||||
@@ -225,7 +225,7 @@ public final class ConverterInfoMgr {
|
|||||||
Iterator<String> fromEnum = converterInfo.getDeviceMime();
|
Iterator<String> fromEnum = converterInfo.getDeviceMime();
|
||||||
|
|
||||||
// Loop over the deviceMime types.
|
// Loop over the deviceMime types.
|
||||||
//
|
|
||||||
while (fromEnum.hasNext()) {
|
while (fromEnum.hasNext()) {
|
||||||
String fromDeviceInfo = fromEnum.next();
|
String fromDeviceInfo = fromEnum.next();
|
||||||
if (deviceMime.trim().equals(fromDeviceInfo) &&
|
if (deviceMime.trim().equals(fromDeviceInfo) &&
|
||||||
@@ -259,7 +259,7 @@ public final class ConverterInfoMgr {
|
|||||||
ConverterInfo[] converterInfo = new ConverterInfo[2];
|
ConverterInfo[] converterInfo = new ConverterInfo[2];
|
||||||
|
|
||||||
// Loop over elements comparing with deviceFromMime
|
// Loop over elements comparing with deviceFromMime
|
||||||
//
|
|
||||||
Iterator<ConverterInfo> cifEnum = converterInfoList.iterator();
|
Iterator<ConverterInfo> cifEnum = converterInfoList.iterator();
|
||||||
while (cifEnum.hasNext()) {
|
while (cifEnum.hasNext()) {
|
||||||
|
|
||||||
@@ -269,7 +269,7 @@ public final class ConverterInfoMgr {
|
|||||||
|
|
||||||
// Loop over the deviceMime types looking for a deviceFromMime
|
// Loop over the deviceMime types looking for a deviceFromMime
|
||||||
// match.
|
// match.
|
||||||
//
|
|
||||||
while (fromEnum.hasNext()) {
|
while (fromEnum.hasNext()) {
|
||||||
String fromDeviceInfo = fromEnum.next();
|
String fromDeviceInfo = fromEnum.next();
|
||||||
|
|
||||||
@@ -277,7 +277,7 @@ public final class ConverterInfoMgr {
|
|||||||
|
|
||||||
// Found a a match for deviceFrom. Now loop over the
|
// Found a a match for deviceFrom. Now loop over the
|
||||||
// elements comparing with deviceToMime
|
// elements comparing with deviceToMime
|
||||||
//
|
|
||||||
Iterator<ConverterInfo> citEnum = converterInfoList.iterator();
|
Iterator<ConverterInfo> citEnum = converterInfoList.iterator();
|
||||||
while (citEnum.hasNext()) {
|
while (citEnum.hasNext()) {
|
||||||
|
|
||||||
@@ -287,14 +287,14 @@ public final class ConverterInfoMgr {
|
|||||||
|
|
||||||
// Loop over deviceMime types looking for a
|
// Loop over deviceMime types looking for a
|
||||||
// deviceToMime match.
|
// deviceToMime match.
|
||||||
//
|
|
||||||
while (toEnum.hasNext()) {
|
while (toEnum.hasNext()) {
|
||||||
String toDeviceInfo = toEnum.next();
|
String toDeviceInfo = toEnum.next();
|
||||||
if (deviceToMime.trim().equals(toDeviceInfo) &&
|
if (deviceToMime.trim().equals(toDeviceInfo) &&
|
||||||
fromOfficeInfo.equals(toOfficeInfo)) {
|
fromOfficeInfo.equals(toOfficeInfo)) {
|
||||||
|
|
||||||
// Found a match
|
// Found a match
|
||||||
//
|
|
||||||
return (converterInfo);
|
return (converterInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -343,12 +343,12 @@ public final class ConverterInfoMgr {
|
|||||||
System.out.println("");
|
System.out.println("");
|
||||||
|
|
||||||
// Quit
|
// Quit
|
||||||
//
|
|
||||||
if (c == 'Q') {
|
if (c == 'Q') {
|
||||||
exitFlag = true;
|
exitFlag = true;
|
||||||
|
|
||||||
// Load by Jarfile
|
// Load by Jarfile
|
||||||
//
|
|
||||||
} else if (c == 'L') {
|
} else if (c == 'L') {
|
||||||
|
|
||||||
System.out.println("Enter path to jarfile: ");
|
System.out.println("Enter path to jarfile: ");
|
||||||
@@ -374,7 +374,7 @@ public final class ConverterInfoMgr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Unload by Display Name or Jarfile
|
// Unload by Display Name or Jarfile
|
||||||
//
|
|
||||||
} else if (c == 'T') {
|
} else if (c == 'T') {
|
||||||
if (validate== true){
|
if (validate== true){
|
||||||
System.out.println("Validation switched off");
|
System.out.println("Validation switched off");
|
||||||
@@ -414,7 +414,7 @@ public final class ConverterInfoMgr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Find Office Mime
|
// Find Office Mime
|
||||||
//
|
|
||||||
} else if (c == 'F' || c == 'C') {
|
} else if (c == 'F' || c == 'C') {
|
||||||
|
|
||||||
String findMimeOne = null;
|
String findMimeOne = null;
|
||||||
@@ -467,7 +467,7 @@ public final class ConverterInfoMgr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// View
|
// View
|
||||||
//
|
|
||||||
} else if (c == 'V') {
|
} else if (c == 'V') {
|
||||||
|
|
||||||
Iterator<ConverterInfo> ciEnum = ConverterInfoMgr.getConverterInfoEnumeration();
|
Iterator<ConverterInfo> ciEnum = ConverterInfoMgr.getConverterInfoEnumeration();
|
||||||
|
@@ -89,19 +89,19 @@ public class ConverterInfoReader {
|
|||||||
jarfilename = jar;
|
jarfilename = jar;
|
||||||
|
|
||||||
// Get Jar via URL
|
// Get Jar via URL
|
||||||
//
|
|
||||||
url = new URL("jar:" + jar + "!/META-INF/converter.xml");
|
url = new URL("jar:" + jar + "!/META-INF/converter.xml");
|
||||||
jarConnection = (JarURLConnection)url.openConnection();
|
jarConnection = (JarURLConnection)url.openConnection();
|
||||||
jarentry = jarConnection.getJarEntry();
|
jarentry = jarConnection.getJarEntry();
|
||||||
jarfile = jarConnection.getJarFile();
|
jarfile = jarConnection.getJarFile();
|
||||||
|
|
||||||
// Build the InputSource
|
// Build the InputSource
|
||||||
//
|
|
||||||
istream = jarfile.getInputStream(jarentry);
|
istream = jarfile.getInputStream(jarentry);
|
||||||
isource = new InputSource(istream);
|
isource = new InputSource(istream);
|
||||||
|
|
||||||
// Get the DOM builder and build the document.
|
// Get the DOM builder and build the document.
|
||||||
//
|
|
||||||
builderFactory = DocumentBuilderFactory.newInstance();
|
builderFactory = DocumentBuilderFactory.newInstance();
|
||||||
|
|
||||||
//DTD validation
|
//DTD validation
|
||||||
@@ -109,12 +109,12 @@ public class ConverterInfoReader {
|
|||||||
System.out.println("Validating xml...");
|
System.out.println("Validating xml...");
|
||||||
builderFactory.setValidating(true);
|
builderFactory.setValidating(true);
|
||||||
}
|
}
|
||||||
//
|
|
||||||
builder = builderFactory.newDocumentBuilder();
|
builder = builderFactory.newDocumentBuilder();
|
||||||
document = builder.parse(isource);
|
document = builder.parse(isource);
|
||||||
|
|
||||||
// Parse the document.
|
// Parse the document.
|
||||||
//
|
|
||||||
parseDocument();
|
parseDocument();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user