Kaydet (Commit) b9813add authored tarafından rbuj's avatar rbuj Kaydeden (comit) Noel Grandin

xmerge: Convert a primitive type into a string

Avoid unnecessary temporaries when converting primitive data types into a String.

Change-Id: If361383be52d8258be7c8c9bddf3ba05d5ca92c1
Reviewed-on: https://gerrit.libreoffice.org/11026Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
Tested-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst 1558b50e
...@@ -534,7 +534,7 @@ public class ParaStyle extends Style implements Cloneable { ...@@ -534,7 +534,7 @@ public class ParaStyle extends Style implements Cloneable {
for (int i = 0; i <= TEXT_INDENT; i++) { for (int i = 0; i <= TEXT_INDENT; i++) {
if (isSet[i]) { if (isSet[i]) {
double temp = value[i] / 100.0; double temp = value[i] / 100.0;
String stringVal = (new Double(temp)).toString() + "mm"; String stringVal = Double.toString(temp) + "mm";
node.setAttribute(attrName[i], stringVal); node.setAttribute(attrName[i], stringVal);
} }
} }
...@@ -542,10 +542,10 @@ public class ParaStyle extends Style implements Cloneable { ...@@ -542,10 +542,10 @@ public class ParaStyle extends Style implements Cloneable {
if (isSet[LINE_HEIGHT]) { if (isSet[LINE_HEIGHT]) {
String stringVal; String stringVal;
if ((value[LINE_HEIGHT] & LH_PCT) != 0) if ((value[LINE_HEIGHT] & LH_PCT) != 0)
stringVal = (Integer.valueOf(value[LINE_HEIGHT] & LH_VALUEMASK)).toString() + "%"; stringVal = Integer.toString(value[LINE_HEIGHT] & LH_VALUEMASK) + "%";
else { else {
double temp = (value[LINE_HEIGHT] & LH_VALUEMASK) / 100.0; double temp = (value[LINE_HEIGHT] & LH_VALUEMASK) / 100.0;
stringVal = (new Double(temp)).toString() + "mm"; stringVal = Double.toString(temp) + "mm";
} }
node.setAttribute(attrName[LINE_HEIGHT], stringVal); node.setAttribute(attrName[LINE_HEIGHT], stringVal);
} }
......
...@@ -559,8 +559,7 @@ public class TextStyle extends Style implements Cloneable { ...@@ -559,8 +559,7 @@ public class TextStyle extends Style implements Cloneable {
node.setAttribute("style:text-position", "sub 58%"); node.setAttribute("style:text-position", "sub 58%");
if (sizeInPoints != 0) { if (sizeInPoints != 0) {
Integer fs = Integer.valueOf(sizeInPoints); node.setAttribute("fo:font-size", Integer.toString(sizeInPoints) + "pt");
node.setAttribute("fo:font-size", fs.toString() + "pt");
} }
if (fontName != null) if (fontName != null)
......
...@@ -412,8 +412,7 @@ public class CellStyle extends Style implements Cloneable { ...@@ -412,8 +412,7 @@ public class CellStyle extends Style implements Cloneable {
node.setAttribute("style:text-position", "sub 58%"); node.setAttribute("style:text-position", "sub 58%");
if (fmt.getFontSize() != 0) { if (fmt.getFontSize() != 0) {
Integer fs = Integer.valueOf(fmt.getFontSize()); node.setAttribute("fo:font-size", Integer.toString(fmt.getFontSize()) + "pt");
node.setAttribute("fo:font-size", fs.toString() + "pt");
} }
if (fmt.getFontName() != null) if (fmt.getFontName() != null)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment