RE: A Proposal (why we should have setBold(true))


Subject: RE: A Proposal (why we should have setBold(true))
From: Martin Sevior (msevior@mccubbin.ph.unimelb.edu.au)
Date: Tue May 30 2000 - 20:48:17 CDT


On Tue, 30 May 2000, sam th wrote:
>
> Well, you manage to discover the problems I reported exactly. However, I
> don't think life is as bad as you think. If I had a way to get a
> meaningful DocPosition out of the ptbl (as I described in my recent email)
> I think my plan would work.
>
> Currently, the view just does some string hackery and tells the ptbl what
> to do. If I had a document position, I could just move all that string
> hackery down into the ptbl, and then the state of the document could be
> controlled from the ptbl (meaning from the document, without the view).
> I'm waving over several sleepless nights of coding here, but I think it
> would work. But first I *have* to have an insertion point. If that's not
> possible, then it would have to be rewritten to get what I want, as you
> say.
>

I'm saying this without a clue as to how this code works but why can't you
duplicate the insertion point code into a class parallel to fp_View via a
lot of cutting and pasting? ie Hack out the all the point manipulting code
and make a new sub-class of AV_View called IE_View. It could be a friend
class of AV_View.

This parallel class would maintain the insertion point during an import
and export but otherwise would not be used at all. Upon intitalization the
the pointer would be placed at the beginning of document and you could
then happily manipulate the insertion point to you hearts content
without screwing up the current view.

After this code is fully debugged we could rip the point manipulation
code out of fv_View and re-arrange the heiracy to achieve Bruce's
suggestion. Then IE_View gets copied and renamed to something else,
say docControl. The IE_View code neededed during import/export is kept in
a smaller piece of code. Then we have:

fp_View->docControl->ptbl

and

ie_View->docControl->ptbl

So to find out whether some text is Bold in the piece table we do:

getCurrentView()->getDocControl()->getPoint()->isBold()

To use it in import/export you do:

getIe_View()->getDocControl()->getPoint()->isBold()

Doing this way allows us to evolve to Nirvana rather jump there with a
major re-write.

Cheers

Martin



This archive was generated by hypermail 2b25 : Tue May 30 2000 - 20:48:46 CDT