From 5ff59b448b5121dddc4a99665a28ade61d4985fd Mon Sep 17 00:00:00 2001 From: Andrew Datsenko Date: Thu, 28 Nov 2024 12:07:56 -0800 Subject: [PATCH] Add defaults to ParagraphAttributes::getDebugProps (#47986) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/47986 Changelog: [Internal] Reviewed By: NickGerleman Differential Revision: D66542033 fbshipit-source-id: d1f3d1776138d076636765262e27ae8e5e7342c5 --- .../attributedstring/ParagraphAttributes.cpp | 38 +++++++++++++++---- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/packages/react-native/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.cpp b/packages/react-native/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.cpp index f2317ba080f..b20b4c900fb 100644 --- a/packages/react-native/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.cpp +++ b/packages/react-native/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.cpp @@ -41,16 +41,38 @@ bool ParagraphAttributes::operator!=(const ParagraphAttributes& rhs) const { #if RN_DEBUG_STRING_CONVERTIBLE SharedDebugStringConvertibleList ParagraphAttributes::getDebugProps() const { + ParagraphAttributes paragraphAttributes{}; return { - debugStringConvertibleItem("maximumNumberOfLines", maximumNumberOfLines), - debugStringConvertibleItem("ellipsizeMode", ellipsizeMode), - debugStringConvertibleItem("textBreakStrategy", textBreakStrategy), - debugStringConvertibleItem("adjustsFontSizeToFit", adjustsFontSizeToFit), - debugStringConvertibleItem("minimumFontSize", minimumFontSize), - debugStringConvertibleItem("maximumFontSize", maximumFontSize), - debugStringConvertibleItem("includeFontPadding", includeFontPadding), debugStringConvertibleItem( - "android_hyphenationFrequency", android_hyphenationFrequency)}; + "maximumNumberOfLines", + maximumNumberOfLines, + paragraphAttributes.maximumNumberOfLines), + debugStringConvertibleItem( + "ellipsizeMode", ellipsizeMode, paragraphAttributes.ellipsizeMode), + debugStringConvertibleItem( + "textBreakStrategy", + textBreakStrategy, + paragraphAttributes.textBreakStrategy), + debugStringConvertibleItem( + "adjustsFontSizeToFit", + adjustsFontSizeToFit, + paragraphAttributes.adjustsFontSizeToFit), + debugStringConvertibleItem( + "minimumFontSize", + minimumFontSize, + paragraphAttributes.minimumFontSize), + debugStringConvertibleItem( + "maximumFontSize", + maximumFontSize, + paragraphAttributes.maximumFontSize), + debugStringConvertibleItem( + "includeFontPadding", + includeFontPadding, + paragraphAttributes.includeFontPadding), + debugStringConvertibleItem( + "android_hyphenationFrequency", + android_hyphenationFrequency, + paragraphAttributes.android_hyphenationFrequency)}; } #endif