You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by Praveen Mathew <pr...@rediffmail.com> on 2003/07/30 20:38:19 UTC

HWPF queries

Hi Ryan,
          Due to problems in my mail server , I have created this 
account in rediif for HWPF. please bear with me for this long 
mail.

As you have mentioned, lets give priority for the important 
things. So I am bypassing the implementations for ANLD ,NUMRM 
classes. Also since we are not reading in the "data stream" 
currently, we will do the sprmPHugePapx later.

Regarding the CHPX Sprms ,I have the following points to bring to 
your notice.

For the sprms 0x8,0x3f i have done some bit manipulations 
considering the facts : the 3 byte "param" which we pass as an int 
will be having the 0th byte at the low order and the rest of the 
1st 2nd 3rd bytes towards the high order of the "int".
The >>> operator will fill in the vaccant spaces at the left with 
0's & not 1's.
Please verify them for their correctness when you have time.

Regarding the sprmCSizePos(0x3f), I didnt understand the way 
"cInc" is applied as newCHP.setHps(Math.max(newCHP.getHps() + 
(cInc * 2), 2));

The spec refers to some index in the font size array to determine 
the new hps for a run. is this the rgftc[] array. Why r you maxing 
with 2. The spec says to do certain manipulations with the font 
size array indexes, I am confused!!

The spec tells to handle 2 conditions for the parameter (+ve & 
-ve).
How could this be possible, since we are taking the 7 bit twos 
complement number, i.e the 7 bits towards the high order of the 
byte.
We will get a sign only if we take the whole 8bits including cInc 
& fAdjust, but then the value is 8bit 2's complement .
If we take only 7bits as specified ,then always the value will be 
+ve.

One last querry.

In the unCompressProperty(), you are passing a parametr "doIstd", 
which is hardcoded to TRUE now . what is its significance?

Thanks & Regards
Praveen

___________________________________________________
Download the hottest & happening ringtones here!
OR SMS: Top tone to 7333
Click here now: 
http://sms.rediff.com/cgi-bin/ringtone/ringhome.pl



Re: HWPF queries

Posted by Ryan Ackley <sa...@cfl.rr.com>.

> For the sprms 0x8,0x3f i have done some bit manipulations
> considering the facts : the 3 byte "param" which we pass as an int
> will be having the 0th byte at the low order and the rest of the
> 1st 2nd 3rd bytes towards the high order of the "int".
> The >>> operator will fill in the vaccant spaces at the left with
> 0's & not 1's.
> Please verify them for their correctness when you have time

> Regarding the sprmCSizePos(0x3f), I didnt understand the way
> "cInc" is applied as newCHP.setHps(Math.max(newCHP.getHps() +
> (cInc * 2), 2));

If you can't understand it, just re-write it because I do not understand
what I was trying to do either.

> The spec refers to some index in the font size array to determine
> the new hps for a run. is this the rgftc[] array. Why r you maxing
> with 2. The spec says to do certain manipulations with the font
> size array indexes, I am confused!!

I don't know where this array is, I think thats why I just came up with some
kind of hack.

> The spec tells to handle 2 conditions for the parameter (+ve &
> -ve).
> How could this be possible, since we are taking the 7 bit twos
> complement number, i.e the 7 bits towards the high order of the
> byte.
> We will get a sign only if we take the whole 8bits including cInc
> & fAdjust, but then the value is 8bit 2's complement .
> If we take only 7bits as specified ,then always the value will be
> +ve.

It is possible to come up with a twos complement. Use this algorithm to
convert a 7-bit twos complement to an 8-bit twos complement:

if ((7bit & 0x40) > 0) // look for sign bit
{
    7bit = (byte)(7bit | 0x80)
}

> One last querry.
>
> In the unCompressProperty(), you are passing a parametr "doIstd",
> which is hardcoded to TRUE now . what is its significance?

Don't remember...

> ___________________________________________________
> Download the hottest & happening ringtones here!
> OR SMS: Top tone to 7333
> Click here now:
> http://sms.rediff.com/cgi-bin/ringtone/ringhome.pl
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-dev-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/