X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-controller-impl.cpp;h=2c9a78dc9eb71740ffe76c8231b878c6e75d2e6b;hp=268615332fb35f6679c6ac86a5b002fbaa7c8c31;hb=2951af4fa549b8383cebb3464fd14eb86a993e25;hpb=ab72db1d348ee2b2db349233e53804e3df1cb52d diff --git a/dali-toolkit/internal/text/text-controller-impl.cpp b/dali-toolkit/internal/text/text-controller-impl.cpp index 2686153..2c9a78d 100755 --- a/dali-toolkit/internal/text/text-controller-impl.cpp +++ b/dali-toolkit/internal/text/text-controller-impl.cpp @@ -1072,21 +1072,35 @@ bool Controller::Impl::UpdateModel( OperationsMask operationsRequired ) mEventData->mPreEditFlag && ( 0u != mModel->mVisualModel->mCharactersToGlyph.Count() ) ) { - // Add the underline for the pre-edit text. - const GlyphIndex* const charactersToGlyphBuffer = mModel->mVisualModel->mCharactersToGlyph.Begin(); - const Length* const glyphsPerCharacterBuffer = mModel->mVisualModel->mGlyphsPerCharacter.Begin(); + Dali::InputMethodContext::PreeditStyle type = mEventData->mInputMethodContext.GetPreeditStyle(); - const GlyphIndex glyphStart = *( charactersToGlyphBuffer + mEventData->mPreEditStartPosition ); - const CharacterIndex lastPreEditCharacter = mEventData->mPreEditStartPosition + ( ( mEventData->mPreEditLength > 0u ) ? mEventData->mPreEditLength - 1u : 0u ); - const Length numberOfGlyphsLastCharacter = *( glyphsPerCharacterBuffer + lastPreEditCharacter ); - const GlyphIndex glyphEnd = *( charactersToGlyphBuffer + lastPreEditCharacter ) + ( numberOfGlyphsLastCharacter > 1u ? numberOfGlyphsLastCharacter - 1u : 0u ); + switch( type ) + { + case Dali::InputMethodContext::PreeditStyle::UNDERLINE: + { + // Add the underline for the pre-edit text. + const GlyphIndex* const charactersToGlyphBuffer = mModel->mVisualModel->mCharactersToGlyph.Begin(); + const Length* const glyphsPerCharacterBuffer = mModel->mVisualModel->mGlyphsPerCharacter.Begin(); - GlyphRun underlineRun; - underlineRun.glyphIndex = glyphStart; - underlineRun.numberOfGlyphs = 1u + glyphEnd - glyphStart; + const GlyphIndex glyphStart = *( charactersToGlyphBuffer + mEventData->mPreEditStartPosition ); + const CharacterIndex lastPreEditCharacter = mEventData->mPreEditStartPosition + ( ( mEventData->mPreEditLength > 0u ) ? mEventData->mPreEditLength - 1u : 0u ); + const Length numberOfGlyphsLastCharacter = *( glyphsPerCharacterBuffer + lastPreEditCharacter ); + const GlyphIndex glyphEnd = *( charactersToGlyphBuffer + lastPreEditCharacter ) + ( numberOfGlyphsLastCharacter > 1u ? numberOfGlyphsLastCharacter - 1u : 0u ); - // TODO: At the moment the underline runs are only for pre-edit. - mModel->mVisualModel->mUnderlineRuns.PushBack( underlineRun ); + GlyphRun underlineRun; + underlineRun.glyphIndex = glyphStart; + underlineRun.numberOfGlyphs = 1u + glyphEnd - glyphStart; + + mModel->mVisualModel->mUnderlineRuns.PushBack( underlineRun ); + break; + } + // TODO : At this moment, other styles for preedit are not implemented yet. + case Dali::InputMethodContext::PreeditStyle::REVERSE: + case Dali::InputMethodContext::PreeditStyle::HIGHLIGHT: + case Dali::InputMethodContext::PreeditStyle::NONE: + default: + break; + } } // The estimated number of lines. Used to avoid reallocations when layouting.