From 851d4f416c730bb1c8e8b100e3e0af89f4a11bc6 Mon Sep 17 00:00:00 2001 From: Sergey Vladimirov Date: Sun, 10 Jul 2011 18:04:17 +0000 Subject: [PATCH] remove unused parameters git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1144923 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/org/apache/poi/hwpf/HWPFDocument.java | 2 +- .../apache/poi/hwpf/model/CHPBinTable.java | 11 +++++----- .../poi/hwpf/model/CHPFormattedDiskPage.java | 22 +++++++++++++------ .../apache/poi/hwpf/model/OldCHPBinTable.java | 2 +- .../poi/hwpf/model/TestCHPBinTable.java | 4 ++-- 5 files changed, 24 insertions(+), 17 deletions(-) diff --git a/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java b/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java index 6901382095..a7090d419e 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java @@ -221,7 +221,7 @@ public final class HWPFDocument extends HWPFDocumentCore // Now load the rest of the properties, which need to be adjusted // for where text really begin - _cbt = new CHPBinTable(_mainStream, _tableStream, _fib.getFcPlcfbteChpx(), _fib.getLcbPlcfbteChpx(), cpMin, _tpt, true); + _cbt = new CHPBinTable(_mainStream, _tableStream, _fib.getFcPlcfbteChpx(), _fib.getLcbPlcfbteChpx(), _tpt, true); _pbt = new PAPBinTable(_mainStream, _tableStream, _dataStream, _fib.getFcPlcfbtePapx(), _fib.getLcbPlcfbtePapx(), cpMin, _tpt, true); // Read FSPA and Escher information diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/CHPBinTable.java b/src/scratchpad/src/org/apache/poi/hwpf/model/CHPBinTable.java index 3097e00048..c03a4040b8 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/CHPBinTable.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/CHPBinTable.java @@ -51,21 +51,20 @@ public class CHPBinTable * Constructor used to read a binTable in from a Word document. * * @deprecated Use - * {@link #CHPBinTable(byte[],byte[],int,int,int,TextPieceTable,boolean)} + * {@link #CHPBinTable(byte[],byte[],int,int,TextPieceTable,boolean)} * instead */ public CHPBinTable( byte[] documentStream, byte[] tableStream, int offset, int size, int fcMin, TextPieceTable tpt ) { - this( documentStream, tableStream, offset, size, fcMin, tpt, true ); + this( documentStream, tableStream, offset, size, tpt, true ); } /** * Constructor used to read a binTable in from a Word document. */ public CHPBinTable( byte[] documentStream, byte[] tableStream, int offset, - int size, int fcMin, TextPieceTable tpt, - boolean ignoreChpxWithoutTextPieces ) + int size, TextPieceTable tpt, boolean ignoreChpxWithoutTextPieces ) { /* * Page 35: @@ -87,7 +86,7 @@ public class CHPBinTable int pageOffset = POIFSConstants.SMALLER_BIG_BLOCK_SIZE * pageNum; CHPFormattedDiskPage cfkp = new CHPFormattedDiskPage(documentStream, - pageOffset, fcMin, tpt, ignoreChpxWithoutTextPieces); + pageOffset, tpt, ignoreChpxWithoutTextPieces); int fkpSize = cfkp.size(); @@ -243,7 +242,7 @@ public class CHPBinTable CHPFormattedDiskPage cfkp = new CHPFormattedDiskPage(); cfkp.fill(overflow); - byte[] bufFkp = cfkp.toByteArray( tpt, fcMin ); + byte[] bufFkp = cfkp.toByteArray( tpt ); docStream.write(bufFkp); overflow = cfkp.getOverflow(); diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/CHPFormattedDiskPage.java b/src/scratchpad/src/org/apache/poi/hwpf/model/CHPFormattedDiskPage.java index 68615dd4ff..ed5dae220b 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/CHPFormattedDiskPage.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/CHPFormattedDiskPage.java @@ -55,24 +55,22 @@ public final class CHPFormattedDiskPage extends FormattedDiskPage * read from a Word file). * * @deprecated Use - * {@link #CHPFormattedDiskPage(byte[],int,int,TextPieceTable,boolean)} + * {@link #CHPFormattedDiskPage(byte[],int,TextPieceTable,boolean)} * instead */ + @SuppressWarnings( "unused" ) public CHPFormattedDiskPage( byte[] documentStream, int offset, int fcMin, TextPieceTable tpt ) { - this( documentStream, offset, fcMin, tpt, true ); + this( documentStream, offset, tpt, true ); } /** * This constructs a CHPFormattedDiskPage from a raw fkp (512 byte array * read from a Word file). - * - * @param ignoreChpxWithoutTextPieces - * TODO */ - public CHPFormattedDiskPage( byte[] documentStream, int offset, int fcMin, - TextPieceTable tpt, boolean ignoreChpxWithoutTextPieces ) + public CHPFormattedDiskPage( byte[] documentStream, int offset, TextPieceTable tpt, + boolean ignoreChpxWithoutTextPieces ) { super(documentStream, offset); @@ -128,7 +126,17 @@ public final class CHPFormattedDiskPage extends FormattedDiskPage return chpx; } + /** + * @deprecated Use {@link #toByteArray(CharIndexTranslator)} instead + */ + @Deprecated + @SuppressWarnings( "unused" ) protected byte[] toByteArray(CharIndexTranslator translator, int fcMin) + { + return toByteArray( translator ); + } + + protected byte[] toByteArray(CharIndexTranslator translator) { byte[] buf = new byte[512]; int size = _chpxList.size(); diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/OldCHPBinTable.java b/src/scratchpad/src/org/apache/poi/hwpf/model/OldCHPBinTable.java index c1f25dbb37..3f43c2f1bb 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/OldCHPBinTable.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/OldCHPBinTable.java @@ -60,7 +60,7 @@ public final class OldCHPBinTable extends CHPBinTable int pageOffset = POIFSConstants.SMALLER_BIG_BLOCK_SIZE * pageNum; CHPFormattedDiskPage cfkp = new CHPFormattedDiskPage(documentStream, - pageOffset, fcMin, tpt, true); + pageOffset, tpt, true); int fkpSize = cfkp.size(); diff --git a/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestCHPBinTable.java b/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestCHPBinTable.java index c2b8789011..e2aeeb46cb 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestCHPBinTable.java +++ b/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestCHPBinTable.java @@ -46,7 +46,7 @@ public final class TestCHPBinTable byte[] tableStream = _hWPFDocFixture._tableStream; int fcMin = fib.getFcMin(); - _cHPBinTable = new CHPBinTable(mainStream, tableStream, fib.getFcPlcfbteChpx(), fib.getLcbPlcfbteChpx(), fcMin, fakeTPT, false); + _cHPBinTable = new CHPBinTable(mainStream, tableStream, fib.getFcPlcfbteChpx(), fib.getLcbPlcfbteChpx(), fakeTPT, false); HWPFFileSystem fileSys = new HWPFFileSystem(); @@ -57,7 +57,7 @@ public final class TestCHPBinTable byte[] newTableStream = tableOut.toByteArray(); byte[] newMainStream = mainOut.toByteArray(); - CHPBinTable newBinTable = new CHPBinTable(newMainStream, newTableStream, 0, newTableStream.length, 0, fakeTPT, false); + CHPBinTable newBinTable = new CHPBinTable(newMainStream, newTableStream, 0, newTableStream.length, fakeTPT, false); ArrayList oldTextRuns = _cHPBinTable._textRuns; ArrayList newTextRuns = newBinTable._textRuns; -- 2.39.5