diff options
author | rbuj <robert.buj@gmail.com> | 2014-07-27 12:23:44 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-07-28 06:18:24 +0000 |
commit | 62ef93674b117773d2ec5e902c2a6561ffbf6c77 (patch) | |
tree | 373ffe58b46317dc3e6db005ce2705657babc64f /xmerge | |
parent | 7d06a0601ddccc50185ea97fddcdf2ea39299096 (diff) |
xmerge: remove String constructor invocation
Change-Id: Ibd7a94c0f53be3b3a3e9ee764dbdeb6199857441
Reviewed-on: https://gerrit.libreoffice.org/10576
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'xmerge')
-rw-r--r-- | xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/EmbeddedXMLObject.java | 20 |
1 files changed, 8 insertions, 12 deletions
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 98858dc47b73..f0c3a728ef5b 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); } |