summaryrefslogtreecommitdiff
path: root/xmerge
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-12-30 13:38:43 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-12-30 13:38:43 +0000
commit371f5e8e9e345acb2a63106f87e055d49665c399 (patch)
treebbeeab82c98ab7dbb2d0fb920fe1177e3b9046ff /xmerge
parent92ce735143de30f4400fd982b26c1df8cfb64d89 (diff)
coverity#1327008 SBSC: String concatenation in loop using + operator
Change-Id: I2e205bd87760740e1b57647a9a3bdd928be09dfd
Diffstat (limited to 'xmerge')
-rw-r--r--xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/TextStyle.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/TextStyle.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/TextStyle.java
index 8875c21c902f..29e7740c9bba 100644
--- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/TextStyle.java
+++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/TextStyle.java
@@ -416,14 +416,17 @@ public class TextStyle extends Style implements Cloneable {
* Dump this {@code Style} as a Comma Separated Value (CSV) line.
*/
public void dumpCSV() {
- String attributes = "";
+ StringBuilder attributes = new StringBuilder();
for (int bitVal = 0x01; bitVal <= 0x20; bitVal = bitVal << 1) {
if ((bitVal & mask) != 0) {
- attributes += toCSV(((bitVal & values) != 0) ? "yes" : "no");
- } else attributes += toCSV(null); // unspecified
+ attributes.append(toCSV(((bitVal & values) != 0) ? "yes" : "no"));
+ }
+ else {
+ attributes.append(toCSV(null)); // unspecified
+ }
}
System.out.println(toCSV(name) + toCSV(family) + toCSV(parent)
- + toCSV(fontName) + toCSV("" + sizeInPoints) + attributes + toLastCSV(null));
+ + toCSV(fontName) + toCSV("" + sizeInPoints) + attributes.toString() + toLastCSV(null));
}
/**
@@ -569,4 +572,4 @@ public class TextStyle extends Style implements Cloneable {
}
return false;
}
-} \ No newline at end of file
+}