Hi
mj> 1 - In text type 5 (textbox of type 5) , the alignment and
mj> text.offsetproperties seem to be switched (
mj> i.e. alignment has the value of text.offset and this one has the value of
mj> the alignment)
It can be a bug. I will look at it.
mj> 2 - When the records are created, even the previous records are created,
mj> and not just the recent ones(e.g. if I change anything in one of those
mj> types, the older one and the recent one are created).
Do you mean if you edit properties in a TxMasterStyleAtom they are
lost when you save the file? For now TxMasterStyleAtom is read only.
mj> 3 - The font size of text type 5 can't be read from the API. I was looking
mj> the font size of text type 5 at PowerPoint and its values are just the
mj> same of the text type 8. Are they anyway related ?
As far as I understood some types of text are related:
(a) TextHeaderAtom.BODY_TYPE, TextHeaderAtom.CENTER_BODY_TYPE,
TextHeaderAtom.HALF_BODY_TYPE, TextHeaderAtom.QUARTER_BODY_TYPE.
(b) TextHeaderAtom.TITLE_TYPE and TextHeaderAtom.CENTER_TITLE_TYPE
Actually PowerPoint stores styles only for TextHeaderAtom.TITLE_TYPE,
TextHeaderAtom.BODY_TYPE, and TextHeaderAtom.OTHER_TYPE_TYPE. It looks
logical, in PowerPoint you can edit master styles only for body and
title. Other text types inherited.
If an attribute is not found it should be looked up at the previous indent.
Below is my experimental code. In most cases it fetches the correct
styles:
private Object getCharacterAttribute(int txtype, int level, String name){
switch (txtype){
case TextHeaderAtom.CENTER_BODY_TYPE:
case TextHeaderAtom.HALF_BODY_TYPE:
case TextHeaderAtom.QUARTER_BODY_TYPE:
txtype = TextHeaderAtom.BODY_TYPE;
break;
case TextHeaderAtom.CENTER_TITLE_TYPE:
txtype = TextHeaderAtom.TITLE_TYPE;
break;
}
TextProp prop = null;
TxMasterStyleAtom txmaster = ; //get TxMasterStyleAtom for this text
type
TextPropCollection[] styles = txmaste.getCharacterStyles();
for (int i = level; i >= 0; i--) {
if (level < styles.length ) prop = styles[level].findByName(name);
if (prop != null) break;
}
return prop;
}
Regards, Yegor
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List: http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/