trichview.support
Re: Remove HTML link |
Author |
Message |
Posted: 08/13/2004 2:51:39 Hi I updated my MakeLink and RemoveLink functions. Got a proper selecting algorithm from the Hyperlink demo. I should have done that eariler. Anyway, unfortunately i m still getting the red highlight when I remove a link style then reload the RVF. I would really appreciate if someone can tell me what needs to be done. Thanks. //--------------------------------------------------- // Make Link //--------------------------------------------------- l_TextControl->ApplyStyleConversion(3); // Get selection details TCustomRichViewEdit* l_RVE = l_TextControl->TopLevelEditor; int l_SelStart, l_SelEnd; int l_SelStartOffs, l_SelEndOffs; l_RVE->GetSelectionBounds(l_SelStart, l_SelStartOffs, l_SelEnd, l_SelEndOffs, true); // Tweak the selectioin if (l_SelStartOffs >= l_RVE->GetOffsAfterItem(l_SelStart)) l_SelStart++; if (l_SelEndOffs <= l_RVE->GetOffsBeforeItem(l_SelEnd)) l_SelEnd--; // Set the Tags l_RVE->BeginUndoGroup(rvutTag); l_RVE->SetUndoGroupMode(true); for (int i=l_SelStart; i<=l_SelEnd; i++) l_RVE->SetItemTagEd(i, (int)StrNew(l_String.c_str())); l_RVE->SetUndoGroupMode(false); //--------------------------------------------------- // Remove Link //--------------------------------------------------- // Remove the TextStyle from the selection first l_TextControl->ApplyStyleConversion(4); // Get selection details TCustomRichViewEdit* l_RVE = l_TextControl->TopLevelEditor; int l_SelStart, l_SelEnd; int l_SelStartOffs, l_SelEndOffs; l_RVE->GetSelectionBounds(l_SelStart, l_SelStartOffs, l_SelEnd, l_SelEndOffs, true); // Tweak the selectioin if (l_SelStartOffs >= l_RVE->GetOffsAfterItem(l_SelStart)) l_SelStart++; if (l_SelEndOffs <= l_RVE->GetOffsBeforeItem(l_SelEnd)) l_SelEnd--; // Set the Tags l_RVE->BeginUndoGroup(rvutTag); l_RVE->SetUndoGroupMode(true); for (int i=l_SelStart; i<=l_SelEnd; i++) l_RVE->SetItemTagEd(i, NULL); l_RVE->SetUndoGroupMode(false); -- Programer - SplashMedia http://splashmedia.co.nz |
Powered by ABC Amber Outlook Express Converter