[core] Add image sections to format expression
This commit is contained in:
@@ -343,7 +343,8 @@ void testHasOverrides(LayoutType& layout) {
|
||||
EXPECT_FALSE(MockOverrides::hasOverrides(layout.template get<TextField>()));
|
||||
|
||||
// Expression, overridden text-color.
|
||||
FormatExpressionSection section(literal(""), nullopt, nullopt, toColor(literal("red")));
|
||||
FormatExpressionSection section(literal(""));
|
||||
section.setTextSectionOptions(nullopt, nullopt, toColor(literal("red")));
|
||||
auto formatExprOverride = std::make_unique<FormatExpression>(std::vector<FormatExpressionSection>{section});
|
||||
PropertyExpression<Formatted> propExprOverride(std::move(formatExprOverride));
|
||||
layout.template get<TextField>() = PropertyValueType<Formatted>(std::move(propExprOverride));
|
||||
@@ -351,7 +352,9 @@ void testHasOverrides(LayoutType& layout) {
|
||||
|
||||
// Nested expressions, overridden text-color.
|
||||
auto formattedExpr1 = format("first paragraph");
|
||||
std::vector<FormatExpressionSection> sections{ { literal("second paragraph"), nullopt, nullopt, toColor(literal("blue")) } };
|
||||
FormatExpressionSection secondParagraph(literal("second paragraph"));
|
||||
secondParagraph.setTextSectionOptions(nullopt, nullopt, toColor(literal("blue")));
|
||||
std::vector<FormatExpressionSection> sections{{std::move(secondParagraph)}};
|
||||
auto formattedExpr2 = std::make_unique<FormatExpression>(std::move(sections));
|
||||
std::unordered_map<std::string, std::shared_ptr<Expression>> branches{ { "1st", std::move(formattedExpr1) },
|
||||
{ "2nd", std::move(formattedExpr2) } };
|
||||
|
||||
Reference in New Issue
Block a user