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...@in.ibm.com> on 2003/09/03 04:20:05 UTC

Re: HWPF Status:- Before you commit

Hi Ryan,

Thanks for your prompt explanation.

I have never
encountered a paragraph style that was based on a character style. Have 
you
actually tested this out to see if styles are chained in this manner?
Based on the 10 different input Document files, tested out, I also could 
not find a paragraph style that was based on a chrarcter style. One more 
fact observed is that the "istd" stored in the papx of a  PAPFKP is always 
a paragraph style.
So this means the entry into the StyleSheet  is always through a paragraph 
style.

Now then how is the character style coming into picture?? 

The Spec that describes the " Algorithm to determine the character properties of a character in a 
complex file" clearly states that 
"It is first necessary to fetch the paragraph properties of the paragraph 
that contains the character. The pap.istd of the fetched properties 
specifies which style sheet entry provides the default character 
properties for the character".

Since the pap.istd of a paragraph is always a paragraph style, it will 
follow a based on chain of only paragraph styles. So what is the 
significance of the character style, since it is stored in the 
StyleDescriptions array.




Thanks & Regards
Praveen






"Ryan Ackley" <sa...@cfl.rr.com>
29/08/2003 01:06
Please respond to "POI Developers List"

 
        To:     "POI Developers List" <po...@jakarta.apache.org>
        cc: 
        Subject:        Re: HWPF Status:- Before you commit

 

> Now the way I have done it:-
> When we reach a style like style B in above Example, create its UPE.chpx
> first by MERGING  the UPX.chpx of that style to the nilUPE.chpx as
> described in Spec as "The UPE.chpx for the null style has an istd of 
zero,
a cbGrpprl of zero
> (and an empty grpprl). "
> Now apply that MERGED chpx to a standard Chp (nullCharacter style), then
> pass this chp to its child style like style A in the example above. From
> there on keep applying the UPX.chpx to this Chp to get the final Chp 
from
> StyleSheet & then apply the chpx fromCHPFKP to get the FINAL CHP.
>

Praveen, I don't remember this being a problem. I know the way that the 
spec
describes it raises this possibility. However, I am almost absolutely sure
that Word does not allow chaining the styles in this way.  I have never
encountered a paragraph style that was based on a character style. Have 
you
actually tested this out to see if styles are chained in this manner?

The way I originally read them was just recursively uncompressing the paps
and chps seperately. For example if you have a style chain of A, D, C, F,
nil. I would try to uncompress A.chp using D.chp, if D.chp was still
compressed, I would try to uncompress D.chp using C.chp, and so on, until
finally you reach the nil character style that is guaranteed to be
uncompressed. It is the exact same way for paps.

Ryan


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-dev-help@jakarta.apache.org