uiutils/Findutil/src/FindUtilChinese.cpp
branchRCL_3
changeset 38 c52421ed5f07
parent 16 71dd06cfe933
child 51 fcdfafb36fe7
equal deleted inserted replaced
29:a8834a2e9a96 38:c52421ed5f07
   323   
   323   
   324 	for (TInt i =0; i < len; i++)
   324 	for (TInt i =0; i < len; i++)
   325 	    {
   325 	    {
   326 	    if (wordInterpretationBuf[i] == KSeperator) 
   326 	    if (wordInterpretationBuf[i] == KSeperator) 
   327 	        {
   327 	        {
   328 	        aSpellList.Append((wordInterpretationBuf.MidTPtr(start, i-start)).Alloc());
   328 	        HBufC16* tmpStr = (wordInterpretationBuf.MidTPtr(start, i-start)).AllocLC();
       
   329 	        aSpellList.AppendL(tmpStr);
       
   330 	        CleanupStack::Pop(tmpStr);
   329 	        start = i + 1;
   331 	        start = i + 1;
   330 	        }
   332 	        }
   331 	    }
   333 	    }
   332 	        
   334 
   333 	aSpellList.Append((wordInterpretationBuf.MidTPtr(start, len-start)).Alloc());   	
   335 	HBufC16* tmpStr = (wordInterpretationBuf.MidTPtr(start, len-start)).AllocLC();
   334 
   336 	aSpellList.AppendL(tmpStr);
   335     
   337     CleanupStack::Pop(tmpStr);
       
   338 
   336     return ETrue;
   339     return ETrue;
   337 	}
   340 	}
   338 
   341 
   339 // ---------------------------------------------------------
   342 // ---------------------------------------------------------
   340 // Do translate for Chinese word
   343 // Do translate for Chinese word
   463 	    {
   466 	    {
   464 	    for (TInt i =0; i < len; i++)
   467 	    for (TInt i =0; i < len; i++)
   465 	        {
   468 	        {
   466 	        if (wordInterpretationBuf[i] == KSeperator) 
   469 	        if (wordInterpretationBuf[i] == KSeperator) 
   467 	            {
   470 	            {
   468 	            aSpellList.Append((wordInterpretationBuf.MidTPtr(start, i-start)).Alloc());
   471 	            HBufC16* tmpStr = (wordInterpretationBuf.MidTPtr(start, i-start)).AllocLC();
       
   472 	            aSpellList.AppendL(tmpStr);
       
   473 	            CleanupStack::Pop(tmpStr);
   469 	            start = i + 1;
   474 	            start = i + 1;
   470 	            }
   475 	            }
   471 	        }
   476 	        }
   472 	        
   477 
   473 	    aSpellList.Append((wordInterpretationBuf.MidTPtr(start, len-start)).Alloc());   	
   478 	    HBufC16* tmpStr = (wordInterpretationBuf.MidTPtr(start, len-start)).AllocLC();
       
   479 	    aSpellList.AppendL(tmpStr);   	
       
   480         CleanupStack::Pop(tmpStr);
   474 	    }
   481 	    }
   475     //Could look advanced cangjie as normal and easy cangjie
   482     //Could look advanced cangjie as normal and easy cangjie
   476     else 
   483     else 
   477 	    {
   484 	    {
   478 	    iPtiEngine->GetSpelling(aHZUnicode, wordInterpretationBuf, EPtiEasyCangjie);
   485 	    iPtiEngine->GetSpelling(aHZUnicode, wordInterpretationBuf, EPtiEasyCangjie);
   480         start = 0;
   487         start = 0;
   481 	    for (TInt i =0; i < len; i++)
   488 	    for (TInt i =0; i < len; i++)
   482 	        {
   489 	        {
   483 	        if (wordInterpretationBuf[i] == KSeperator) 
   490 	        if (wordInterpretationBuf[i] == KSeperator) 
   484 	            {
   491 	            {
   485 	            aSpellList.Append((wordInterpretationBuf.MidTPtr(start, i-start)).Alloc());
   492 	            HBufC16* tmpStr = (wordInterpretationBuf.MidTPtr(start, i-start)).AllocLC();
       
   493 	            aSpellList.AppendL(tmpStr);
       
   494                 CleanupStack::Pop(tmpStr);
   486 	            start = i + 1;
   495 	            start = i + 1;
   487 	            }
   496 	            }
   488 	        }
   497 	        }
   489         
   498 
   490     	aSpellList.Append((wordInterpretationBuf.MidTPtr(start, len-start)).Alloc()); 
   499 	    HBufC16* tmpStr = (wordInterpretationBuf.MidTPtr(start, len-start)).AllocLC();
   491     	 
   500     	aSpellList.AppendL(tmpStr); 
   492     	
   501         CleanupStack::Pop(tmpStr);
       
   502 
   493     	iPtiEngine->GetSpelling(aHZUnicode, wordInterpretationBuf, EPtiCangJie);
   503     	iPtiEngine->GetSpelling(aHZUnicode, wordInterpretationBuf, EPtiCangJie);
   494 	    len = wordInterpretationBuf.Length();
   504 	    len = wordInterpretationBuf.Length();
   495         start = 0;
   505         start = 0;
   496 	    for (TInt i =0; i < len; i++)
   506 	    for (TInt i =0; i < len; i++)
   497 	        {
   507 	        {
   498 	        if (wordInterpretationBuf[i] == KSeperator) 
   508 	        if (wordInterpretationBuf[i] == KSeperator) 
   499 	            {
   509 	            {
   500 	            aSpellList.Append((wordInterpretationBuf.MidTPtr(start, i-start)).Alloc());
   510 	            tmpStr = (wordInterpretationBuf.MidTPtr(start, i-start)).AllocLC();
       
   511 	            aSpellList.AppendL(tmpStr);
       
   512                 CleanupStack::Pop(tmpStr);
   501 	            start = i + 1;
   513 	            start = i + 1;
   502 	            }
   514 	            }
   503 	        }
   515 	        }
   504         
   516 
   505     	aSpellList.Append((wordInterpretationBuf.MidTPtr(start, len-start)).Alloc());  
   517 	    tmpStr = (wordInterpretationBuf.MidTPtr(start, len-start)).AllocLC();
       
   518     	aSpellList.AppendL(tmpStr);
       
   519         CleanupStack::Pop(tmpStr);
   506 	    }
   520 	    }
   507     
   521     
   508     return ETrue;
   522     return ETrue;
   509     } 
   523     } 
   510 
   524