poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Praveen Mathew <prmat...@in.ibm.com>
Subject Re: HWPF Status:- Before you commit
Date Thu, 28 Aug 2003 14:23:41 GMT
Ryan ,
Let me describe the way I have read PAP & CHP
For better performance when a Doc is loaded in memory,& when its 
StyleSheet object is created we are not calling the createPap() & createChp() functions
in StyleSheets constructor. Instead whenever a user wants to read a PAP or 
CHP he calls an API that invokes createPap or createChp.
The createPap() function will construct the UPE for the style corresponding to "istd" 
in the StyleDescription array using its UPX. It does this by the 
recursive, Based -on style Logic. Using a Flag it is set In the 
StyleDescription that if a UPE  has been created or not, so that the next 
time a user wants to read the same PAP he just needs to use the already 
created UPE.

reading of PAP:-
For each paragrahs in the PAPBintable, get the istd. As I have observed 
this "istd" always corresponds to a Style in the StyleDescription array 
having a styleCode = 1i,e a "paragraph" style.Thus it has 2 UPX's one for 
papx  & one for chpx. Calling createPap(istd) for this style only creates the UPE.pap
for that style, & it delays 
the creation of UPE.chp until user calls the createChp(istd)for the same style.The UPE.pap
is created by digging deep recursively until you get a 
nilStyle, then apply the UPX.papx to the nilParagraph style, then return 
back to the Style from where we started applying the same logic.
Once you get the UPE.pap for the style with "istd" apply the papx present 
in the PAPFKP to it to get the final PAP for that paragraph.

reading of CHP:-
The logic is the same here. Initilally you have to track the paragraph in 
which a textRun is present  & get its "istd" which is always a "paragraph 
style", then call
createChp(istd) & keep on creating the UPE.chp for this style.
Now the issue:-

Some where in the based on chain we get a style having styleCode = 2 i,e a 
"character" style. Since "character" style only has UPX.chpx & 
UPE.chpx(doesnt have UPE.chp), we dont get a nilCharacter style to start 
with once we reach the end of the based on chain. I we have to apply 
UPX.chpx to UPE.chpx, & finally we end up in making a chpx for the style 
from where we started,

eg :- Started in Style A (paragraph style), so has UPX.papx & UPX.chpx and 
need to create UPE.pap & UPE.chp. 
But since this style is based on Style B (character style), has UPX.chpx 
and need to create UPE.chpx.(doesnt have UPE.chp).

As per the Logic given in the Spec, we should take the UPE of based on 
style & apply the UPX of current style to it to create its UPE., this is 
not possible since here the UPE of based on style is a chpx.

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.

sorry for the long mail, but just wanted to make my point clear.

Please give me your inputs on this.

Thanks & Regards
Praveen

Praveen Mathew
IBM Software Labs,Airport Road,
Bangalore - 560 017,India.
Ph : +91- 80 - 504 4770 (Direct)
       +91 - 80 - 5262355 Extn: 3770
Email: prmathew@in.ibm.com




Praveen Mathew/India/IBM@IBMIN
28/08/2003 14:52
Please respond to "POI Developers List"

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

 

Ryan, I have to discuss certain issues before you commit the code.
If its possible for you we can have a chat seesion. I will be online.

Thanks & Regards
Praveen






"Ryan Ackley" <sackley@cfl.rr.com>
27/08/2003 23:15
Please respond to "POI Developers List"

 
        To:     "POI Developers List" <poi-dev@jakarta.apache.org>
        cc: 
        Subject:        Re: HWPF Status

 

Thanks Praveen, I will commit tonight.

I am wrapping up Lists. Tables are next.

Ryan

----- Original Message ----- 
From: "Praveen Mathew" <prmathew@in.ibm.com>
To: "POI Developers List" <poi-dev@jakarta.apache.org>
Sent: Wednesday, August 27, 2003 12:31 PM
Subject: HWPF Status


> Hi Ryan,
> I am submitting the code that can read the PAP & CHP of all paragraphs &
> textRuns .The Spec is unclear about the reading of CHP. I have done it 
the
> way I understood. I have to discuss with you certain things on that.
>
> Please review the code that reads CHP (createChp() function in 
StyleSheetN
> class), when you are free and send me your inputs.
>
> Btw, How is the work on list & tables going??
>
> Thanks & Regards
> Praveen
>
> Praveen Mathew
> IBM Software Labs,Airport Road,
> Bangalore - 560 017,India.
> Ph : +91- 80 - 504 4770 (Direct)
>        +91 - 80 - 5262355 Extn: 3770
> Email: prmathew@in.ibm.com
>
>


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






Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message