From bcbd6be013be671e821b914d9bbb964ad9cd9799 Mon Sep 17 00:00:00 2001 From: Bowon Ryu Date: Wed, 8 Feb 2023 20:02:39 +0900 Subject: [PATCH] [Tizen] Code clean up fix some conditions for better readability Change-Id: I69e47315fd72e1f0b6ae275e0442889b610bb445 Signed-off-by: Bowon Ryu --- dali-toolkit/internal/text/text-controller.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index 24c92fa..f7b28f9 100644 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -2321,15 +2321,21 @@ void Controller::InsertText(const std::string& text, Controller::InsertType type Dali::TtsPlayer player = Dali::TtsPlayer::Get(Dali::TtsPlayer::SCREEN_READER); if(player) { - // PRE_EDIT text will inserted same time after this COMMIT, do not play tts. - if(!(type == COMMIT && mImpl->mEventData->mPreEditToCommitFlag && characterCount == 1u)) + if(type == COMMIT && mImpl->mEventData->mPreEditToCommitFlag) { - std::string ttsText = text; - if(type == COMMIT && mImpl->mEventData->mPreEditToCommitFlag && characterCount > 1u && text.length() > mImpl->mEventData->mPreEditTextLength) + if(characterCount > 1u) { - ttsText = text.substr(mImpl->mEventData->mPreEditTextLength); + std::string ttsText = text; + if(text.length() > mImpl->mEventData->mPreEditTextLength) + { + ttsText = text.substr(mImpl->mEventData->mPreEditTextLength); + } + player.Play(ttsText); } - player.Play(ttsText); + } + else + { + player.Play(text); } } } -- 2.7.4