[Libreoffice-commits] core.git: xmerge/source
rbuj
robert.buj at gmail.com
Sun Jul 27 23:19:00 PDT 2014
xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/EmbeddedXMLObject.java | 20 ++++------
1 file changed, 8 insertions(+), 12 deletions(-)
New commits:
commit 62ef93674b117773d2ec5e902c2a6561ffbf6c77
Author: rbuj <robert.buj at gmail.com>
Date: Sun Jul 27 12:23:44 2014 +0200
xmerge: remove String constructor invocation
Change-Id: Ibd7a94c0f53be3b3a3e9ee764dbdeb6199857441
Reviewed-on: https://gerrit.libreoffice.org/10576
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
Tested-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/EmbeddedXMLObject.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/EmbeddedXMLObject.java
index 98858dc..f0c3a72 100644
--- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/EmbeddedXMLObject.java
+++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/EmbeddedXMLObject.java
@@ -191,7 +191,7 @@ public class EmbeddedXMLObject extends EmbeddedObject {
builder = factory.newDocumentBuilder();
}
- byte[] data = zipFile.getNamedBytes(new String(objName + "/" + name));
+ byte[] data = zipFile.getNamedBytes((objName + "/" + name));
if (data != null) {
return OfficeDocument.parse(builder, data);
}
@@ -222,15 +222,15 @@ public class EmbeddedXMLObject extends EmbeddedObject {
void write(OfficeZip zip) throws IOException {
if (hasChanged == true) {
if (contentDOM != null) {
- zip.setNamedBytes(new String(objName + "/content.xml"),
+ zip.setNamedBytes((objName + "/content.xml"),
OfficeDocument.docToBytes(contentDOM));
}
if (settingsDOM != null) {
- zip.setNamedBytes(new String(objName + "/settings.xml"),
+ zip.setNamedBytes((objName + "/settings.xml"),
OfficeDocument.docToBytes(settingsDOM));
}
if (stylesDOM != null) {
- zip.setNamedBytes(new String(objName + "/styles.xml"),
+ zip.setNamedBytes((objName + "/styles.xml"),
OfficeDocument.docToBytes(stylesDOM));
}
}
@@ -249,8 +249,7 @@ public class EmbeddedXMLObject extends EmbeddedObject {
Element contentNode = manifestDoc.createElement(OfficeConstants.TAG_MANIFEST_FILE);
contentNode.setAttribute(OfficeConstants.ATTRIBUTE_MANIFEST_FILE_TYPE, "text/xml");
- contentNode.setAttribute(OfficeConstants.ATTRIBUTE_MANIFEST_FILE_PATH,
- new String(objName + "/content.xml"));
+ contentNode.setAttribute(OfficeConstants.ATTRIBUTE_MANIFEST_FILE_PATH, (objName + "/content.xml"));
root.appendChild(contentNode);
}
@@ -259,8 +258,7 @@ public class EmbeddedXMLObject extends EmbeddedObject {
Element settingsNode = manifestDoc.createElement(OfficeConstants.TAG_MANIFEST_FILE);
settingsNode.setAttribute(OfficeConstants.ATTRIBUTE_MANIFEST_FILE_TYPE, "text/xml");
- settingsNode.setAttribute(OfficeConstants.ATTRIBUTE_MANIFEST_FILE_PATH,
- new String(objName + "/settings.xml"));
+ settingsNode.setAttribute(OfficeConstants.ATTRIBUTE_MANIFEST_FILE_PATH, (objName + "/settings.xml"));
root.appendChild(settingsNode);
}
@@ -269,16 +267,14 @@ public class EmbeddedXMLObject extends EmbeddedObject {
Element stylesNode = manifestDoc.createElement(OfficeConstants.TAG_MANIFEST_FILE);
stylesNode.setAttribute(OfficeConstants.ATTRIBUTE_MANIFEST_FILE_TYPE, "text/xml");
- stylesNode.setAttribute(OfficeConstants.ATTRIBUTE_MANIFEST_FILE_PATH,
- new String(objName + "/styles.xml"));
+ stylesNode.setAttribute(OfficeConstants.ATTRIBUTE_MANIFEST_FILE_PATH, (objName + "/styles.xml"));
}
Element objectNode = manifestDoc.createElement(OfficeConstants.TAG_MANIFEST_FILE);
objectNode.setAttribute(OfficeConstants.ATTRIBUTE_MANIFEST_FILE_TYPE, objType);
- objectNode.setAttribute(OfficeConstants.ATTRIBUTE_MANIFEST_FILE_PATH,
- new String(objName + "/"));
+ objectNode.setAttribute(OfficeConstants.ATTRIBUTE_MANIFEST_FILE_PATH, (objName + "/"));
root.appendChild(objectNode);
}
More information about the Libreoffice-commits
mailing list