diff options
author | rbuj <robert.buj@gmail.com> | 2014-09-07 23:24:12 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-09-08 02:29:43 -0500 |
commit | fa52447b24a833849d0be79487822c036b44554d (patch) | |
tree | 6a4afebc193eb2ee47dcf502804edf1d1e5f5caa | |
parent | 889e27c16525f4c9da8bf43c976a2d0942473afe (diff) |
xmerge: Integer & Boolean Parsing
Change-Id: I9553121a7faf10799c9d9a53336470cb2634c4ee
Reviewed-on: https://gerrit.libreoffice.org/11329
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
4 files changed, 7 insertions, 22 deletions
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/BookSettings.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/BookSettings.java index 2b1a48f7d657..e96951adaa22 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/BookSettings.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/BookSettings.java @@ -148,8 +148,7 @@ public class BookSettings implements OfficeConstants { if(name.equals("ActiveTable")) { activeSheet = value; } else if(name.equals("HasColumnRowHeaders")) { - Boolean b = Boolean.valueOf(value); - hasColumnRowHeaders = b.booleanValue(); + hasColumnRowHeaders = Boolean.parseBoolean(value); } } 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 bf6d2dc7f9f4..aa4e5c146256 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 @@ -386,16 +386,10 @@ public abstract class SxcDocumentSerializer implements OfficeConstants, // There is a number of rows repeated attribute: if (rowsRepeatedNode != null) { - // Get the number of times the row is repeated String rowsRepeatedString = rowsRepeatedNode.getNodeValue(); - - Integer rowsRepeatedInt = Integer.valueOf(rowsRepeatedString); - - rowsRepeated = rowsRepeatedInt.intValue(); - + rowsRepeated = Integer.parseInt(rowsRepeatedString); } else { - // The row is not repeated rowsRepeated = 1; } @@ -575,14 +569,10 @@ public abstract class SxcDocumentSerializer implements OfficeConstants, // There is a number of cols repeated attribute if (colsRepeatedNode != null) { - // Get the number of times the cell is repeated String colsRepeatedString = colsRepeatedNode.getNodeValue(); - - Integer colsRepeatedInt = Integer.valueOf(colsRepeatedString); - colsRepeated = colsRepeatedInt.intValue(); + colsRepeated = Integer.parseInt(colsRepeatedString); } else { - // The cell is not repeated colsRepeated = 1; } diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/IteratorRowCompare.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/IteratorRowCompare.java index f2689d1d83a4..8be248c332b2 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/IteratorRowCompare.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/IteratorRowCompare.java @@ -118,12 +118,10 @@ public class IteratorRowCompare implements DiffAlgorithm { int modRowNum = 1; if (orgRowRepeated.length() > 0) { - orgRowNum = - Integer.valueOf(orgRowRepeated).intValue(); + orgRowNum = Integer.parseInt(orgRowRepeated); } if (modRowRepeated.length() > 0) { - modRowNum = - Integer.valueOf(modRowRepeated).intValue(); + modRowNum = Integer.parseInt(modRowRepeated); } // try to find out the common number of repeated Rows diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/merge/PositionBaseRowMerge.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/merge/PositionBaseRowMerge.java index b3bff5b1d81b..6aa6d25bd089 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/merge/PositionBaseRowMerge.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/merge/PositionBaseRowMerge.java @@ -95,12 +95,10 @@ public final class PositionBaseRowMerge implements NodeMergeAlgorithm { int modColNum = 1; if (orgColRepeated.length() > 0) { - orgColNum = - Integer.valueOf(orgColRepeated).intValue(); + orgColNum = Integer.parseInt(orgColRepeated); } if (modColRepeated.length() > 0) { - modColNum = - Integer.valueOf(modColRepeated).intValue(); + modColNum = Integer.parseInt(modColRepeated); } // try to find out the common number of repeated cols |