AW: RTF: white-space-treatment and linefeed-treatment

2004-01-27 Thread Peter Herweg
> What are the difficulties for nested blocks?

Maybe difficulties is the wrong word. Just a thing i have to care for. If i
do the processing of FOs in endBlock, i have to suppress the processing
within nested blocks. Or the nested blocks will be processed twice.

Kind regards
Peter Herweg


> -Ursprungliche Nachricht-
> Von: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Auftrag
> von J.Pietschmann
> Gesendet: Monday, January 26, 2004 8:58 PM
> An: [EMAIL PROTECTED]
> Betreff: Re: RTF: white-space-treatment and linefeed-treatment
>
>
> Peter Herweg wrote:
> > (2) I defer the processing of all inline-generating,
> text-containing FOs,
> > and process them in RtfHandler.endBlock.
>
> I'd say start with this option, although I'm starting to believe we
> could and should move whitespace processing to before the invocation
> of the structure renderer's character event call. You still have to
> delay some output because space before/after a line break must be
> stripped for many settings.
>
> What are the difficulties for nested blocks?
>
> J.Pietschmann



Re: AW: RTF: white-space-treatment and linefeed-treatment

2004-01-27 Thread J.Pietschmann
Peter Herweg wrote:
Maybe difficulties is the wrong word. Just a thing i have to care for. If i
do the processing of FOs in endBlock, i have to suppress the processing
within nested blocks. Or the nested blocks will be processed twice.
I think you can flush the queue each time a nested block
starts and each time a block ends. The start of a new block
forces a new line, so you can finish the current line,
including whitespace processing.
J.Pietschmann


RE: AW: RTF: white-space-treatment and linefeed-treatment

2004-01-27 Thread Peter Herweg
> I think you can flush the queue each time a nested block
> starts and each time a block ends.

I have no queue to flush. All i do is ignoring all event handler functions
until endBlock is called for a not-nested Block. Then i iterate recursively
through its children an call all appropriate event handlers.

For this purpose i have implemented a reference counter. Eachtime startBlock
is entered the counter is incremented. Eachtime endBlock is entered the
counter is decremented. So when the reference counter reachs 0, a not-nested
block is finished and i can process all deferred FOs. Works quite good.

Kind regards
Peter Herweg

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of
> J.Pietschmann
> Sent: Tuesday, January 27, 2004 9:16 PM
> To: [EMAIL PROTECTED]
> Subject: Re: AW: RTF: white-space-treatment and linefeed-treatment
>
>
> Peter Herweg wrote:
> > Maybe difficulties is the wrong word. Just a thing i have to
> care for. If i
> > do the processing of FOs in endBlock, i have to suppress the processing
> > within nested blocks. Or the nested blocks will be processed twice.
>
> I think you can flush the queue each time a nested block
> starts and each time a block ends. The start of a new block
> forces a new line, so you can finish the current line,
> including whitespace processing.
>
> J.Pietschmann