mirror of
https://github.com/apache/poi.git
synced 2026-02-27 20:40:08 +08:00
Deprecate functions that duplicate functionality
DrawingGroupRecord#processChildRecords and AbstractEscherHolderRecord#convertRawBytesToEscherRecords duplicate the functionality of AbstractEscherHolderRecord#decode. This makes the code harder to follow, as it is not clear when certain access patterns repeat. Accordingly, these functions are deprecated and flagged for removal. git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887021 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
402d0fc5e5
commit
8ab53c6489
@ -1840,7 +1840,7 @@ public final class InternalWorkbook {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
DrawingGroupRecord dg = (DrawingGroupRecord)r;
|
DrawingGroupRecord dg = (DrawingGroupRecord)r;
|
||||||
dg.processChildRecords();
|
dg.decode();
|
||||||
drawingManager = findDrawingManager(dg, escherBSERecords);
|
drawingManager = findDrawingManager(dg, escherBSERecords);
|
||||||
if (drawingManager != null) {
|
if (drawingManager != null) {
|
||||||
return drawingManager;
|
return drawingManager;
|
||||||
|
|||||||
@ -27,6 +27,7 @@ import org.apache.poi.ddf.EscherRecordFactory;
|
|||||||
import org.apache.poi.ddf.NullEscherSerializationListener;
|
import org.apache.poi.ddf.NullEscherSerializationListener;
|
||||||
import org.apache.poi.hssf.util.LazilyConcatenatedByteArray;
|
import org.apache.poi.hssf.util.LazilyConcatenatedByteArray;
|
||||||
import org.apache.poi.util.LittleEndian;
|
import org.apache.poi.util.LittleEndian;
|
||||||
|
import org.apache.poi.util.Removal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The escher container record is used to hold escher records. It is abstract and
|
* The escher container record is used to hold escher records. It is abstract and
|
||||||
@ -63,10 +64,17 @@ public abstract class AbstractEscherHolderRecord extends Record {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated Call {@link #decode()} instead.
|
||||||
|
*/
|
||||||
|
@Removal(version = "5.3")
|
||||||
|
@Deprecated
|
||||||
protected void convertRawBytesToEscherRecords() {
|
protected void convertRawBytesToEscherRecords() {
|
||||||
|
// decode() does a check to see if raw bytes have already been interpreted. In the case that we did not eagerly
|
||||||
|
// interpret the bytes due to DESERIALIZE being false, decode() will interpret the bytes. If we did already
|
||||||
|
// interpret the bytes due to DESERIALIZE being true, decode skips doing the work again.
|
||||||
if (!DESERIALIZE) {
|
if (!DESERIALIZE) {
|
||||||
byte[] rawData = getRawData();
|
decode();
|
||||||
convertToEscherRecords(0, rawData.length, rawData);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void convertToEscherRecords( int offset, int size, byte[] data )
|
private void convertToEscherRecords( int offset, int size, byte[] data )
|
||||||
|
|||||||
@ -25,6 +25,7 @@ import org.apache.poi.ddf.EscherRecord;
|
|||||||
import org.apache.poi.ddf.EscherRecordTypes;
|
import org.apache.poi.ddf.EscherRecordTypes;
|
||||||
import org.apache.poi.ddf.NullEscherSerializationListener;
|
import org.apache.poi.ddf.NullEscherSerializationListener;
|
||||||
import org.apache.poi.util.LittleEndian;
|
import org.apache.poi.util.LittleEndian;
|
||||||
|
import org.apache.poi.util.Removal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specifies a group of drawing objects.
|
* Specifies a group of drawing objects.
|
||||||
@ -81,9 +82,13 @@ public final class DrawingGroupRecord extends AbstractEscherHolderRecord {
|
|||||||
* (Not done by default in case we break things,
|
* (Not done by default in case we break things,
|
||||||
* unless you set the "poi.deserialize.escher"
|
* unless you set the "poi.deserialize.escher"
|
||||||
* system property)
|
* system property)
|
||||||
|
*
|
||||||
|
* @deprecated Call {@link #decode()} instead.
|
||||||
*/
|
*/
|
||||||
|
@Removal(version = "5.3")
|
||||||
|
@Deprecated
|
||||||
public void processChildRecords() {
|
public void processChildRecords() {
|
||||||
convertRawBytesToEscherRecords();
|
decode();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getRecordSize() {
|
public int getRecordSize() {
|
||||||
|
|||||||
@ -42,7 +42,7 @@ public final class DrawingRecordForBiffViewer extends AbstractEscherHolderRecord
|
|||||||
public DrawingRecordForBiffViewer(DrawingRecord r)
|
public DrawingRecordForBiffViewer(DrawingRecord r)
|
||||||
{
|
{
|
||||||
super(convertToInputStream(r));
|
super(convertToInputStream(r));
|
||||||
convertRawBytesToEscherRecords();
|
decode();
|
||||||
}
|
}
|
||||||
private static RecordInputStream convertToInputStream(DrawingRecord r)
|
private static RecordInputStream convertToInputStream(DrawingRecord r)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user