[Libreoffice-commits] core.git: xmerge/source

rbuj robert.buj at gmail.com
Tue Sep 9 11:34:42 PDT 2014


 xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/TextStyle.java                 |    4 ++--
 xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/CellStyle.java             |    4 ++--
 xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/ColumnStyle.java           |    4 ++--
 xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/RowStyle.java              |    4 ++--
 xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentSerializer.java |    2 +-
 xmerge/source/xmerge/java/org/openoffice/xmerge/util/OfficeUtil.java                         |    4 ++--
 6 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit c346e0faa20845555e9392c1c8aaba7cf3508fdb
Author: rbuj <robert.buj at gmail.com>
Date:   Tue Sep 9 16:15:58 2014 +0200

    xmerge: use a character literal
    
    Change-Id: I99168faf1ad346f4e18495c15b5bad79fd16818f
    Reviewed-on: https://gerrit.libreoffice.org/11357
    Reviewed-by: Thomas Arnhold <thomas at arnhold.org>
    Tested-by: Thomas Arnhold <thomas at arnhold.org>

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 41fb070..0d61b1a 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
@@ -209,9 +209,9 @@ public class TextStyle extends Style implements Cloneable {
             else if (value.startsWith("0% "))
                 turnAttributesOff(SUPERSCRIPT | SUBSCRIPT);
             else {
-                String firstPart = value.substring(0, value.indexOf(" "));
+                String firstPart = value.substring(0, value.indexOf(' '));
                 if (firstPart.endsWith("%")) {
-                    firstPart = firstPart.substring(0, value.indexOf("%"));
+                    firstPart = firstPart.substring(0, value.indexOf('%'));
                     int amount;
                     try {
                         amount = Integer.parseInt(firstPart);
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 1e319f4..48c84ef 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
@@ -170,9 +170,9 @@ public class CellStyle extends Style implements Cloneable {
             else if (value.startsWith("0% "))
                 fmt.setAttribute(Format.SUPERSCRIPT | Format.SUBSCRIPT, false);
             else {
-                String firstPart = value.substring(0, value.indexOf(" "));
+                String firstPart = value.substring(0, value.indexOf(' '));
                 if (firstPart.endsWith("%")) {
-                    firstPart = firstPart.substring(0, value.indexOf("%"));
+                    firstPart = firstPart.substring(0, value.indexOf('%'));
                     int amount;
                     try {
                         amount = Integer.parseInt(firstPart);
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/ColumnStyle.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/ColumnStyle.java
index d2ce990..bd33a30 100644
--- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/ColumnStyle.java
+++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/ColumnStyle.java
@@ -129,10 +129,10 @@ public class ColumnStyle extends Style implements Cloneable {
         int width = 255;    // Default value
 
         if(value.indexOf("cm")!=-1) {
-            float widthCM = Float.parseFloat(value.substring(0,value.indexOf("c")));
+            float widthCM = Float.parseFloat(value.substring(0,value.indexOf('c')));
             width = TwipsConverter.cm2twips(widthCM);
         } else if(value.indexOf("inch")!=-1) {
-            float widthInch = Float.parseFloat(value.substring(0,value.indexOf("i")));
+            float widthInch = Float.parseFloat(value.substring(0,value.indexOf('i')));
             width = TwipsConverter.inches2twips(widthInch);
         }
 
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/RowStyle.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/RowStyle.java
index 343a4df9..e8cd0e0 100644
--- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/RowStyle.java
+++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/RowStyle.java
@@ -128,10 +128,10 @@ public class RowStyle extends Style implements Cloneable {
         int height = 255;   // Default value
 
         if(value.indexOf("cm")!=-1) {
-            float heightCM = Float.parseFloat(value.substring(0,value.indexOf("c")));
+            float heightCM = Float.parseFloat(value.substring(0,value.indexOf('c')));
             height = TwipsConverter.cm2twips(heightCM);
         } else if(value.indexOf("inch")!=-1) {
-            float heightInch = Float.parseFloat(value.substring(0,value.indexOf("i")));
+            float heightInch = Float.parseFloat(value.substring(0,value.indexOf('i')));
             height = TwipsConverter.inches2twips(heightInch);
         }
 
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentSerializer.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentSerializer.java
index aa4e5c1..c590f4e 100644
--- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentSerializer.java
+++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentSerializer.java
@@ -879,7 +879,7 @@ public abstract class SxcDocumentSerializer implements OfficeConstants,
                 if (child.getNodeType() == Node.TEXT_NODE) {
 
                     String s = child.getNodeValue();
-                    int k = s.lastIndexOf(".");
+                    int k = s.lastIndexOf('.');
                     if (k > 0) {
                         s = s.substring(k+1);
                         decimals = s.length();
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/OfficeUtil.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/OfficeUtil.java
index 949565d..c3433f2 100644
--- a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/OfficeUtil.java
+++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/OfficeUtil.java
@@ -51,14 +51,14 @@ public class OfficeUtil implements OfficeConstants {
          * Office text runs.  There may be more runs in OO because
          * runs of 2 or more spaces map to nodes.
          */
-        while ((text.indexOf("  ") != -1) || (text.indexOf("\t") != 1)) {
+        while ((text.indexOf("  ") != -1) || (text.indexOf('\t') != 1)) {
 
             /*
              * Find the indices of tabs and multiple spaces, and
              * figure out which of them occurs first in the string.
              */
             int spaceIndex = text.indexOf("  ");
-            int tabIndex = text.indexOf("\t");
+            int tabIndex = text.indexOf('\t');
             if ((spaceIndex == -1) && (tabIndex == -1))
                 break;  // DJP This should not be necessary.  What is wrong
             // with the while() stmt up above?


More information about the Libreoffice-commits mailing list