<!-- Don't forget to update status.xml too! -->
<release version="3.1-final" date="2008-06-??">
+ <action dev="POI-DEVELOPERS" type="add">Support custom image renderers in HSLF</action>
+ <action dev="POI-DEVELOPERS" type="fix">Correctly increment the reference count of a blip when a picture is inserted</action>
+ <action dev="POI-DEVELOPERS" type="fix">45110 - Fixed TextShape.resizeToFitText() to properly resize TextShape</action>
<action dev="POI-DEVELOPERS" type="fix">45091 - Fixed serialization of RefN~ tokens. Simplified Ptg class hierarchy</action>
<action dev="POI-DEVELOPERS" type="fix">45133 - Fixed OBJ Record (5Dh) to pad the sub-record data to a 4-byte boundary</action>
<action dev="POI-DEVELOPERS" type="fix">45145 - Fixed Sheet to always enforce RowRecordsAggregate before ValueRecordsAggregate</action>
<!-- Don't forget to update changes.xml too! -->
<changes>
<release version="3.1-final" date="2008-06-??">
+ <action dev="POI-DEVELOPERS" type="add">Support custom image renderers in HSLF</action>
+ <action dev="POI-DEVELOPERS" type="fix">Correctly increment the reference count of a blip when a picture is inserted</action>
+ <action dev="POI-DEVELOPERS" type="fix">45110 - Fixed TextShape.resizeToFitText() to properly resize TextShape</action>
<action dev="POI-DEVELOPERS" type="fix">45091 - Fixed serialization of RefN~ tokens. Simplified Ptg class hierarchy</action>
<action dev="POI-DEVELOPERS" type="fix">45133 - Fixed OBJ Record (5Dh) to pad the sub-record data to a 4-byte boundary</action>
<action dev="POI-DEVELOPERS" type="fix">45145 - Fixed Sheet to always enforce RowRecordsAggregate before ValueRecordsAggregate</action>
if(!(shape instanceof TextShape)) return false;
TextShape tx = (TextShape)shape;
- TextRun run = tx.getTextRun();
- if(run == null) return false;
-
- Record[] records = run._records;
- for (int i = 0; i < records.length; i++) {
- int type = (int)records[i].getRecordType();
- if (type == RecordTypes.BaseTextPropAtom.typeID ||
- type == RecordTypes.DateTimeMCAtom.typeID ||
- type == RecordTypes.GenericDateMCAtom.typeID ||
- type == RecordTypes.FooterMCAtom.typeID ||
- type == RecordTypes.SlideNumberMCAtom.typeID
- ) return true;
-
- }
- return false;
+ return tx.getPlaceholderAtom() != null;
}
/**
import org.apache.poi.ddf.*;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.hslf.record.ColorSchemeAtom;
+import org.apache.poi.hslf.record.Record;
import java.awt.*;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
+import java.util.Iterator;
/**
* An abstract simple (non-group) shape.
ShapePainter.paint(this, graphics);
graphics.setTransform(at);
}
+
+ /**
+ * Find a record in the underlying EscherClientDataRecord
+ *
+ * @param recordType type of the record to search
+ */
+ protected Record getClientDataRecord(int recordType) {
+ Record oep = null;
+ EscherContainerRecord spContainer = getSpContainer();
+ for (Iterator it = spContainer.getChildRecords().iterator(); it.hasNext();) {
+ EscherRecord obj = (EscherRecord) it.next();
+ if (obj.getRecordId() == EscherClientDataRecord.RECORD_ID) {
+ byte[] data = obj.serialize();
+ Record[] records = Record.findChildRecords(data, 8, data.length - 8);
+ for (int j = 0; j < records.length; j++) {
+ if (records[j].getRecordType() == recordType) {
+ return records[j];
+ }
+ }
+ }
+ }
+ return oep;
+ }
+
}
int dgId = dgg.getMaxDrawingGroupId() + 1;
dg.setOptions((short)(dgId << 4));
dgg.setDrawingsSaved(dgg.getDrawingsSaved() + 1);
+ dgg.setMaxDrawingGroupId(dgId);
for (Iterator it = dgContainer.getChildContainers().iterator(); it.hasNext(); ) {
EscherContainerRecord c = (EscherContainerRecord)it.next();
String ns = s.replaceAll("\\r?\\n", "\r");
return ns;
}
+
+ /**
+ * Returns records that make up this text run
+ *
+ * @return text run records
+ */
+ public Record[] getRecords(){
+ return _records;
+ }
}
new TextProp(2, 0x4000, "spaceafter"),
new TextProp(2, 0x8000, "para_unknown_4"),
new TextProp(2, 0x10000, "para_unknown_5"),
- new TextProp(2, 0xE0000, "para_unknown_6"),
+ new TextProp(2, 0xA0000, "para_unknown_6"),
new TextProp(2, 0x200000, "para_unknown_7")
};
/** All the different kinds of character properties we might handle */
/**
* For the Text Style Properties (StyleTextProp) Atom
*/
- protected StyleTextPropAtom(byte[] source, int start, int len) {
+ public StyleTextPropAtom(byte[] source, int start, int len) {
// Sanity Checking - we're always at least 8+10 bytes long
if(len < 18) {
len = 18;