At 10:31 AM 3/19/01 -0000, Tom Newton wrote:
>FWIW I think it's certainly simplest to emit all known styles.  That is what
>Maxwell does ;) for that very reason.  

Yep.  That's definitely easiest.  

>However, I just had a quick play with
>MSWord (exporting an RTF document - maybe saving to a .doc is different) and
>it only seems to emit styles that have been used in the document (plus the
>"default" style, i.e. "Normal") plus all styles that are in the template.

This sounds like my proposal, but just to check on one potential difference 
-- if there's a user-defined style that happens to not be used, do they emit 
it anyhow?  

>Copying this behaviour means that you need to keep track of the styles that
>have been used in a document, so is of course more work to implement.

Yeah.  We already keep track of which styles have been defined, but we don't 
currently refcount how many times each style has been applied.  To do so, 
we'd probably need to modify the piece table to handle both of the following 
cases:

  - refcount apply/revert actions during editing
  - refcount on import as well

The basic refcount algorithm should be pretty simple, just counting how many 
times a particular style is used.  Note however, that since we have basedon 
styles, the "is it used" check at export time would also need to check all 
descendants to make sure none of them were used either.  

Definitely a tad more work.  :-)

>I guess there's nothing to stop you starting with a simple implementation
>that emits everything and then at some point in the future moving to the
>more complex behaviour.

Off the cuff, I can't think of any screw cases where having unused default 
style definitions in the document would cause problems (besides bloat).  Can 
anyone else?  

>In any case, either of the alternatives you've suggested would be a great
>improvement on the existing implementation and my feeling is that one of the
>proposals should be implemented before 1.0 is deemed feature complete.  Of
>course, it's easy for me to say this because I am all mouth and no trousers
>;)

Absolutely.   Thanks for confirming what we need here.  

Paul

Reply via email to