From 649a87f4a6a31321f0eeb2eeecd0a7b9dd45f570 Mon Sep 17 00:00:00 2001 From: Joogab Yun Date: Wed, 2 Oct 2019 17:17:03 +0900 Subject: [PATCH] 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 --- dali-toolkit/internal/text/text-controller-impl.cpp | 2 +- dali-toolkit/internal/text/text-controller.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 ); -- 2.7.4