Browse Source

Bug 45312: Add unit-test and javadoc, also convert file to proper line-ending and make poi.deserialize.escher=true behave for full reading of files outside of BiffViewer

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1621586 13f79535-47bb-0310-9956-ffa450edef68
tags/REL_3_11_BETA3
Dominik Stadler 9 years ago
parent
commit
9a002910c5

+ 1
- 1
src/java/org/apache/poi/hssf/dev/BiffViewer.java View File

@@ -145,7 +145,7 @@ public final class BiffViewer {
case DatRecord.sid: return new DatRecord(in);
case DataFormatRecord.sid: return new DataFormatRecord(in);
case DateWindow1904Record.sid: return new DateWindow1904Record(in);
case DConRefRecord.sid: return new DConRefRecord(in);
case DConRefRecord.sid: return new DConRefRecord(in);
case DefaultColWidthRecord.sid:return new DefaultColWidthRecord(in);
case DefaultDataLabelTextPropertiesRecord.sid: return new DefaultDataLabelTextPropertiesRecord(in);
case DefaultRowHeightRecord.sid: return new DefaultRowHeightRecord(in);

+ 7
- 8
src/java/org/apache/poi/hssf/record/AbstractEscherHolderRecord.java View File

@@ -57,20 +57,19 @@ public abstract class AbstractEscherHolderRecord extends Record {
public AbstractEscherHolderRecord(RecordInputStream in)
{
escherRecords = new ArrayList<EscherRecord>();
if (! DESERIALISE )
{
if (! DESERIALISE ) {
rawDataContainer.concatenate(in.readRemainder());
}
else
{
} else {
byte[] data = in.readAllContinuedRemainder();
convertToEscherRecords( 0, data.length, data );
}
}

protected void convertRawBytesToEscherRecords() {
byte[] rawData = getRawData();
convertToEscherRecords(0, rawData.length, rawData);
if (! DESERIALISE ) {
byte[] rawData = getRawData();
convertToEscherRecords(0, rawData.length, rawData);
}
}
private void convertToEscherRecords( int offset, int size, byte[] data )
{
@@ -224,7 +223,7 @@ public abstract class AbstractEscherHolderRecord extends Record {

public EscherRecord getEscherRecord(int index)
{
return (EscherRecord) escherRecords.get(index);
return escherRecords.get(index);
}

/**

+ 10
- 2
src/java/org/apache/poi/hssf/usermodel/HSSFClientAnchor.java View File

@@ -42,6 +42,10 @@ public final class HSSFClientAnchor extends HSSFAnchor implements ClientAnchor {
/**
* Creates a new client anchor and sets the top-left and bottom-right
* coordinates of the anchor.
*
* Note: Microsoft Excel seems to sometimes disallow
* higher y1 than y2 or higher x1 than x2, you might need to
* reverse them and draw shapes vertically or horizontally flipped!
*
* @param dx1 the x coordinate within the first cell.
* @param dy1 the y coordinate within the first cell.
@@ -186,8 +190,12 @@ public final class HSSFClientAnchor extends HSSFAnchor implements ClientAnchor {
}

/**
* Dets the top-left and bottom-right
* coordinates of the anchor.
* Sets the top-left and bottom-right coordinates of
* the anchor.
*
* Note: Microsoft Excel seems to sometimes disallow
* higher y1 than y2 or higher x1 than x2, you might need to
* reverse them and draw shapes vertically or horizontally flipped!
*
* @param x1 the x coordinate within the first cell.
* @param y1 the y coordinate within the first cell.

+ 4
- 0
src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java View File

@@ -171,6 +171,10 @@ public final class HSSFPatriarch implements HSSFShapeContainer, Drawing {
/**
* Creates a simple shape. This includes such shapes as lines, rectangles,
* and ovals.
*
* Note: Microsoft Excel seems to sometimes disallow
* higher y1 than y2 or higher x1 than x2 in the anchor, you might need to
* reverse them and draw shapes vertically or horizontally flipped!
*
* @param anchor the client anchor describes how this group is attached
* to the sheet.

+ 5
- 0
src/java/org/apache/poi/hssf/usermodel/HSSFShape.java View File

@@ -27,6 +27,11 @@ import java.io.IOException;

/**
* An abstract shape.
*
* Note: Microsoft Excel seems to sometimes disallow
* higher y1 than y2 or higher x1 than x2 in the anchor, you might need to
* reverse them and draw shapes vertically or horizontally flipped via
* setFlipVertical() or setFlipHorizontally().
*/
public abstract class HSSFShape {
public static final int LINEWIDTH_ONE_PT = 12700;

+ 809
- 662
src/testcases/org/apache/poi/hssf/model/TestDrawingShapes.java
File diff suppressed because it is too large
View File


Loading…
Cancel
Save