Browse Source

Fix data text expressions initialized with an empty string not being evaluated correctly, see #213.

Michael Ragazzon 4 years ago
parent
commit
85582afbed
1 changed files with 2 additions and 1 deletions
  1. 2 1
      Source/Core/DataViewDefault.cpp

+ 2 - 1
Source/Core/DataViewDefault.cpp

@@ -355,11 +355,12 @@ bool DataViewText::Initialize(DataModel& model, Element* element, const String&
 			DataEntry entry;
 			entry.index = text.size();
 			entry.data_expression = MakeUnique<DataExpression>(String(in_text.begin() + begin_brackets + 1, in_text.begin() + cur - 1));
+			entry.value = "#rmlui#"; // A random value that the user string will not be initialized with.
 
 			if (entry.data_expression->Parse(expression_interface, false))
 				data_entries.push_back(std::move(entry));
 
-			// Reset char so that it won't appended to the output
+			// Reset char so that it won't be appended to the output
 			c = 0;
 		}
 		else if (!in_brackets && previous)