You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by jo...@apache.org on 2009/05/21 20:15:01 UTC
svn commit: r777204 [14/21] - in /poi/trunk/src/scratchpad:
examples/src/org/apache/poi/hslf/examples/
examples/src/org/apache/poi/hwpf/ src/org/apache/poi/hdf/event/
src/org/apache/poi/hdf/extractor/ src/org/apache/poi/hdf/extractor/data/
src/org/apac...
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmIterator.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmIterator.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmIterator.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmIterator.java Thu May 21 18:12:22 2009
@@ -1,4 +1,3 @@
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -15,7 +14,6 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hwpf.sprm;
@@ -26,7 +24,7 @@
* @version 1.0
*/
-public class SprmIterator
+public final class SprmIterator
{
private byte[] _grpprl;
int _offset;
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmOperation.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmOperation.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmOperation.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmOperation.java Thu May 21 18:12:22 2009
@@ -1,4 +1,3 @@
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -15,7 +14,6 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hwpf.sprm;
@@ -29,7 +27,7 @@
* @author Ryan Ackley
* @version 1.0
*/
-public class SprmOperation
+public final class SprmOperation
{
final static private BitField OP_BITFIELD = BitFieldFactory.getInstance(0x1ff);
final static private BitField SPECIAL_BITFIELD = BitFieldFactory.getInstance(0x200);
@@ -102,7 +100,7 @@
return LittleEndian.getInt(_grpprl, _gOffset);
case 6:
byte operandLength = _grpprl[_gOffset + 1]; //surely shorter than an int...
-
+
byte [] codeBytes = new byte[LittleEndian.INT_SIZE]; //initialized to zeros by JVM
for(int i = 0; i < operandLength; i++)
if(_gOffset + i < _grpprl.length)
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmUncompressor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmUncompressor.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmUncompressor.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmUncompressor.java Thu May 21 18:12:22 2009
@@ -1,4 +1,3 @@
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -15,15 +14,14 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hwpf.sprm;
-public class SprmUncompressor
+public abstract class SprmUncompressor
{
- public SprmUncompressor()
+ protected SprmUncompressor()
{
}
@@ -41,10 +39,7 @@
{
return true;
}
- else
- {
- return false;
- }
+ return false;
}
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmUtils.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmUtils.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmUtils.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmUtils.java Thu May 21 18:12:22 2009
@@ -1,4 +1,3 @@
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -15,7 +14,6 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hwpf.sprm;
@@ -24,7 +22,7 @@
import org.apache.poi.util.LittleEndian;
-public class SprmUtils
+public final class SprmUtils
{
public SprmUtils()
{
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/TableSprmCompressor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/TableSprmCompressor.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/TableSprmCompressor.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/TableSprmCompressor.java Thu May 21 18:12:22 2009
@@ -1,4 +1,3 @@
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -15,7 +14,6 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hwpf.sprm;
@@ -28,7 +26,7 @@
import java.util.ArrayList;
import java.util.Arrays;
-public class TableSprmCompressor
+public final class TableSprmCompressor
{
public TableSprmCompressor()
{
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/TableSprmUncompressor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/TableSprmUncompressor.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/TableSprmUncompressor.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/TableSprmUncompressor.java Thu May 21 18:12:22 2009
@@ -1,4 +1,3 @@
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -16,7 +15,6 @@
limitations under the License.
==================================================================== */
-
package org.apache.poi.hwpf.sprm;
import org.apache.poi.hwpf.usermodel.TableProperties;
@@ -25,7 +23,7 @@
import org.apache.poi.util.LittleEndian;
-public class TableSprmUncompressor
+public final class TableSprmUncompressor
extends SprmUncompressor
{
public TableSprmUncompressor()
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/BorderCode.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/BorderCode.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/BorderCode.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/BorderCode.java Thu May 21 18:12:22 2009
@@ -1,4 +1,3 @@
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -15,7 +14,6 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hwpf.usermodel;
@@ -23,7 +21,7 @@
import org.apache.poi.util.BitFieldFactory;
import org.apache.poi.util.LittleEndian;
-public class BorderCode
+public final class BorderCode
implements Cloneable
{
public static final int SIZE = 4;
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterProperties.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterProperties.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterProperties.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterProperties.java Thu May 21 18:12:22 2009
@@ -1,4 +1,3 @@
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -16,7 +15,6 @@
limitations under the License.
==================================================================== */
-
package org.apache.poi.hwpf.usermodel;
import org.apache.poi.hwpf.model.types.CHPAbstractType;
@@ -24,7 +22,7 @@
/**
* @author Ryan Ackley
*/
-public class CharacterProperties
+public final class CharacterProperties
extends CHPAbstractType implements Cloneable
{
public final static short SPRM_FRMARKDEL = (short)0x0800;
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterRun.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterRun.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterRun.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterRun.java Thu May 21 18:12:22 2009
@@ -15,8 +15,6 @@
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hwpf.usermodel;
import org.apache.poi.hwpf.model.CHPX;
@@ -28,7 +26,7 @@
*
* @author Ryan Ackley
*/
-public class CharacterRun
+public final class CharacterRun
extends Range
implements Cloneable
{
@@ -530,7 +528,7 @@
return (CharacterProperties)_props.clone();
} catch(java.lang.CloneNotSupportedException e) {
throw new RuntimeException(e);
- }
+ }
}
/**
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/DateAndTime.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/DateAndTime.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/DateAndTime.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/DateAndTime.java Thu May 21 18:12:22 2009
@@ -15,8 +15,6 @@
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hwpf.usermodel;
import org.apache.poi.util.BitField;
@@ -28,7 +26,7 @@
*
* @author Ryan Ackley
*/
-public class DateAndTime
+public final class DateAndTime
implements Cloneable
{
public static final int SIZE = 4;
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/DocumentPosition.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/DocumentPosition.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/DocumentPosition.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/DocumentPosition.java Thu May 21 18:12:22 2009
@@ -15,14 +15,11 @@
limitations under the License.
==================================================================== */
-/**
- * @author Ryan Ackley
- */
package org.apache.poi.hwpf.usermodel;
import org.apache.poi.hwpf.HWPFDocument;
-public class DocumentPosition
+public final class DocumentPosition
extends Range
{
public DocumentPosition(HWPFDocument doc, int pos)
@@ -30,4 +27,4 @@
super(pos, pos, doc);
}
-}
\ No newline at end of file
+}
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/DropCapSpecifier.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/DropCapSpecifier.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/DropCapSpecifier.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/DropCapSpecifier.java Thu May 21 18:12:22 2009
@@ -29,7 +29,7 @@
*
* @author Ryan Ackley
*/
-public class DropCapSpecifier
+public final class DropCapSpecifier
{
private short _info;
private static BitField _type = BitFieldFactory.getInstance(0x07);
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/HWPFList.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/HWPFList.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/HWPFList.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/HWPFList.java Thu May 21 18:12:22 2009
@@ -43,7 +43,7 @@
*
* @author Ryan Ackley
*/
-public class HWPFList
+public final class HWPFList
{
private ListData _listData;
private ListFormatOverride _override;
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/HeaderStories.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/HeaderStories.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/HeaderStories.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/HeaderStories.java Thu May 21 18:12:22 2009
@@ -14,6 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
+
package org.apache.poi.hwpf.usermodel;
import org.apache.poi.hwpf.HWPFDocument;
@@ -22,25 +23,25 @@
import org.apache.poi.hwpf.model.PlexOfCps;
/**
- * A HeaderStory is a Header, a Footer, or footnote/endnote
+ * A HeaderStory is a Header, a Footer, or footnote/endnote
* separator.
* All the Header Stories get stored in the same Range in the
* document, and this handles getting out all the individual
* parts.
- *
+ *
* WARNING - you shouldn't change the headers or footers,
* as offsets are not yet updated!
*/
-public class HeaderStories {
+public final class HeaderStories {
private Range headerStories;
private PlexOfCps plcfHdd;
-
+
private boolean stripFields = false;
-
+
public HeaderStories(HWPFDocument doc) {
this.headerStories = doc.getHeaderStoryRange();
FileInformationBlock fib = doc.getFileInformationBlock();
-
+
// If there's no PlcfHdd, nothing to do
if(fib.getCcpHdd() == 0) {
return;
@@ -48,14 +49,14 @@
if(fib.getPlcfHddSize() == 0) {
return;
}
-
+
// Handle the PlcfHdd
plcfHdd = new PlexOfCps(
doc.getTableStream(), fib.getPlcfHddOffset(),
fib.getPlcfHddSize(), 0
);
}
-
+
public String getFootnoteSeparator() {
return getAt(0);
}
@@ -74,8 +75,8 @@
public String getEndnoteContNote() {
return getAt(5);
}
-
-
+
+
public String getEvenHeader() {
return getAt(6+0);
}
@@ -108,8 +109,8 @@
// Odd is the default
return getOddHeader();
}
-
-
+
+
public String getEvenFooter() {
return getAt(6+2);
}
@@ -142,25 +143,25 @@
// Odd is the default
return getOddFooter();
}
-
-
+
+
/**
* Get the string that's pointed to by the
- * given plcfHdd index
+ * given plcfHdd index
*/
private String getAt(int plcfHddIndex) {
if(plcfHdd == null) return null;
-
+
GenericPropertyNode prop = plcfHdd.getProperty(plcfHddIndex);
if(prop.getStart() == prop.getEnd()) {
// Empty story
return "";
}
-
+
// Grab the contents
String text =
headerStories.text().substring(prop.getStart(), prop.getEnd());
-
+
// Strip off fields and macros if requested
if(stripFields) {
return Range.stripFields(text);
@@ -171,17 +172,17 @@
if(text.equals("\r\r")) {
return "";
}
-
+
return text;
}
-
+
public Range getRange() {
return headerStories;
}
protected PlexOfCps getPlcfHdd() {
return plcfHdd;
}
-
+
/**
* Are fields currently being stripped from
* the text that this {@link HeaderStories} returns?
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/LineSpacingDescriptor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/LineSpacingDescriptor.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/LineSpacingDescriptor.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/LineSpacingDescriptor.java Thu May 21 18:12:22 2009
@@ -24,7 +24,7 @@
*
* @author Ryan Ackley
*/
-public class LineSpacingDescriptor
+public final class LineSpacingDescriptor
implements Cloneable
{
short _dyaLine;
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ListEntry.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ListEntry.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ListEntry.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ListEntry.java Thu May 21 18:12:22 2009
@@ -1,4 +1,3 @@
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -15,7 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
+
package org.apache.poi.hwpf.usermodel;
import org.apache.poi.hwpf.model.ListFormatOverride;
@@ -26,18 +25,18 @@
import org.apache.poi.util.POILogFactory;
import org.apache.poi.util.POILogger;
-public class ListEntry
+public final class ListEntry
extends Paragraph
{
private static POILogger log = POILogFactory.getLogger(ListEntry.class);
-
+
ListLevel _level;
ListFormatOverrideLevel _overrideLevel;
ListEntry(PAPX papx, Range parent, ListTables tables)
{
super(papx, parent);
-
+
if(tables != null) {
ListFormatOverride override = tables.getOverride(_props.getIlfo());
_overrideLevel = override.getOverrideLevel(_props.getIlvl());
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Paragraph.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Paragraph.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Paragraph.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Paragraph.java Thu May 21 18:12:22 2009
@@ -1,4 +1,3 @@
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -16,17 +15,13 @@
limitations under the License.
==================================================================== */
-
package org.apache.poi.hwpf.usermodel;
import org.apache.poi.hwpf.model.PAPX;
import org.apache.poi.hwpf.sprm.SprmBuffer;
import org.apache.poi.hwpf.sprm.TableSprmCompressor;
-public class Paragraph
- extends Range
- implements Cloneable
-{
+public class Paragraph extends Range implements Cloneable {
public final static short SPRM_JC = 0x2403;
public final static short SPRM_FSIDEBYSIDE = 0x2404;
public final static short SPRM_FKEEP = 0x2405;
@@ -457,7 +452,7 @@
/**
* clone the ParagraphProperties object associated with this Paragraph so
* that you can apply the same properties to another paragraph.
- *
+ *
*/
public ParagraphProperties cloneProperties() {
try {
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ParagraphProperties.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ParagraphProperties.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ParagraphProperties.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ParagraphProperties.java Thu May 21 18:12:22 2009
@@ -1,4 +1,3 @@
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -15,7 +14,6 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hwpf.usermodel;
@@ -24,7 +22,7 @@
import org.apache.poi.hwpf.sprm.SprmBuffer;
-public class ParagraphProperties
+public final class ParagraphProperties
extends PAPAbstractType
implements Cloneable
{
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Picture.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Picture.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Picture.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Picture.java Thu May 21 18:12:22 2009
@@ -15,7 +15,6 @@
limitations under the License.
==================================================================== */
-
package org.apache.poi.hwpf.usermodel;
import org.apache.poi.util.LittleEndian;
@@ -32,7 +31,7 @@
* Represents embedded picture extracted from Word Document
* @author Dmitry Romanov
*/
-public class Picture
+public final class Picture
{
private static final POILogger log = POILogFactory.getLogger(Picture.class);
@@ -98,7 +97,7 @@
fillImageContent();
}
}
-
+
public Picture(byte[] _dataStream)
{
this._dataStream = _dataStream;
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java Thu May 21 18:12:22 2009
@@ -15,8 +15,6 @@
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hwpf.usermodel;
@@ -60,8 +58,7 @@
*
* @author Ryan Ackley
*/
-public class Range
-{
+public class Range { // TODO -instantiable superclass
public static final int TYPE_PARAGRAPH = 0;
public static final int TYPE_CHARACTER= 1;
@@ -155,7 +152,7 @@
_characters = _doc.getCharacterTable().getTextRuns();
_text = _doc.getTextTable().getTextPieces();
_parent = new WeakReference(null);
-
+
sanityCheckStartEnd();
}
@@ -177,7 +174,7 @@
_characters = parent._characters;
_text = parent._text;
_parent = new WeakReference(parent);
-
+
sanityCheckStartEnd();
}
@@ -230,10 +227,10 @@
_textRangeFound = true;
break;
}
-
+
sanityCheckStartEnd();
}
-
+
/**
* Ensures that the start and end were were given
* are actually valid, to avoid issues later on
@@ -281,7 +278,7 @@
for (int x = _textStart; x < _textEnd; x++)
{
TextPiece piece = (TextPiece)_text.get(x);
-
+
// Figure out where in this piece the text
// we're after lives
int rStart = 0;
@@ -292,14 +289,14 @@
if(_end < piece.getEnd()) {
rEnd -= (piece.getEnd() - _end);
}
-
+
// Luckily TextPieces work in characters, so we don't
// need to worry about unicode here
sb.append(piece.substring(rStart, rEnd));
}
return sb.toString();
}
-
+
/**
* Removes any fields (eg macros, page markers etc)
* from the string.
@@ -311,10 +308,10 @@
// First up, fields can be nested...
// A field can be 0x13 [contents] 0x15
// Or it can be 0x13 [contents] 0x14 [real text] 0x15
-
+
// If there are no fields, all easy
if(text.indexOf('\u0013') == -1) return text;
-
+
// Loop over until they're all gone
// That's when we're out of both 0x13s and 0x15s
while( text.indexOf('\u0013') > -1 &&
@@ -323,19 +320,19 @@
int next13 = text.indexOf('\u0013', first13+1);
int first14 = text.indexOf('\u0014', first13+1);
int last15 = text.lastIndexOf('\u0015');
-
+
// If they're the wrong way around, give up
if(last15 < first13) {
break;
}
-
+
// If no more 13s and 14s, just zap
if(next13 == -1 && first14 == -1) {
text = text.substring(0, first13) +
text.substring(last15+1);
break;
}
-
+
// If a 14 comes before the next 13, then
// zap from the 13 to the 14, and remove
// the 15
@@ -345,7 +342,7 @@
text.substring(last15+1);
continue;
}
-
+
// Another 13 comes before the next 14.
// This means there's nested stuff, so we
// can just zap the lot
@@ -626,7 +623,7 @@
sepx.adjustForDelete(_start, _end - _start);
//System.err.println("Section " + x + " is now " + sepx.getStart() + " -> " + sepx.getEnd());
}
-
+
for (int x = _textStart; x < numTextPieces; x++)
{
TextPiece piece = (TextPiece)_text.get(x);
@@ -728,7 +725,7 @@
{
int absPlaceHolderIndex = getStartOffset() + pOffset;
Range subRange = new Range(
- absPlaceHolderIndex,
+ absPlaceHolderIndex,
(absPlaceHolderIndex + pPlaceHolder.length()), getDocument()
);
@@ -744,7 +741,7 @@
// re-create the sub-range so we can delete it
subRange = new Range(
(absPlaceHolderIndex + pValue.length()),
- (absPlaceHolderIndex + pPlaceHolder.length() + pValue.length()),
+ (absPlaceHolderIndex + pPlaceHolder.length() + pValue.length()),
getDocument()
);
@@ -1005,7 +1002,7 @@
/**
* Adjust the value of the various FIB character count fields,
* eg <code>FIB.CCPText</code> after an insert or a delete...
- *
+ *
* Works on all CCP fields from this range onwards
*
* @param adjustment The (signed) value that should be added to the FIB CCP fields
@@ -1017,12 +1014,12 @@
CPSplitCalculator cpS = _doc.getCPSplitCalculator();
FileInformationBlock fib = _doc.getFileInformationBlock();
-
+
// Do for each affected part
if(_start < cpS.getMainDocumentEnd()) {
fib.setCcpText(fib.getCcpText() + adjustment);
}
-
+
if(_start < cpS.getCommentsEnd()) {
fib.setCcpAtn(fib.getCcpAtn() + adjustment);
}
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Section.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Section.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Section.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Section.java Thu May 21 18:12:22 2009
@@ -1,4 +1,3 @@
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -16,12 +15,11 @@
limitations under the License.
==================================================================== */
-
package org.apache.poi.hwpf.usermodel;
import org.apache.poi.hwpf.model.SEPX;
-public class Section
+public final class Section
extends Range
{
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/SectionProperties.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/SectionProperties.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/SectionProperties.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/SectionProperties.java Thu May 21 18:12:22 2009
@@ -1,4 +1,3 @@
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -15,7 +14,6 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hwpf.usermodel;
@@ -24,7 +22,7 @@
import java.lang.reflect.Field;
import java.lang.reflect.AccessibleObject;
-public class SectionProperties
+public final class SectionProperties
extends SEPAbstractType
{
public SectionProperties()
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ShadingDescriptor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ShadingDescriptor.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ShadingDescriptor.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ShadingDescriptor.java Thu May 21 18:12:22 2009
@@ -1,4 +1,3 @@
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -15,7 +14,6 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hwpf.usermodel;
@@ -23,7 +21,7 @@
import org.apache.poi.util.BitFieldFactory;
import org.apache.poi.util.LittleEndian;
-public class ShadingDescriptor
+public final class ShadingDescriptor
implements Cloneable
{
public static final int SIZE = 2;
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Shape.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Shape.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Shape.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Shape.java Thu May 21 18:12:22 2009
@@ -20,14 +20,14 @@
import org.apache.poi.hwpf.model.GenericPropertyNode;
import org.apache.poi.util.LittleEndian;
-public class Shape {
+public final class Shape {
int _id, _left, _right, _top, _bottom;
/**
* true if the Shape bounds are within document (for
* example, it's false if the image left corner is outside the doc, like for
* embedded documents)
*/
- boolean _inDoc;
+ boolean _inDoc;
public Shape(GenericPropertyNode nodo) {
byte [] contenuto = nodo.getBytes();
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Table.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Table.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Table.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Table.java Thu May 21 18:12:22 2009
@@ -1,4 +1,3 @@
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -20,7 +19,7 @@
import java.util.ArrayList;
-public class Table
+public final class Table
extends Range
{
ArrayList _rows;
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableCell.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableCell.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableCell.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableCell.java Thu May 21 18:12:22 2009
@@ -1,4 +1,3 @@
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -15,10 +14,10 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
+
package org.apache.poi.hwpf.usermodel;
-public class TableCell
+public final class TableCell
extends Range
{
private int _levelNum;
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableCellDescriptor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableCellDescriptor.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableCellDescriptor.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableCellDescriptor.java Thu May 21 18:12:22 2009
@@ -1,4 +1,3 @@
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -15,13 +14,12 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hwpf.usermodel;
import org.apache.poi.hwpf.model.types.TCAbstractType;
-public class TableCellDescriptor
+public final class TableCellDescriptor
extends TCAbstractType
{
public static final int SIZE = 20;
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableIterator.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableIterator.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableIterator.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableIterator.java Thu May 21 18:12:22 2009
@@ -1,4 +1,3 @@
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -15,13 +14,13 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
+
package org.apache.poi.hwpf.usermodel;
import java.util.ArrayList;
-public class TableIterator
+public final class TableIterator
{
Range _range;
int _index;
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableProperties.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableProperties.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableProperties.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableProperties.java Thu May 21 18:12:22 2009
@@ -1,4 +1,3 @@
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -15,13 +14,12 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.hwpf.usermodel;
import org.apache.poi.hwpf.model.types.TAPAbstractType;
-public class TableProperties
+public final class TableProperties
extends TAPAbstractType
implements Cloneable
{
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableRow.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableRow.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableRow.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableRow.java Thu May 21 18:12:22 2009
@@ -1,4 +1,3 @@
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -20,7 +19,7 @@
import org.apache.poi.hwpf.sprm.TableSprmUncompressor;
-public class TableRow
+public final class TableRow
extends Paragraph
{
private final static char TABLE_CELL_MARK = '\u0007';
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/AutoShape.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/AutoShape.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/AutoShape.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/AutoShape.java Thu May 21 18:12:22 2009
@@ -14,6 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
+
package org.apache.poi.sl.usermodel;
public interface AutoShape extends SimpleShape {
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Background.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Background.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Background.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Background.java Thu May 21 18:12:22 2009
@@ -14,6 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
+
package org.apache.poi.sl.usermodel;
public interface Background extends Shape {
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Fill.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Fill.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Fill.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Fill.java Thu May 21 18:12:22 2009
@@ -14,6 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
+
package org.apache.poi.sl.usermodel;
public interface Fill extends org.apache.poi.common.usermodel.Fill {
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/FontCollection.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/FontCollection.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/FontCollection.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/FontCollection.java Thu May 21 18:12:22 2009
@@ -14,6 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
+
package org.apache.poi.sl.usermodel;
public interface FontCollection {
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Hyperlink.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Hyperlink.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Hyperlink.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Hyperlink.java Thu May 21 18:12:22 2009
@@ -14,6 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
+
package org.apache.poi.sl.usermodel;
/**
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Line.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Line.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Line.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Line.java Thu May 21 18:12:22 2009
@@ -14,6 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
+
package org.apache.poi.sl.usermodel;
public interface Line extends AutoShape {
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/LineStyle.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/LineStyle.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/LineStyle.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/LineStyle.java Thu May 21 18:12:22 2009
@@ -14,6 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
+
package org.apache.poi.sl.usermodel;
public interface LineStyle extends org.apache.poi.common.usermodel.LineStyle {
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/MasterSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/MasterSheet.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/MasterSheet.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/MasterSheet.java Thu May 21 18:12:22 2009
@@ -14,6 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
+
package org.apache.poi.sl.usermodel;
public interface MasterSheet extends Sheet {
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Notes.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Notes.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Notes.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Notes.java Thu May 21 18:12:22 2009
@@ -14,6 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
+
package org.apache.poi.sl.usermodel;
public interface Notes extends Sheet {
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Picture.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Picture.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Picture.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Picture.java Thu May 21 18:12:22 2009
@@ -14,6 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
+
package org.apache.poi.sl.usermodel;
public interface Picture extends SimpleShape {
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/PictureData.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/PictureData.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/PictureData.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/PictureData.java Thu May 21 18:12:22 2009
@@ -14,12 +14,13 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
+
package org.apache.poi.sl.usermodel;
public interface PictureData {
public int getType();
public byte[] getUID();
-
+
public byte[] getData();
public void setData(byte[] data);
}
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Resources.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Resources.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Resources.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Resources.java Thu May 21 18:12:22 2009
@@ -14,6 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
+
package org.apache.poi.sl.usermodel;
/**
@@ -22,7 +23,7 @@
*/
public interface Resources {
public FontCollection getFontCollection();
-
+
public PictureData[] getPictureData();
public int addPictureData(PictureData pict);
}
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Shape.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Shape.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Shape.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Shape.java Thu May 21 18:12:22 2009
@@ -14,17 +14,18 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
+
package org.apache.poi.sl.usermodel;
import java.awt.geom.Rectangle2D;
public interface Shape {
public int getShapeType();
-
+
public Rectangle2D getAnchor();
public void setAnchor(Rectangle2D anchor);
-
+
public void moveTo(float x, float y);
-
+
public Shape getParent();
}
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/ShapeContainer.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/ShapeContainer.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/ShapeContainer.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/ShapeContainer.java Thu May 21 18:12:22 2009
@@ -14,6 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
+
package org.apache.poi.sl.usermodel;
public interface ShapeContainer {
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/ShapeGroup.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/ShapeGroup.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/ShapeGroup.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/ShapeGroup.java Thu May 21 18:12:22 2009
@@ -14,6 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
+
package org.apache.poi.sl.usermodel;
public interface ShapeGroup extends ShapeContainer {
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/ShapeTypes.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/ShapeTypes.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/ShapeTypes.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/ShapeTypes.java Thu May 21 18:12:22 2009
@@ -14,6 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
+
package org.apache.poi.sl.usermodel;
public interface ShapeTypes {
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Sheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Sheet.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Sheet.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Sheet.java Thu May 21 18:12:22 2009
@@ -14,6 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
+
package org.apache.poi.sl.usermodel;
/**
@@ -23,6 +24,6 @@
public SlideShow getSlideShow();
public MasterSheet getMasterSheet();
-
+
public Background getBackground();
}
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/SimpleShape.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/SimpleShape.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/SimpleShape.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/SimpleShape.java Thu May 21 18:12:22 2009
@@ -14,12 +14,13 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
+
package org.apache.poi.sl.usermodel;
public interface SimpleShape extends Shape {
public Fill getFill();
public LineStyle getLineStyle();
-
+
public Hyperlink getHyperlink();
public void setHyperlink(Hyperlink hyperlink);
}
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Slide.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Slide.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Slide.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Slide.java Thu May 21 18:12:22 2009
@@ -14,18 +14,19 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
+
package org.apache.poi.sl.usermodel;
public interface Slide extends Sheet {
public Notes getNotes();
public void setNotes(Notes notes);
-
+
public boolean getFollowMasterBackground();
public void setFollowMasterBackground(boolean follow);
-
+
public boolean getFollowMasterColourScheme();
public void setFollowMasterColourScheme(boolean follow);
-
+
public boolean getFollowMasterObjects();
public void setFollowMasterObjects(boolean follow);
}
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/SlideShow.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/SlideShow.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/SlideShow.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/SlideShow.java Thu May 21 18:12:22 2009
@@ -14,6 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
+
package org.apache.poi.sl.usermodel;
import java.io.IOException;
@@ -21,9 +22,9 @@
public interface SlideShow {
public Slide createSlide() throws IOException;
public MasterSheet createMasterSheet() throws IOException;
-
+
public Slide[] getSlides();
public MasterSheet[] getMasterSheet();
-
+
public Resources getResources();
}
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/TextBox.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/TextBox.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/TextBox.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/TextBox.java Thu May 21 18:12:22 2009
@@ -14,6 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
+
package org.apache.poi.sl.usermodel;
public interface TextBox extends AutoShape {
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/TextRun.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/TextRun.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/TextRun.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/TextRun.java Thu May 21 18:12:22 2009
@@ -14,16 +14,17 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
+
package org.apache.poi.sl.usermodel;
/**
* Some text.
- *
+ *
* TODO - decide on how we do rich text stuff
*/
public interface TextRun {
public String getText();
public void setText(String text);
-
+
// TODO - rich text formatting stuff
}
Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/TestPOIDocumentScratchpad.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/TestPOIDocumentScratchpad.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/TestPOIDocumentScratchpad.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/TestPOIDocumentScratchpad.java Thu May 21 18:12:22 2009
@@ -15,7 +15,7 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
+
package org.apache.poi;
@@ -34,10 +34,10 @@
*
* This is part 2 of 2 of the tests - it only does the POIDocuments
* which are part of the scratchpad (not main)
- *
+ *
* @author Nick Burch (nick at torchbox dot com)
*/
-public class TestPOIDocumentScratchpad extends TestCase {
+public final class TestPOIDocumentScratchpad extends TestCase {
// The POI Documents to work on
private POIDocument doc;
private POIDocument doc2;
@@ -46,7 +46,7 @@
private POIFSFileSystem pfs2;
/**
- * Set things up, using a PowerPoint document and
+ * Set things up, using a PowerPoint document and
* a Word Document for our testing
*/
public void setUp() throws Exception {
@@ -56,31 +56,31 @@
String filenameHSSF = dirnameHSLF + "/DateFormats.ppt";
String dirnameHWPF = System.getProperty("HWPF.testdata.path");
String filenameHWPF = dirnameHWPF + "/test2.doc";
-
+
FileInputStream fisHSLF = new FileInputStream(filenameHSLF);
pfs = new POIFSFileSystem(fisHSLF);
doc = new HSLFSlideShow(pfs);
-
+
FileInputStream fisHWPF = new FileInputStream(filenameHWPF);
pfs2 = new POIFSFileSystem(fisHWPF);
doc2 = new HWPFDocument(pfs2);
}
-
+
public void testReadProperties() throws Exception {
// We should have both sets
assertNotNull(doc.getDocumentSummaryInformation());
assertNotNull(doc.getSummaryInformation());
-
+
// Check they are as expected for the test doc
assertEquals("Hogwarts", doc.getSummaryInformation().getAuthor());
assertEquals(10598, doc.getDocumentSummaryInformation().getByteCount());
}
-
- public void testReadProperties2() throws Exception {
+
+ public void testReadProperties2() throws Exception {
// Check again on the word one
assertNotNull(doc2.getDocumentSummaryInformation());
assertNotNull(doc2.getSummaryInformation());
-
+
assertEquals("Hogwarts", doc2.getSummaryInformation().getAuthor());
assertEquals("", doc2.getSummaryInformation().getKeywords());
assertEquals(0, doc2.getDocumentSummaryInformation().getByteCount());
@@ -90,7 +90,7 @@
// Just check we can write them back out into a filesystem
POIFSFileSystem outFS = new POIFSFileSystem();
doc.writeProperties(outFS);
-
+
// Should now hold them
assertNotNull(
outFS.createDocumentInputStream("\005SummaryInformation")
@@ -102,20 +102,20 @@
public void testWriteReadProperties() throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
-
+
// Write them out
POIFSFileSystem outFS = new POIFSFileSystem();
doc.writeProperties(outFS);
outFS.writeFilesystem(baos);
-
+
// Create a new version
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
POIFSFileSystem inFS = new POIFSFileSystem(bais);
-
+
// Check they're still there
doc.filesystem = inFS;
doc.readProperties();
-
+
// Delegate test
testReadProperties();
}
Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hdf/model/TestHDFDocument.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hdf/model/TestHDFDocument.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hdf/model/TestHDFDocument.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hdf/model/TestHDFDocument.java Thu May 21 18:12:22 2009
@@ -1,4 +1,3 @@
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -15,8 +14,6 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hdf.model;
@@ -32,7 +29,7 @@
*
* @author Bob Otterberg
*/
-public class TestHDFDocument
+public final class TestHDFDocument
extends TestCase
{
Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hdgf/TestHDGFCore.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hdgf/TestHDGFCore.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hdgf/TestHDGFCore.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hdgf/TestHDGFCore.java Thu May 21 18:12:22 2009
@@ -14,6 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
+
package org.apache.poi.hdgf;
import java.io.FileInputStream;
@@ -24,35 +25,35 @@
import junit.framework.TestCase;
-public class TestHDGFCore extends TestCase {
+public final class TestHDGFCore extends TestCase {
private POIFSFileSystem fs;
private String dirname;
private String filename;
-
+
protected void setUp() throws Exception {
dirname = System.getProperty("HDGF.testdata.path");
filename = dirname + "/Test_Visio-Some_Random_Text.vsd";
fs = new POIFSFileSystem(new FileInputStream(filename));
}
-
+
public void testCreate() throws Exception {
new HDGFDiagram(fs);
}
-
+
public void testTrailer() throws Exception {
HDGFDiagram hdgf = new HDGFDiagram(fs);
assertNotNull(hdgf);
assertNotNull(hdgf.getTrailerStream());
-
+
// Check it has what we'd expect
TrailerStream trailer = hdgf.getTrailerStream();
assertEquals(0x8a94, trailer.getPointer().getOffset());
-
+
assertNotNull(trailer.getPointedToStreams());
assertEquals(20, trailer.getPointedToStreams().length);
-
+
assertEquals(20, hdgf.getTopLevelStreams().length);
-
+
// 9th one should have children
assertNotNull(trailer.getPointedToStreams()[8]);
assertNotNull(trailer.getPointedToStreams()[8].getPointer());
@@ -61,7 +62,7 @@
assertNotNull(ps8.getPointedToStreams());
assertEquals(8, ps8.getPointedToStreams().length);
}
-
+
/**
* Tests that we can open a problematic file, that initially
* appears to have a negative chunk length
@@ -69,7 +70,7 @@
public void DISABLEDtestNegativeChunkLength() throws Exception {
filename = dirname + "/NegativeChunkLength.vsd";
fs = new POIFSFileSystem(new FileInputStream(filename));
-
+
HDGFDiagram hdgf = new HDGFDiagram(fs);
assertNotNull(hdgf);
}
Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hdgf/TestHDGFLZW.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hdgf/TestHDGFLZW.java?rev=777204&r1=777203&r2=777204&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hdgf/TestHDGFLZW.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hdgf/TestHDGFLZW.java Thu May 21 18:12:22 2009
@@ -13,173 +13,174 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-*/
+==================================================================== */
+
package org.apache.poi.hdgf;
import java.io.ByteArrayInputStream;
import junit.framework.TestCase;
-public class TestHDGFLZW extends TestCase {
+public final class TestHDGFLZW extends TestCase {
public static final byte[] testTrailerComp = new byte[] {
123, // *mask bit*
- -60, 2,
+ -60, 2,
-21, -16, // 3 @ 4093
- 1, 0, 0, -72,
+ 1, 0, 0, -72,
-13, -16, // 3 @ 5
78, // *mask bit*
- -32, -5, // 14 @ 4082
- 1, 0, 3,
+ -32, -5, // 14 @ 4082
+ 1, 0, 3,
-21, -16, // 3 @ 4093
10, 5, // 8 @ 28
- 4,
+ 4,
+ -21, -16, // 3 @ 4093
+ 21, // *mask bit*
+ 9,
-21, -16, // 3 @ 4093
- 21, // *mask bit*
- 9,
- -21, -16, // 3 @ 4093
- 103, -21, -16, 34,
+ 103, -21, -16, 34,
-36, -1, // 18 @ 4078
- 52, 15, // 18 @ 70
- 70, 15, // 18 @ 88
+ 52, 15, // 18 @ 70
+ 70, 15, // 18 @ 88
120, // *mask bit*
- 88, 15, // 18 @ 106
- -7, -2, // 17 @ 11
+ 88, 15, // 18 @ 106
+ -7, -2, // 17 @ 11
-28, -9, // 10 @ 4086
- -123, 21, 0, 44,
- -122, 1, // 4 @ 152
- -4, // *mask bit*
- 104, 15, // 18 @ 122
- -24, -13, 40, -98, 32,
- 78, 102, -67, -1, -2, -30, 64, 40, -67, -113, -73, 116, -98,
- -85, 2, 66, 123, 9, 109, -85, 2, -89, 14, -56, -69, -83, -79,
- -34, -3, 120, 110, 75, -9, -10, 20, -6, -25, -12, 22, -21, -16,
- -12, -81, 67, 1, -128, -70, -21, -16, 84, -21, -16, 70, 0, 23,
- -21, -16, 76, 47, -40, 79, 1, -44, -21, -16, 32, 3, 18, 12, 17,
- -43, -68, 17, 16, -8, 21, 22, -1, -21, -16, -84, -1, -35, 79,
- -9, -10, 96, 0, 46, -21, -16, 44, -39, -41, 79, 1, 119, -13,
- -16, -106, -13, -16, 84, 0, 125, 26, -21, -16, 68, -38, 79, 1,
- 17, 10, 0, -97, 50, 10, 0, 0, -42, -108, 15, 118, 31, 0, -3, 29,
- -21, -16, -100, -25, 79, 1, -18, 97, -36, 76, 16, -21, -16, 86,
- 0, 36, -5, 1, -5, 79, 63, 1, -124, 98, 0, 0, 28, 3, 20, -34, -3,
- 125, 33, -21, -16, 100, -4, 79, 1, -92, -91, 16, -22, 24, 19, 41,
- -21, -16, -44, -59, 16, 108, 100, 0, -21, 0, 71, -105, 18, 39, 85,
- 17, -3, 79, 1, 95, -108, 113, 0, 0, 104, 3, 18, 49, 49, 17, -1, 64,
- 85, 1, 0, 114, 0, 0, -93, -36, -21, -16, 100, 31, 0, 0, -40, -21,
- -16, -92, 66, 127, 85, 1, 98, 119, 0, 0, -48, 79, 18, -3, 50, -17,
- 1, 67, 85, 1, 81, -127, 0, -41, 0, 14, 6, 4, 17, 63, -63, 17, 68,
- 85, -65, 1, 30, -120, 0, 0, 42, 79, 18, 68, 126, -21, -16, -76, 69,
+ -123, 21, 0, 44,
+ -122, 1, // 4 @ 152
+ -4, // *mask bit*
+ 104, 15, // 18 @ 122
+ -24, -13, 40, -98, 32,
+ 78, 102, -67, -1, -2, -30, 64, 40, -67, -113, -73, 116, -98,
+ -85, 2, 66, 123, 9, 109, -85, 2, -89, 14, -56, -69, -83, -79,
+ -34, -3, 120, 110, 75, -9, -10, 20, -6, -25, -12, 22, -21, -16,
+ -12, -81, 67, 1, -128, -70, -21, -16, 84, -21, -16, 70, 0, 23,
+ -21, -16, 76, 47, -40, 79, 1, -44, -21, -16, 32, 3, 18, 12, 17,
+ -43, -68, 17, 16, -8, 21, 22, -1, -21, -16, -84, -1, -35, 79,
+ -9, -10, 96, 0, 46, -21, -16, 44, -39, -41, 79, 1, 119, -13,
+ -16, -106, -13, -16, 84, 0, 125, 26, -21, -16, 68, -38, 79, 1,
+ 17, 10, 0, -97, 50, 10, 0, 0, -42, -108, 15, 118, 31, 0, -3, 29,
+ -21, -16, -100, -25, 79, 1, -18, 97, -36, 76, 16, -21, -16, 86,
+ 0, 36, -5, 1, -5, 79, 63, 1, -124, 98, 0, 0, 28, 3, 20, -34, -3,
+ 125, 33, -21, -16, 100, -4, 79, 1, -92, -91, 16, -22, 24, 19, 41,
+ -21, -16, -44, -59, 16, 108, 100, 0, -21, 0, 71, -105, 18, 39, 85,
+ 17, -3, 79, 1, 95, -108, 113, 0, 0, 104, 3, 18, 49, 49, 17, -1, 64,
+ 85, 1, 0, 114, 0, 0, -93, -36, -21, -16, 100, 31, 0, 0, -40, -21,
+ -16, -92, 66, 127, 85, 1, 98, 119, 0, 0, -48, 79, 18, -3, 50, -17,
+ 1, 67, 85, 1, 81, -127, 0, -41, 0, 14, 6, 4, 17, 63, -63, 17, 68,
+ 85, -65, 1, 30, -120, 0, 0, 42, 79, 18, 68, 126, -21, -16, -76, 69,
85, 1, 102, -119, 72, 37, 0, 97, 33 };
public static final byte[] testTrailerDecomp = new byte[] {
- -60, 2, 0, 0, 0, 1, 0, 0, -72, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1, 0, 3, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0,
- 0, 9, 0, 0, 0, 103, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- -123, 21, 0, 44, -123, 21, 0, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, -98, 32, 78, 102, -67,
- -2, -30, 64, 40, -67, -113, -73, 116, -67, -2, -30, 64, 40, 66,
- 123, 9, 109, -67, -2, -30, 64, 40, -98, 32, 78, 102, -67, -2, -30,
- 64, 40, -67, -113, -73, 116, -67, -2, -30, 64, -56, -83, -79, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 110, 75, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, -12, -81, 67,
- 1, -128, 0, 0, 0, 84, 0, 0, 0, 70, 0, 23, 0, 0, 0, 76, -40, 79, 1,
- -44, 0, 0, 0, 32, 0, 0, 0, 84, 0, 23, 0, 0, 0, -68, -40, 79, 1, -8,
- 0, 0, 0, 32, 0, 0, 0, 84, 0, -1, 0, 0, 0, -84, -1, 79, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 96, 0, 46, 0, 0, 0, 44, -39, 79, 1, 119, 1, 0, 0,
- -106, 1, 0, 0, 84, 0, 26, 0, 0, 0, 68, -38, 79, 1, 17, 3, 0, 0,
- 50, 10, 0, 0, -42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 29, 0, 0, 0, -100, -25, 79, 1, -18, 97, 0, 0, -106, 0, 0, 0, 86, 0,
- 36, 0, 0, 0, -12, -5, 79, 1, -124, 98, 0, 0, 28, 0, 0, 0, 84, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 100,
- -4, 79, 1, -92, 98, 0, 0, 32, 0, 0, 0, 84, 0, 41, 0, 0, 0, -44, -4,
- 79, 1, 108, 100, 0, 0, 71, 0, 0, 0, 86, 0, 39, 0, 0, 0, 68, -3, 79,
- 1, -108, 113, 0, 0, 104, 0, 0, 0, 84, 0, 49, 0, 0, 0, -84, 64, 85,
- 1, 0, 114, 0, 0, -93, 0, 0, 0, -42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, -40, 0, 0, 0, -92, 66, 85, 1, 98, 119,
- 0, 0, -48, 1, 0, 0, 84, 0, 50, 0, 0, 0, 20, 67, 85, 1, 81, -127,
- 0, 0, 14, 6, 0, 0, 84, 0, 63, 0, 0, 0, 100, 68, 85, 1, 30, -120,
- 0, 0, 42, 1, 0, 0, 84, 0, 68, 0, 0, 0, -76, 69, 85, 1, 102, -119,
+ -60, 2, 0, 0, 0, 1, 0, 0, -72, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 0, 3, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0,
+ 0, 9, 0, 0, 0, 103, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ -123, 21, 0, 44, -123, 21, 0, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, -98, 32, 78, 102, -67,
+ -2, -30, 64, 40, -67, -113, -73, 116, -67, -2, -30, 64, 40, 66,
+ 123, 9, 109, -67, -2, -30, 64, 40, -98, 32, 78, 102, -67, -2, -30,
+ 64, 40, -67, -113, -73, 116, -67, -2, -30, 64, -56, -83, -79, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 110, 75, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, -12, -81, 67,
+ 1, -128, 0, 0, 0, 84, 0, 0, 0, 70, 0, 23, 0, 0, 0, 76, -40, 79, 1,
+ -44, 0, 0, 0, 32, 0, 0, 0, 84, 0, 23, 0, 0, 0, -68, -40, 79, 1, -8,
+ 0, 0, 0, 32, 0, 0, 0, 84, 0, -1, 0, 0, 0, -84, -1, 79, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 96, 0, 46, 0, 0, 0, 44, -39, 79, 1, 119, 1, 0, 0,
+ -106, 1, 0, 0, 84, 0, 26, 0, 0, 0, 68, -38, 79, 1, 17, 3, 0, 0,
+ 50, 10, 0, 0, -42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 29, 0, 0, 0, -100, -25, 79, 1, -18, 97, 0, 0, -106, 0, 0, 0, 86, 0,
+ 36, 0, 0, 0, -12, -5, 79, 1, -124, 98, 0, 0, 28, 0, 0, 0, 84, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 100,
+ -4, 79, 1, -92, 98, 0, 0, 32, 0, 0, 0, 84, 0, 41, 0, 0, 0, -44, -4,
+ 79, 1, 108, 100, 0, 0, 71, 0, 0, 0, 86, 0, 39, 0, 0, 0, 68, -3, 79,
+ 1, -108, 113, 0, 0, 104, 0, 0, 0, 84, 0, 49, 0, 0, 0, -84, 64, 85,
+ 1, 0, 114, 0, 0, -93, 0, 0, 0, -42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, -40, 0, 0, 0, -92, 66, 85, 1, 98, 119,
+ 0, 0, -48, 1, 0, 0, 84, 0, 50, 0, 0, 0, 20, 67, 85, 1, 81, -127,
+ 0, 0, 14, 6, 0, 0, 84, 0, 63, 0, 0, 0, 100, 68, 85, 1, 30, -120,
+ 0, 0, 42, 1, 0, 0, 84, 0, 68, 0, 0, 0, -76, 69, 85, 1, 102, -119,
0, 0, 42, 1, 0, 0, 84, 0, 0, 0, 0, 0
};
-
+
public void testFromToInt() throws Exception {
byte b255 = -1;
assertEquals(255, HDGFLZW.fromByte(b255));
assertEquals(-1, HDGFLZW.fromInt( HDGFLZW.fromByte(b255) ));
assertEquals(-1, HDGFLZW.fromInt( 255 ));
-
+
byte b11 = 11;
assertEquals(11, HDGFLZW.fromByte(b11));
assertEquals(11, HDGFLZW.fromInt( HDGFLZW.fromByte(b11) ));
assertEquals(11, HDGFLZW.fromInt( 11 ));
-
+
byte b0 = 0;
assertEquals(0, HDGFLZW.fromByte(b0));
assertEquals(0, HDGFLZW.fromInt( HDGFLZW.fromByte(b0) ));
assertEquals(0, HDGFLZW.fromInt( 0 ));
-
+
byte b127 = 127;
assertEquals(127, HDGFLZW.fromByte(b127));
assertEquals(127, HDGFLZW.fromInt( HDGFLZW.fromByte(b127) ));
assertEquals(127, HDGFLZW.fromInt( 127 ));
-
+
byte b128 = -128;
assertEquals(128, HDGFLZW.fromByte(b128));
assertEquals(-128, HDGFLZW.fromInt( HDGFLZW.fromByte(b128) ));
assertEquals(-128, HDGFLZW.fromInt( 128 ));
}
-
+
public void testCounts() throws Exception {
assertEquals(339, testTrailerComp.length);
assertEquals(632, testTrailerDecomp.length);
-
+
// Decode it using our engine
HDGFLZW lzw = new HDGFLZW();
byte[] dec = lzw.decode(new ByteArrayInputStream(testTrailerComp));
-
+
// Check it's of the right size
assertEquals(632, dec.length);
-/*
+/*
// Encode it again using our engine
byte[] comp = lzw.compress(new ByteArrayInputStream(testTrailerDecomp));
-
+
// Check it's of the right size
assertEquals(339, comp.length);
*/
}
-
+
public void testDecompress() throws Exception {
assertEquals(339, testTrailerComp.length);
assertEquals(632, testTrailerDecomp.length);
-
+
// Decode it using our engine
HDGFLZW lzw = new HDGFLZW();
byte[] dec = lzw.decode(new ByteArrayInputStream(testTrailerComp));
-
+
// Now check it's the right data
assertEquals(632, dec.length);
for(int i=0; i<dec.length; i++) {
- if(dec[i] != testTrailerDecomp[i])
+ if(dec[i] != testTrailerDecomp[i])
System.err.println(i + "\t" + dec[i] + "\t" + testTrailerDecomp[i]);
}
}
-
+
public void DISABLEDtestCompress() throws Exception {
assertEquals(339, testTrailerComp.length);
assertEquals(632, testTrailerDecomp.length);
-
+
// Compress it using our engine
HDGFLZW lzw = new HDGFLZW();
byte[] comp = lzw.compress(new ByteArrayInputStream(testTrailerDecomp));
-
+
// Now check it's the right data
assertEquals(339, comp.length);
for(int i=0; i<comp.length; i++) {
- if(comp[i] != testTrailerComp[i])
+ if(comp[i] != testTrailerComp[i])
System.err.println(i + "\t" + comp[i] + "\t" + testTrailerComp[i]);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org