diff --git a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/cxx/TextLayoutManager.h b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/cxx/TextLayoutManager.h index a8b454814b53d4..84ffee6bf33bd6 100644 --- a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/cxx/TextLayoutManager.h +++ b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/cxx/TextLayoutManager.h @@ -29,10 +29,12 @@ class TextLayoutManager { public: TextLayoutManager(const ContextContainer::Shared& contextContainer) {} + virtual ~TextLayoutManager() = default; + /* * Measures `attributedStringBox` using native text rendering infrastructure. */ - TextMeasurement measure( + virtual TextMeasurement measure( AttributedStringBox attributedStringBox, ParagraphAttributes paragraphAttributes, LayoutConstraints layoutConstraints, @@ -42,7 +44,7 @@ class TextLayoutManager { * Measures lines of `attributedString` using native text rendering * infrastructure. */ - LinesMeasurements measureLines( + virtual LinesMeasurements measureLines( AttributedString attributedString, ParagraphAttributes paragraphAttributes, Size size) const; @@ -53,7 +55,7 @@ class TextLayoutManager { */ void* getNativeTextLayoutManager() const; - std::shared_ptr getHostTextStorage( + virtual std::shared_ptr getHostTextStorage( AttributedString attributedStringBox, ParagraphAttributes paragraphAttributes, LayoutConstraints layoutConstraints) const;