void LLEmbeddedItems::clear() { // Remove entries for this editor from static list for (std::set<llwchar>::iterator iter = mEmbeddedUsedChars.begin(); iter != mEmbeddedUsedChars.end();) { std::set<llwchar>::iterator nextiter = iter++; removeEmbeddedItem(*nextiter); } mEmbeddedUsedChars.clear(); mEmbeddedIndexedChars.clear(); }
void LLEmbeddedItems::removeUnusedChars() { std::set<llwchar> used = mEmbeddedUsedChars; const LLWString& wtext = mEditor->getWText(); for (S32 i=0; i<(S32)wtext.size(); i++) { llwchar wc = wtext[i]; if( wc >= LLTextEditor::FIRST_EMBEDDED_CHAR && wc <= LLTextEditor::LAST_EMBEDDED_CHAR ) { used.erase(wc); } } // Remove chars not actually used for (std::set<llwchar>::iterator iter = used.begin(); iter != used.end(); ++iter) { removeEmbeddedItem(*iter); } }