Change raw pointer to unique_ptr 83/262583/5
authorBowon Ryu <bowon.ryu@samsung.com>
Fri, 13 Aug 2021 09:20:00 +0000 (18:20 +0900)
committerBowon Ryu <bowon.ryu@samsung.com>
Fri, 13 Aug 2021 11:52:29 +0000 (20:52 +0900)
commit2daa5af9afa208c6e58b5a69ff304b513777aa63
tree20a48d6dd5b825146ce78d8bf732c541406c6606
parent63f686ca7536fd1f010278d4896407476ccc4e52
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