diff -r fcdfafb36fe7 -r aecbbf00d063 uifw/EikStd/coctlsrc/smileymodel.cpp --- a/uifw/EikStd/coctlsrc/smileymodel.cpp Thu Aug 19 10:11:06 2010 +0300 +++ b/uifw/EikStd/coctlsrc/smileymodel.cpp Tue Aug 31 15:28:30 2010 +0300 @@ -390,89 +390,3 @@ aText[i + aDocPos] = CSmileyManager::KPlaceHolder; } } - - -///////////////////////////////////////////////////////////////////////////////////////// - -const char KStartSymbol[] = {'(', '<', '[', '{'}; -const char KEndSymbol[] = {')', '>', ']', '}'}; - -TInt IndexFrom(const char* const aPtr, TInt aLength, TInt aChar) - { - for(TInt i=0; i=0; i--) - { - TInt index = IndexFrom(KEndSymbol, sizeof(KEndSymbol), aText[i]); // detect end symbol - if(KErrNotFound != index) // push - { - stack[pos++] = KStartSymbol[index]; - } - else if(pos) // detect start symbol - { - if(stack[pos-1] == aText[i]) // meet a start symbol - { - pos--; - if(!pos) return (smileyPos > i); - } - } - - if(smileyPos == i) // smiley combination finished - { - if(!pos) return EFalse; - } - } - - return EFalse; - } - -TBool IsPartOfUrl(const TDesC& aText) - { - const TInt end = aText.Length() - 1; - TInt pos = end; - while(pos > 0) - { - const TUint16 word = aText[--pos]; - if(word == ' ' || word == 0x2029) - { - break; - } - } - - TInt length = end - pos; - if(length > 5) - { - TPtrC field(aText.Mid(pos,length)); - pos = field.Find(_L(":\\\\")); - if(KErrNotFound == pos) pos = field.Find(_L("://")); - if(KErrNotFound != pos) - { - return ETrue; - } - } - - return EFalse; - } - -TBool CSmileyModel::IsSmileyBySemanticAnalysis(const TDesC& aText, TInt aSmileyLength) - { - if(HavePairedSymbol(aText, aSmileyLength)) return EFalse; - - if(IsPartOfUrl(aText)) return EFalse; - - return ETrue; - }