Hi,

I have the following function, which seems to do what I want:

//returns true, if there is another note right before this note
bool SwPostIt::IsFollow()
{
        SwPosition * pPos = mpFmtFld->GetTxtFld()->GetPosition();
        const SwTxtNode* pTxtNd = pPos->nNode.GetNode().GetTxtNode();
SwTxtAttr* pTxtAttr = pTxtNd ? pTxtNd->GetTxtAttr( pPos->nContent.GetIndex()-1,RES_TXTATR_FIELD ) : 0;
        const SwField* pFld = pTxtAttr ? pTxtAttr->GetFld().GetFld() : 0;
        delete pPos;
        return pFld && (pFld->Which()== RES_POSTITFLD) ;
}


As I am not really familiar with Node-stuff, could someone review and let me know if this is the right way to do and this does not have any bad sideeffects/possible crashers?

This does not yet work if there is hidden text in between, do I have to go step-by-step backwards and check for the hidden attribute or is there an easier way?

Best regards
Max

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

Reply via email to