Skip to content

Commit

Permalink
Fixed|libcore|Info: Retain original element names
Browse files Browse the repository at this point in the history
When converting an Info block to a Record, the created variables use the unmodified letter case of the Info element names. Previously, the lower-cased lookup names were being used.

IssueID #2397
  • Loading branch information
skyjake committed Jan 7, 2020
1 parent 9eca1f4 commit 975a113
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion doomsday/sdk/libcore/include/de/data/info.h
Expand Up @@ -248,7 +248,9 @@ class DENG2_PUBLIC Info
void moveContents(BlockElement &destination);

/**
* Converts the contents of the block into a Record.
* Converts the contents of the block into a Record. Variables in the record
* are named using the unmodified element names (i.e., not lowercased).
*
* @return Record with block elements.
*/
Record asRecord() const;
Expand Down
2 changes: 1 addition & 1 deletion doomsday/sdk/libcore/src/data/info.cpp
Expand Up @@ -813,8 +813,8 @@ Record Info::BlockElement::asRecord() const
Record rec;
for (auto i = _contents.begin(); i != _contents.end(); ++i)
{
std::unique_ptr<Variable> var(new Variable(i.key()));
const Element *elem = i.value();
std::unique_ptr<Variable> var(new Variable(elem->name())); // retain case in the name
if (elem->isBlock())
{
var->set(RecordValue::takeRecord(elem->as<BlockElement>().asRecord()));
Expand Down

0 comments on commit 975a113

Please sign in to comment.