Codechange: Use unique_ptr instead of raw pointer for string layouts. (#13128)
This commit is contained in:
@@ -148,7 +148,7 @@ static CTRunDelegateCallbacks _sprite_font_callback = {
|
||||
&SpriteFontGetWidth
|
||||
};
|
||||
|
||||
/* static */ ParagraphLayouter *CoreTextParagraphLayoutFactory::GetParagraphLayout(CharType *buff, CharType *buff_end, FontMap &fontMapping)
|
||||
/* static */ std::unique_ptr<ParagraphLayouter> CoreTextParagraphLayoutFactory::GetParagraphLayout(CharType *buff, CharType *buff_end, FontMap &fontMapping)
|
||||
{
|
||||
if (!MacOSVersionIsAtLeast(10, 5, 0)) return nullptr;
|
||||
|
||||
@@ -209,7 +209,7 @@ static CTRunDelegateCallbacks _sprite_font_callback = {
|
||||
/* Create and return typesetter for the string. */
|
||||
CFAutoRelease<CTTypesetterRef> typesetter(CTTypesetterCreateWithAttributedString(str.get()));
|
||||
|
||||
return typesetter ? new CoreTextParagraphLayout(std::move(typesetter), buff, length, fontMapping) : nullptr;
|
||||
return typesetter ? std::make_unique<CoreTextParagraphLayout>(std::move(typesetter), buff, length, fontMapping) : nullptr;
|
||||
}
|
||||
|
||||
/* virtual */ std::unique_ptr<const ParagraphLayouter::Line> CoreTextParagraphLayout::NextLine(int max_width)
|
||||
|
||||
Reference in New Issue
Block a user