You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Tales Paiva Nogueira <ta...@great.ufc.br> on 2006/08/17 15:13:39 UTC
[HSLF] Indentation level identification
Hi,
I need to identify the indentation level of a text in a TextBox. For this
I created a method in the RichTextRun class as follows:
public int getTextOffset(){
return getParaTextPropVal("text.offset");
}
Assuming that the property name that holds this information is
"text.offset", is it?
When I call it from my main class, it returns -1. I know this is because
the RichTextRun inherits the property from the Master.
Is there any other way to identify the indentation level for a given
RichTextRun?
Thanks a lot,
Tales Paiva
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List: http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
Re[3]: [HSLF] Indentation level identification
Posted by Nick Burch <ni...@torchbox.com>.
On Mon, 21 Aug 2006, Yegor Kozlov wrote:
> I was wrong with that. The indentation is preserved. Sorry for the
> distraction.
Yup, in the (now) badly named paraIgn.
Do you want to attach a patch to bugzilla, with a more sensible variable
name + the RichTextRun.getIndenLevel() ?
Nick
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List: http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
Re[3]: [HSLF] Indentation level identification
Posted by Yegor Kozlov <ye...@dinom.ru>.
Hi Nick,
YK> What is bad, that this value is re-setted to 0 when a slide show is saved and
YK> the indentation information is lost. Try to re-save a ppt with indents
YK> and see that they are lost!
I was wrong with that. The indentation is preserved.
Sorry for the distraction.
I added RichTextRun.getIndenLevel(), HSLF users want to read this property .
Setting indentation is more complex, for now we don't support it.
Regards, Yegor
YK> Nick,
YK> In StyleTextPropAtom.setParentTextSize when we read paragraph
YK> properties we ignore the 2-byte value before the paragraph
YK> properties:
YK> // Fetch the 2 byte value that is safe to ignore as 0
YK> short paraIgn = LittleEndian.getShort(rawContents,pos);
YK> pos += 2;
YK> In fact it stores the indentation level.
YK> I'm not sure I can quickly fix it, have a busy time last days :).
YK> If you can - do please.
YK> Regards, Yegor
YK>> Hi,
TPN>>> Is there any other way to identify the indentation level for a given
TPN>>> RichTextRun?
YK>> Unfortunately you can't retrieve the indentation level for a
YK>> RichTextRun. It's not supported by the current code.
YK>> Indentation level is stored as a 2-byte paragraph property in the
YK>> style record. Initially we thought that this value is 'safe to
YK>> ignore', it was always 0 in out test ppt files. In fact it stores the
YK>> indentation level and can be a number in the range 0-4 (there can be
YK>> up to 5 indent levels in PowerPoint).
YK>> I'm not sure if it is an easy fix and I'd like to hear Nick's opinion.
YK>> Regards, Yegor
TPN>>> Hi,
TPN>>> I need to identify the indentation level of a text in a TextBox. For this
TPN>>> I created a method in the RichTextRun class as follows:
TPN>>> public int getTextOffset(){
TPN>>> return getParaTextPropVal("text.offset");
TPN>>> }
TPN>>> Assuming that the property name that holds this information is
TPN>>> "text.offset", is it?
TPN>>> When I call it from my main class, it returns -1. I know this is because
TPN>>> the RichTextRun inherits the property from the Master.
TPN>>> Thanks a lot,
TPN>>> Tales Paiva
TPN>>> ---------------------------------------------------------------------
TPN>>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
TPN>>> Mailing List: http://jakarta.apache.org/site/mail2.html#poi
TPN>>> The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
YK>> ---------------------------------------------------------------------
YK>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
YK>> Mailing List: http://jakarta.apache.org/site/mail2.html#poi
YK>> The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
YK> ---------------------------------------------------------------------
YK> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
YK> Mailing List: http://jakarta.apache.org/site/mail2.html#poi
YK> The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List: http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
Re[2]: [HSLF] Indentation level identification
Posted by Yegor Kozlov <ye...@dinom.ru>.
Nick,
In StyleTextPropAtom.setParentTextSize when we read paragraph
properties we ignore the 2-byte value before the paragraph
properties:
// Fetch the 2 byte value that is safe to ignore as 0
short paraIgn = LittleEndian.getShort(rawContents,pos);
pos += 2;
In fact it stores the indentation level.
What is bad, that this value is re-setted to 0 when a slide show is saved and
the indentation information is lost. Try to re-save a ppt with indents
and see that they are lost!
I'm not sure I can quickly fix it, have a busy time last days :).
If you can - do please.
Regards, Yegor
YK> Hi,
TPN>> Is there any other way to identify the indentation level for a given
TPN>> RichTextRun?
YK> Unfortunately you can't retrieve the indentation level for a
YK> RichTextRun. It's not supported by the current code.
YK> Indentation level is stored as a 2-byte paragraph property in the
YK> style record. Initially we thought that this value is 'safe to
YK> ignore', it was always 0 in out test ppt files. In fact it stores the
YK> indentation level and can be a number in the range 0-4 (there can be
YK> up to 5 indent levels in PowerPoint).
YK> I'm not sure if it is an easy fix and I'd like to hear Nick's opinion.
YK> Regards, Yegor
TPN>> Hi,
TPN>> I need to identify the indentation level of a text in a TextBox. For this
TPN>> I created a method in the RichTextRun class as follows:
TPN>> public int getTextOffset(){
TPN>> return getParaTextPropVal("text.offset");
TPN>> }
TPN>> Assuming that the property name that holds this information is
TPN>> "text.offset", is it?
TPN>> When I call it from my main class, it returns -1. I know this is because
TPN>> the RichTextRun inherits the property from the Master.
TPN>> Thanks a lot,
TPN>> Tales Paiva
TPN>> ---------------------------------------------------------------------
TPN>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
TPN>> Mailing List: http://jakarta.apache.org/site/mail2.html#poi
TPN>> The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
YK> ---------------------------------------------------------------------
YK> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
YK> Mailing List: http://jakarta.apache.org/site/mail2.html#poi
YK> The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List: http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
Re: [HSLF] Indentation level identification
Posted by Yegor Kozlov <ye...@dinom.ru>.
Hi,
TPN> Is there any other way to identify the indentation level for a given
TPN> RichTextRun?
Unfortunately you can't retrieve the indentation level for a
RichTextRun. It's not supported by the current code.
Indentation level is stored as a 2-byte paragraph property in the
style record. Initially we thought that this value is 'safe to
ignore', it was always 0 in out test ppt files. In fact it stores the
indentation level and can be a number in the range 0-4 (there can be
up to 5 indent levels in PowerPoint).
I'm not sure if it is an easy fix and I'd like to hear Nick's opinion.
Regards, Yegor
TPN> Hi,
TPN> I need to identify the indentation level of a text in a TextBox. For this
TPN> I created a method in the RichTextRun class as follows:
TPN> public int getTextOffset(){
TPN> return getParaTextPropVal("text.offset");
TPN> }
TPN> Assuming that the property name that holds this information is
TPN> "text.offset", is it?
TPN> When I call it from my main class, it returns -1. I know this is because
TPN> the RichTextRun inherits the property from the Master.
TPN> Thanks a lot,
TPN> Tales Paiva
TPN> ---------------------------------------------------------------------
TPN> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
TPN> Mailing List: http://jakarta.apache.org/site/mail2.html#poi
TPN> The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List: http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/