2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 05:47:42 +00:00

General: Use std::make_unique where applicable

No behavior change.
This commit is contained in:
Lioncash
2019-09-05 18:16:21 -04:00
parent 81beae5526
commit 765c51776b
14 changed files with 118 additions and 106 deletions

View File

@@ -21,9 +21,10 @@ TextField::TextField(ViewResources& res, View& parentView, IStringBinding* strBi
setInactive();
m_vertsBinding.load<decltype(m_verts)>(m_verts);
m_text.reset(new TextView(res, *this, res.m_mainFont, TextView::Alignment::Left, 1024));
if (strBind)
m_text = std::make_unique<TextView>(res, *this, res.m_mainFont, TextView::Alignment::Left, 1024);
if (strBind != nullptr) {
setText(strBind->getDefault(this));
}
}
TextField::~TextField() = default;
@@ -605,7 +606,7 @@ void TextField::setErrorState(std::string_view message) {
clearSelectionRange();
refreshBg();
m_errText.reset(new TextView(rootView().viewRes(), *this, rootView().viewRes().m_mainFont));
m_errText = std::make_unique<TextView>(rootView().viewRes(), *this, rootView().viewRes().m_mainFont);
m_errText->typesetGlyphs(message, rootView().themeData().uiText());
updateSize();