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