[Libreoffice-commits] core.git: xmerge/source
rbuj
robert.buj at gmail.com
Tue Aug 19 23:48:58 PDT 2014
xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/ParaStyle.java | 6 +++---
xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/TextStyle.java | 3 +--
xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/CellStyle.java | 3 +--
3 files changed, 5 insertions(+), 7 deletions(-)
New commits:
commit b9813addf2816e4058069892963e50a97643023d
Author: rbuj <robert.buj at gmail.com>
Date: Tue Aug 19 19:41:13 2014 +0200
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/11026
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/ParaStyle.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/ParaStyle.java
index 0234a1b..28c964c 100644
--- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/ParaStyle.java
+++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/ParaStyle.java
@@ -534,7 +534,7 @@ public class ParaStyle extends Style implements Cloneable {
for (int i = 0; i <= TEXT_INDENT; i++) {
if (isSet[i]) {
double temp = value[i] / 100.0;
- String stringVal = (new Double(temp)).toString() + "mm";
+ String stringVal = Double.toString(temp) + "mm";
node.setAttribute(attrName[i], stringVal);
}
}
@@ -542,10 +542,10 @@ public class ParaStyle extends Style implements Cloneable {
if (isSet[LINE_HEIGHT]) {
String stringVal;
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 {
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);
}
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 83efc31..c752f1e 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
@@ -559,8 +559,7 @@ public class TextStyle extends Style implements Cloneable {
node.setAttribute("style:text-position", "sub 58%");
if (sizeInPoints != 0) {
- Integer fs = Integer.valueOf(sizeInPoints);
- node.setAttribute("fo:font-size", fs.toString() + "pt");
+ node.setAttribute("fo:font-size", Integer.toString(sizeInPoints) + "pt");
}
if (fontName != null)
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/CellStyle.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/CellStyle.java
index e437e18..434912c 100644
--- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/CellStyle.java
+++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/CellStyle.java
@@ -412,8 +412,7 @@ public class CellStyle extends Style implements Cloneable {
node.setAttribute("style:text-position", "sub 58%");
if (fmt.getFontSize() != 0) {
- Integer fs = Integer.valueOf(fmt.getFontSize());
- node.setAttribute("fo:font-size", fs.toString() + "pt");
+ node.setAttribute("fo:font-size", Integer.toString(fmt.getFontSize()) + "pt");
}
if (fmt.getFontName() != null)
More information about the Libreoffice-commits
mailing list