From fa5e01e3918a66e6fdbda804a48432d60d7765bd Mon Sep 17 00:00:00 2001 From: Andreas Beeker Date: Mon, 19 Nov 2018 20:48:10 +0000 Subject: [PATCH] Remove commented out System.out calls / Move DummyGraphics2d to testcase area, as it's not used by production code git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1846946 13f79535-47bb-0310-9956-ffa450edef68 --- .../MissingRecordAwareHSSFListener.java | 2 -- .../apache/poi/hssf/record/UnknownRecord.java | 11 ++++------ .../org/apache/poi/ss/formula/Formula.java | 22 ++++++++----------- .../apache/poi/ss/formula/FormulaParser.java | 1 - .../poi/ss/formula/eval/OperandResolver.java | 3 +-- .../poi/ss/usermodel/DataFormatter.java | 1 - .../src/org/apache/poi/hslf/record/Notes.java | 1 - .../poi/hssf/usermodel/DummyGraphics2d.java | 0 8 files changed, 14 insertions(+), 27 deletions(-) rename src/{java => testcases}/org/apache/poi/hssf/usermodel/DummyGraphics2d.java (100%) diff --git a/src/java/org/apache/poi/hssf/eventusermodel/MissingRecordAwareHSSFListener.java b/src/java/org/apache/poi/hssf/eventusermodel/MissingRecordAwareHSSFListener.java index ea9b70d88d..f154a1f86c 100644 --- a/src/java/org/apache/poi/hssf/eventusermodel/MissingRecordAwareHSSFListener.java +++ b/src/java/org/apache/poi/hssf/eventusermodel/MissingRecordAwareHSSFListener.java @@ -94,8 +94,6 @@ public final class MissingRecordAwareHSSFListener implements HSSFListener { break; case RowRecord.sid: RowRecord rowrec = (RowRecord) record; - //System.out.println("Row " + rowrec.getRowNumber() + " found, first column at " - // + rowrec.getFirstCol() + " last column at " + rowrec.getLastCol()); // If there's a jump in rows, fire off missing row records if (lastRowRow + 1 < rowrec.getRowNumber()) { diff --git a/src/java/org/apache/poi/hssf/record/UnknownRecord.java b/src/java/org/apache/poi/hssf/record/UnknownRecord.java index 189b582472..ef324a681f 100644 --- a/src/java/org/apache/poi/hssf/record/UnknownRecord.java +++ b/src/java/org/apache/poi/hssf/record/UnknownRecord.java @@ -80,13 +80,10 @@ public final class UnknownRecord extends StandardRecord { public UnknownRecord(RecordInputStream in) { _sid = in.getSid(); _rawData = in.readRemainder(); -// if (false && getBiffName(_sid) == null) { -// // unknown sids in the range 0x0004-0x0013 are probably 'sub-records' of ObjectRecord -// // those sids are in a different number space. -// // TODO - put unknown OBJ sub-records in a different class -// System.out.println("Unknown record 0x" + -// Integer.toHexString(_sid).toUpperCase(Locale.ROOT)); -// } + + // TODO - put unknown OBJ sub-records in a different class + // unknown sids in the range 0x0004-0x0013 are probably 'sub-records' of ObjectRecord + // those sids are in a different number space. } /** diff --git a/src/java/org/apache/poi/ss/formula/Formula.java b/src/java/org/apache/poi/ss/formula/Formula.java index b0a2842040..50ae3d2aea 100644 --- a/src/java/org/apache/poi/ss/formula/Formula.java +++ b/src/java/org/apache/poi/ss/formula/Formula.java @@ -48,19 +48,15 @@ public class Formula { private Formula(byte[] byteEncoding, int encodedTokenLen) { _byteEncoding = byteEncoding.clone(); _encodedTokenLen = encodedTokenLen; -// if (false) { // set to true to eagerly check Ptg decoding -// LittleEndianByteArrayInputStream in = new LittleEndianByteArrayInputStream(byteEncoding); -// Ptg.readTokens(encodedTokenLen, in); -// int nUnusedBytes = _byteEncoding.length - in.getReadIndex(); -// if (nUnusedBytes > 0) { -// // TODO - this seems to occur when IntersectionPtg is present -// // This example file "IntersectionPtg.xls" -// // used by test: TestIntersectionPtg.testReading() -// // has 10 bytes unused at the end of the formula -// // 10 extra bytes are just 0x01 and 0x00 -// System.out.println(nUnusedBytes + " unused bytes at end of formula"); -// } -// } + + // TODO - this seems to occur when IntersectionPtg is present + // This example file "IntersectionPtg.xls" + // used by test: TestIntersectionPtg.testReading() + // has 10 bytes unused at the end of the formula + // 10 extra bytes are just 0x01 and 0x00 + // LittleEndianByteArrayInputStream in = new LittleEndianByteArrayInputStream(byteEncoding); + // Ptg.readTokens(encodedTokenLen, in); + // int nUnusedBytes = _byteEncoding.length - in.getReadIndex(); } /** * Convenience method for {@link #read(int, LittleEndianInput, int)} diff --git a/src/java/org/apache/poi/ss/formula/FormulaParser.java b/src/java/org/apache/poi/ss/formula/FormulaParser.java index 3b82daad91..bd0c9995bf 100644 --- a/src/java/org/apache/poi/ss/formula/FormulaParser.java +++ b/src/java/org/apache/poi/ss/formula/FormulaParser.java @@ -234,7 +234,6 @@ public final class FormulaParser { _inIntersection = false; } _pointer += Character.charCount(look); - //System.out.println(new StringBuilder("Got char: ").appendCodePoint(look)).toString(); } private void resetPointer(int ptr) { _pointer = ptr; diff --git a/src/java/org/apache/poi/ss/formula/eval/OperandResolver.java b/src/java/org/apache/poi/ss/formula/eval/OperandResolver.java index 7258b98c25..26de08c534 100644 --- a/src/java/org/apache/poi/ss/formula/eval/OperandResolver.java +++ b/src/java/org/apache/poi/ss/formula/eval/OperandResolver.java @@ -88,8 +88,7 @@ public final class OperandResolver { CellRangeAddress range = cell.getArrayFormulaRange(); int relativeRowIndex = cell.getRowIndex() - range.getFirstRow(); int relativeColIndex = cell.getColumnIndex() - range.getFirstColumn(); - //System.out.println("Row: " + relativeRowIndex + " Col: " + relativeColIndex); - + if (ae.isColumn()) { if (ae.isRow()) { return ae.getRelativeValue(0, 0); diff --git a/src/java/org/apache/poi/ss/usermodel/DataFormatter.java b/src/java/org/apache/poi/ss/usermodel/DataFormatter.java index e1e5b7a2c1..b805d0cc85 100644 --- a/src/java/org/apache/poi/ss/usermodel/DataFormatter.java +++ b/src/java/org/apache/poi/ss/usermodel/DataFormatter.java @@ -450,7 +450,6 @@ public class DataFormatter implements Observer { // Strip custom text in quotes and escaped characters for now as it can cause performance problems in fractions. //String strippedFormatStr = formatStr.replaceAll("\\\\ ", " ").replaceAll("\\\\.", "").replaceAll("\"[^\"]*\"", " ").replaceAll("\\?", "#"); - //System.out.println("formatStr: "+strippedFormatStr); return new FractionFormat(defaultFractionWholePartFormat, defaultFractionFractionPartFormat); } diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/Notes.java b/src/scratchpad/src/org/apache/poi/hslf/record/Notes.java index 80ee6039f1..8695b25f0b 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/Notes.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/Notes.java @@ -63,7 +63,6 @@ public final class Notes extends SheetContainer for(int i=0; i<_children.length; i++) { if(_children[i] instanceof NotesAtom) { notesAtom = (NotesAtom)_children[i]; - //System.out.println("Found notes for sheet " + notesAtom.getSlideID()); } if(_children[i] instanceof PPDrawing) { ppDrawing = (PPDrawing)_children[i]; diff --git a/src/java/org/apache/poi/hssf/usermodel/DummyGraphics2d.java b/src/testcases/org/apache/poi/hssf/usermodel/DummyGraphics2d.java similarity index 100% rename from src/java/org/apache/poi/hssf/usermodel/DummyGraphics2d.java rename to src/testcases/org/apache/poi/hssf/usermodel/DummyGraphics2d.java -- 2.39.5