mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-15 01:22:29 +08:00
Fabric: Equality operators for AttributedString and derivatives
Summary: We will need this eventually. Reviewed By: mdvacca Differential Revision: D9799852 fbshipit-source-id: 0411e2f41540273c80f425e04c877fe51b9b2374
This commit is contained in:
committed by
Facebook Github Bot
parent
4eb9b40979
commit
e663b1ed59
@@ -53,6 +53,66 @@ void TextAttributes::apply(TextAttributes textAttributes) {
|
||||
layoutDirection = textAttributes.layoutDirection.hasValue() ? textAttributes.layoutDirection : layoutDirection;
|
||||
}
|
||||
|
||||
#pragma mark - Operators
|
||||
|
||||
bool TextAttributes::operator==(const TextAttributes &rhs) const {
|
||||
return
|
||||
std::tie(
|
||||
foregroundColor,
|
||||
backgroundColor,
|
||||
opacity,
|
||||
fontFamily,
|
||||
fontSize,
|
||||
fontSizeMultiplier,
|
||||
fontWeight,
|
||||
fontStyle,
|
||||
fontVariant,
|
||||
allowFontScaling,
|
||||
letterSpacing,
|
||||
lineHeight,
|
||||
alignment,
|
||||
baseWritingDirection,
|
||||
textDecorationColor,
|
||||
textDecorationLineType,
|
||||
textDecorationLineStyle,
|
||||
textDecorationLinePattern,
|
||||
textShadowOffset,
|
||||
textShadowRadius,
|
||||
textShadowColor,
|
||||
isHighlighted,
|
||||
layoutDirection
|
||||
) ==
|
||||
std::tie(
|
||||
rhs.foregroundColor,
|
||||
rhs.backgroundColor,
|
||||
rhs.opacity,
|
||||
rhs.fontFamily,
|
||||
rhs.fontSize,
|
||||
rhs.fontSizeMultiplier,
|
||||
rhs.fontWeight,
|
||||
rhs.fontStyle,
|
||||
rhs.fontVariant,
|
||||
rhs.allowFontScaling,
|
||||
rhs.letterSpacing,
|
||||
rhs.lineHeight,
|
||||
rhs.alignment,
|
||||
rhs.baseWritingDirection,
|
||||
rhs.textDecorationColor,
|
||||
rhs.textDecorationLineType,
|
||||
rhs.textDecorationLineStyle,
|
||||
rhs.textDecorationLinePattern,
|
||||
rhs.textShadowOffset,
|
||||
rhs.textShadowRadius,
|
||||
rhs.textShadowColor,
|
||||
rhs.isHighlighted,
|
||||
rhs.layoutDirection
|
||||
);
|
||||
}
|
||||
|
||||
bool TextAttributes::operator!=(const TextAttributes &rhs) const {
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
#pragma mark - DebugStringConvertible
|
||||
|
||||
SharedDebugStringConvertibleList TextAttributes::getDebugProps() const {
|
||||
|
||||
Reference in New Issue
Block a user