From: Victor Cebollada Date: Thu, 1 Oct 2015 13:59:31 +0000 (+0100) Subject: Fix the cursor position when retrieving the selected text. X-Git-Tag: dali_1.1.6~8^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=f246a43aa659a547e8a86e38e50761735cb9be9e Fix the cursor position when retrieving the selected text. * The cursor shouldn't be updated when the selected text is retrieved unless is deleted after retrieval. Change-Id: Ib6e53ce41199fd3b62c59effedcd42d2b70d6158 Signed-off-by: Victor Cebollada --- diff --git a/dali-toolkit/internal/text/text-controller-impl.cpp b/dali-toolkit/internal/text/text-controller-impl.cpp index bd66860..795a929 100644 --- a/dali-toolkit/internal/text/text-controller-impl.cpp +++ b/dali-toolkit/internal/text/text-controller-impl.cpp @@ -899,10 +899,12 @@ void Controller::Impl::RetrieveSelection( std::string& selectedText, bool delete Vector::Iterator first = currentText.Begin() + startOfSelectedText; Vector::Iterator last = first + lengthOfSelectedText; currentText.Erase( first, last ); + + // Scroll after delete. + mEventData->mPrimaryCursorPosition = handlesCrossed ? mEventData->mRightSelectionPosition : mEventData->mLeftSelectionPosition; + mEventData->mScrollAfterDelete = true; + mEventData->mDecoratorUpdated = true; } - mEventData->mPrimaryCursorPosition = handlesCrossed ? mEventData->mRightSelectionPosition : mEventData->mLeftSelectionPosition; - mEventData->mScrollAfterDelete = true; - mEventData->mDecoratorUpdated = true; } }