From: Joogab Yun Date: Wed, 2 Oct 2019 08:17:03 +0000 (+0900) Subject: fixed Crash when entering backspace in texteditor X-Git-Tag: dali_1.4.40~1 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=649a87f4a6a31321f0eeb2eeecd0a7b9dd45f570 fixed Crash when entering backspace in texteditor If you type text as multiline and then delete the backspace, crash will occur. textEditor = TextEditor::New(); textEditor.SetBackgroundColor( Color::CYAN ); textEditor.SetSize( 500.f, 500.f ); textEditor.SetPosition( 100.f, 150.f ); textEditor.SetAnchorPoint( AnchorPoint::TOP_LEFT ); stage.Add( textEditor ); Change-Id: I83a6cd986dd646b2c45efffc048e3d36b479ad5f --- diff --git a/dali-toolkit/internal/text/text-controller-impl.cpp b/dali-toolkit/internal/text/text-controller-impl.cpp index e333be2..90eb88c 100755 --- a/dali-toolkit/internal/text/text-controller-impl.cpp +++ b/dali-toolkit/internal/text/text-controller-impl.cpp @@ -814,7 +814,7 @@ bool Controller::Impl::UpdateModel( OperationsMask operationsRequired ) // Check whether the indices for updating the text is valid if ( numberOfCharacters > 0u && - ( mTextUpdateInfo.mParagraphCharacterIndex >= numberOfCharacters || + ( mTextUpdateInfo.mParagraphCharacterIndex > numberOfCharacters || mTextUpdateInfo.mRequestedNumberOfCharacters > numberOfCharacters ) ) { std::string currentText; diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index 5ca9858..2f3306b 100755 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -3775,7 +3775,7 @@ bool Controller::DoRelayout( const Size& size, // Make sure the index is not out of bound if ( charactersToGlyph.Count() != glyphsPerCharacter.Count() || requestedNumberOfCharacters > charactersToGlyph.Count() || - ( lastIndex >= charactersToGlyph.Count() && charactersToGlyph.Count() > 0u ) ) + ( lastIndex > charactersToGlyph.Count() && charactersToGlyph.Count() > 0u ) ) { std::string currentText; GetText( currentText );