// **************************************************************************** // // Function Name: RChangeURLAction::Do( ) // // Description: Perform the action. // // Returns: TRUE if action performed sucessfully // // Exceptions: None // // **************************************************************************** BOOLEAN RChangeURLAction::Do() { // Find out what the current URL is for the object. RURL rUrl( m_pComponentDoc->GetURL() ); // Set the component to the stored URL. m_pComponentDoc->SetURL( m_URL ); // Keep the old URL for next pass. m_URL = rUrl; // Since URLs are invisible to the user, no invalidation is necessary. // Call the base method return RUndoableAction::Do(); }
int CUrlRichEditCtrl::FindUrlEx(const CPoint& point) { int nUrl = m_aUrls.GetSize(); while (nUrl--) { const URLITEM& urli = m_aUrls[nUrl]; CRect rUrl(GetCharPos(urli.cr.cpMin), GetCharPos(urli.cr.cpMax)); rUrl.bottom += GetLineHeight(); if (rUrl.PtInRect(point)) return nUrl; } // not found return -1; }