Subject: Re: commit: RTF header export - first cut
From: Hubert Figuiere (hfiguiere@teaser.fr)
Date: Wed Oct 10 2001 - 04:47:17 CDT
According to Matti Picus <matti@picus.org>:
> Here we go. Unfortunately, the exported RTF cannot be properly imported by
> AbiWord, in spite of being perfectly valid.
>
> The problem is in IE_Imp_RTF. The exported {\header ..} sequence appears
> AFTER a {\pard ..} sequence, whereas the code expects the header definition
> to be before. The problem is that the closing } in the \pard sequence
> triggers IE_Imp_RTF::FlushStoredChars() which calls
> ApplySectionAttributes() before the header is properly "registered" with
> the section.
>
> As linear-style document structure seems to be preferred, the
> ApplySectionAttributes should only be called when a new section begins or
> because of EndOfDocument. Alternatively, we could continue with the broken
> RTF importer and force the exporter to write the header before any blocks.
> Any ideas?
As the RTF header/footer import implementor, I think I can explain.
The problem is that in RTF, headers and footer are defined along the linear
structure of the document. Since each section can have it header and footer,
the rule is if a header/footer is encountered, apply it to current section
and forward (which gets overridden by a new header/footer). So can have a
header/footer almost anywhere within the text stream.
BTW, is the RTF importer is permissive with the current specification, this
a likely to allow importing documents generated by broken exporters. As
always, be strict in what you send and permissive in what you receive.
Hub
This archive was generated by hypermail 2b25 : Wed Oct 10 2001 - 04:46:04 CDT