218 const TDesC& aText, const TDesC& aPhrase ) |
218 const TDesC& aText, const TDesC& aPhrase ) |
219 { |
219 { |
220 CDesCArrayFlat* keyStrokeArray = UIContainer()->EditPaneWindow()->KeystrokeArray(); |
220 CDesCArrayFlat* keyStrokeArray = UIContainer()->EditPaneWindow()->KeystrokeArray(); |
221 CDesCArrayFlat* phraseKeyStrokeArray = UIContainer()->EditPaneWindow()->PhraseShowKeyStrokeArray() ; |
221 CDesCArrayFlat* phraseKeyStrokeArray = UIContainer()->EditPaneWindow()->PhraseShowKeyStrokeArray() ; |
222 CDesCArrayFlat* phraseArray = UIContainer()->EditPaneWindow()->PhraseArray(); |
222 CDesCArrayFlat* phraseArray = UIContainer()->EditPaneWindow()->PhraseArray(); |
|
223 CDesCArrayFlat* phraseZhuYinSpellingArray = UIContainer()->EditPaneWindow()->PhraseZhuYinSpellingArray(); |
223 |
224 |
224 RArray<TInt>* keyCodeArray = UIContainer()->EditPaneWindow()->KeycodeArray(); |
225 RArray<TInt>* keyCodeArray = UIContainer()->EditPaneWindow()->KeycodeArray(); |
225 RArray<TInt>* keyCodePhraseArray = UIContainer()->EditPaneWindow()->PhraseKeycodeArray(); |
226 RArray<TInt>* keyCodePhraseArray = UIContainer()->EditPaneWindow()->PhraseKeycodeArray(); |
226 phraseArray->AppendL( aPhrase ); |
227 phraseArray->AppendL( aPhrase ); |
|
228 |
|
229 //we store zhuyin-spelling for this phrase |
|
230 TInt delCount = phraseZhuYinSpellingArray->Count() - phraseArray->Count();//we can sure delCount>=0,impossible <0 |
|
231 if(delCount > 0) |
|
232 { |
|
233 phraseZhuYinSpellingArray->Delete( phraseArray->Count(),delCount );//keep same count,del from tail one by one |
|
234 } |
|
235 TInt pos = -1; |
|
236 if(-1 == pos) |
|
237 pos = aText.Find( KDelimiter );//single quote |
|
238 if(-1 == pos) |
|
239 pos = GetIndexOfToneMark( aText ); |
|
240 if(-1 == pos) |
|
241 pos = aText.Length();//impossible |
|
242 phraseZhuYinSpellingArray->AppendL(aText.Left(pos+1));//we are sure the first spelling-group from left match the aPhrase |
|
243 |
|
244 |
227 TBuf<KInputPaneLength> keyStoke; |
245 TBuf<KInputPaneLength> keyStoke; |
228 TInt replaceCount = 0; |
246 TInt replaceCount = 0; |
229 TInt delimiterIndex = aText.Find( KDelimiter ); |
247 TInt delimiterIndex = aText.Find( KDelimiter ); |
230 if ( KErrNotFound == delimiterIndex ) |
248 if ( KErrNotFound == delimiterIndex ) |
231 { |
249 { |