Hi lijian,

> Recently, I met a problem regarding SwCursor.
> So, I want to look deep into the Class SwPam.
>
> I wonder the meaning of some members of this class:
> aBound1 aBound2 pPoint pMark.
>   
I just asked FME about aBound1 and aBound2 and was told it is just an
old and odd implementation detail it could have be done without those,
they are actually used to store the position of point and mark.
For usage only Point and Mark (as in the interface) are of interest.
> I guess pPoint represents the position of the current cursor, right ?
>   
That is correct in the case where we have no selection.
If you make a selection and start dragging it from position A1 to
position A2 then the Mark will be set to the starting position A1 and
the point to the end position A2.
Especially Point and Mark are in no specific relation in respect to the
writing direction. If you want that use Start and End in the interface.

> In *pPoint, there is a node, what is it used for ?
>   
The SwNodeIndex <http://lxr.go-oo.org/ident?i=SwNodeIndex> nNode stores
the pointer to the SwNode object the cursor (here the pPoint) is
pointing to, and it keeps the 'connection' to the nodes array.
<http://lxr.go-oo.org/ident?i=nNode>

Depending on the selected object the SwNode pointer can point to
graphics, frames, OLE objects (SwOLENode
<http://lxr.go-oo.org/ident?i=SwOLENode>), tables (SwTableNode), simple
text (SwTxtNode) etc. In the case of SwTxtNode the SwIndex::GetIndex
gives the exact position in the text where the cursor points to.

Thus in case that the cursor is located within a plain paragraph
pCursor->GetPoint()->nNode will point to the SwTxtNode that holds the
text of the paragraph and
pCursor->GetPoint()->nContent.GetIndex() will give it's position in the
paragraph

> Then, what is pMark used for ?
>   
See above.


Regards,
Thomas


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to