[Tizen] Change raw pointer to unique_ptr 14/262614/1 accepted/tizen/unified/20210817.123144 submit/tizen/20210817.021059
authorBowon Ryu <bowon.ryu@samsung.com>
Fri, 13 Aug 2021 09:20:00 +0000 (18:20 +0900)
committerBowon Ryu <bowon.ryu@samsung.com>
Tue, 17 Aug 2021 01:35:29 +0000 (10:35 +0900)
commit3d44f4febf05c13f1fb567012bb7ec7d7a97858c
treea95fc8b5318ba191707e136b9741320e51e0a4ee
parentac327d84c99134472a7745719d0c5c0db847daa6
[Tizen] Change raw pointer to unique_ptr

The mPlaceholderFont pointer is allocated memory once only
when the text-controller uses a placeholder.
This will persist until mEventData is destroyed.
Changed to a smart pointer suitable for maintenance.

Additionally,
In SetPlaceholderTextFontWidth() and SetPlaceholderTextFontSlant(), mPlaceholderFont can not be NULL.

Even if there is no value in SetFontStyleProperty, it is always set to None,
This is because an instance of mPlaceholderFont is created through SetPlaceholderTextFontWeight(), which is called first.

So this causes coverage issues.
Replace the duplicate code with CreatePlaceholderFont() solves this problem.

Change-Id: Ibd11b02f22e505be8643c9360b5d5e5e2de1b318
Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp
dali-toolkit/internal/text/text-controller-impl.cpp
dali-toolkit/internal/text/text-controller-impl.h
dali-toolkit/internal/text/text-controller-placeholder-handler.cpp
dali-toolkit/internal/text/text-controller-placeholder-handler.h