X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-controller-text-updater.cpp;h=caf44f7d3ba63b08152614727ea399579905a55e;hp=75ea73c99274218ab1f8cac44629060646a83edf;hb=0c862d5823332bc2161c64f901395f2390c82fd2;hpb=5196315c0dcb4ffe51650ebd5415d680be611f7e diff --git a/dali-toolkit/internal/text/text-controller-text-updater.cpp b/dali-toolkit/internal/text/text-controller-text-updater.cpp index 75ea73c..caf44f7 100644 --- a/dali-toolkit/internal/text/text-controller-text-updater.cpp +++ b/dali-toolkit/internal/text/text-controller-text-updater.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +26,7 @@ #include #include #include +#include #include namespace @@ -55,7 +56,7 @@ void Controller::TextUpdater::SetText(Controller& controller, const std::string& ResetText(controller); // Remove the style. - controller.ClearStyleData(); + impl.ClearStyleData(); CharacterIndex lastCursorIndex = 0u; @@ -89,7 +90,8 @@ void Controller::TextUpdater::SetText(Controller& controller, const std::string& logicalModel->mEmbeddedItems, logicalModel->mAnchors, logicalModel->mUnderlinedCharacterRuns, - logicalModel->mBackgroundColorRuns); + logicalModel->mBackgroundColorRuns, + logicalModel->mStrikethroughCharacterRuns); Length textSize = 0u; const uint8_t* utf8 = NULL; @@ -141,7 +143,7 @@ void Controller::TextUpdater::SetText(Controller& controller, const std::string& } else { - controller.ShowPlaceholderText(); + PlaceholderHandler::ShowPlaceholderText(impl); } unsigned int oldCursorPos = (nullptr != eventData ? eventData->mPrimaryCursorPosition : 0); @@ -150,7 +152,7 @@ void Controller::TextUpdater::SetText(Controller& controller, const std::string& controller.ResetCursorPosition(lastCursorIndex); // Scrolls the text to make the cursor visible. - controller.ResetScrollPosition(); + impl.ResetScrollPosition(); impl.RequestRelayout(); @@ -350,7 +352,7 @@ void Controller::TextUpdater::InsertText(Controller& controller, const std::stri if(addFontSizeRun) { - fontDescriptionRun.size = static_cast(inputStyle.size * impl.mFontSizeScale * 64.f); + fontDescriptionRun.size = static_cast(inputStyle.size * impl.GetFontSizeScale() * 64.f); fontDescriptionRun.sizeDefined = true; } @@ -405,7 +407,7 @@ void Controller::TextUpdater::InsertText(Controller& controller, const std::stri impl.IsPlaceholderAvailable()) { // Show place-holder if empty after removing the pre-edit text - controller.ShowPlaceholderText(); + PlaceholderHandler::ShowPlaceholderText(impl); eventData->mUpdateCursorPosition = true; impl.ClearPreEditFlag(); }