X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-controller-impl.cpp;h=f119650a4565917f9691a6ed1f82a91193c30211;hb=026776eb4b0303604b3c6ca5857cc1ac59b4006e;hp=05f353614c0e7addff2be6c608f532a44368aed8;hpb=632c0f0659030bea7e4854c815c88a1eeabcf843;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/text-controller-impl.cpp b/dali-toolkit/internal/text/text-controller-impl.cpp index 05f35361..f119650 100644 --- a/dali-toolkit/internal/text/text-controller-impl.cpp +++ b/dali-toolkit/internal/text/text-controller-impl.cpp @@ -55,7 +55,6 @@ struct SelectionBoxInfo const float MAX_FLOAT = std::numeric_limits::max(); const float MIN_FLOAT = std::numeric_limits::min(); const Dali::Toolkit::Text::CharacterDirection LTR = false; ///< Left To Right direction -const uint32_t STAR = 0x2A; } // namespace @@ -71,6 +70,7 @@ namespace Text EventData::EventData( DecoratorPtr decorator ) : mDecorator( decorator ), mImfManager(), + mPlaceholderText(), mPlaceholderTextActive(), mPlaceholderTextInactive(), mPlaceholderTextColor( 0.8f, 0.8f, 0.8f, 0.8f ), @@ -789,24 +789,16 @@ bool Controller::Impl::UpdateModel( OperationsMask operationsRequired ) return false; } - Vector utf32CharactersStar; - const Length characterCount = mModel->mLogicalModel->mText.Count(); - const bool isPasswordInput = ( mEventData != NULL && mEventData->mPasswordInput && - !mEventData->mIsShowingPlaceholderText && characterCount > 0 ); - - if (isPasswordInput) + Vector& srcCharacters = mModel->mLogicalModel->mText; + Vector displayCharacters; + bool useHiddenText = false; + if ( mHiddenInput && mEventData != NULL && !mEventData->mIsShowingPlaceholderText) { - utf32CharactersStar.Resize( characterCount ); - - uint32_t* begin = utf32CharactersStar.Begin(); - uint32_t* end = begin + characterCount; - while ( begin < end ) - { - *begin++ = STAR; - } + mHiddenInput->Substitute( srcCharacters,displayCharacters ); + useHiddenText = true; } - Vector& utf32Characters = isPasswordInput ? utf32CharactersStar : mModel->mLogicalModel->mText; + Vector& utf32Characters = useHiddenText ? displayCharacters : srcCharacters; const Length numberOfCharacters = utf32Characters.Count(); // Index to the first character of the first paragraph to be updated.