diff options
author | Dominik Stadler <centic@apache.org> | 2014-08-31 11:40:22 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2014-08-31 11:40:22 +0000 |
commit | 9a002910c5b3ab158f1ca970735da2ff9ee98d91 (patch) | |
tree | b1ee5e0b0cee64441308ae3666acc85eff8d96d8 /src/java/org | |
parent | 8ed6940008f010b3d6db0cebf611c7476956fa1a (diff) | |
download | poi-9a002910c5b3ab158f1ca970735da2ff9ee98d91.tar.gz poi-9a002910c5b3ab158f1ca970735da2ff9ee98d91.zip |
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
Diffstat (limited to 'src/java/org')
5 files changed, 27 insertions, 11 deletions
diff --git a/src/java/org/apache/poi/hssf/dev/BiffViewer.java b/src/java/org/apache/poi/hssf/dev/BiffViewer.java index 19cdd02942..5451b27899 100644 --- a/src/java/org/apache/poi/hssf/dev/BiffViewer.java +++ b/src/java/org/apache/poi/hssf/dev/BiffViewer.java @@ -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); diff --git a/src/java/org/apache/poi/hssf/record/AbstractEscherHolderRecord.java b/src/java/org/apache/poi/hssf/record/AbstractEscherHolderRecord.java index 078f0205d7..d3263834c7 100644 --- a/src/java/org/apache/poi/hssf/record/AbstractEscherHolderRecord.java +++ b/src/java/org/apache/poi/hssf/record/AbstractEscherHolderRecord.java @@ -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); } /** diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFClientAnchor.java b/src/java/org/apache/poi/hssf/usermodel/HSSFClientAnchor.java index 0a65bbd8ff..c46f7b7a92 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFClientAnchor.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFClientAnchor.java @@ -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. diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java b/src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java index 7745801fd2..dda4b39575 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java @@ -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. diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFShape.java b/src/java/org/apache/poi/hssf/usermodel/HSSFShape.java index 4ea7d31e6a..4775122f82 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFShape.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFShape.java @@ -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; |