Commit Graph

4 Commits (e1665f39450dd9b70fa67a47bd3b26f4d9bdb9e9)

Author SHA1 Message Date
elsid 66c5944ecf
Fix use after move in InfoOrder::insertInfo
When it->second.mPosition->mPrev != value.mPrev value is first moved into
*mPosition and then used to get mPrev. Since mPrev is RefId and it's copy-only
type there is no real problem but coverity complains about it.

Also enforce contract of insertInfo to support move-only types by adding a test
for a value type with deleted copy constructors.
1 year ago
Evil Eye 4eac137109 Change control flow to be easier to understand 1 year ago
Evil Eye d3c1928f01 Fix dialogue insertion again 2 years ago
elsid e892c62b10
Fix loading, inserting and moving topic info records
Topic info records need to have specific order defined via mNext and mPrev
fields (next and previous records). When loading multiple files a record may be
inserted into middle of the topic but neighborhood records may not be aware of
it. Having the order it's possible to move the records within one topic.

Sort the record once after loading all content files but preserve the order for
all other operations. Use std::map to group info ids by topic to make sure the
topics order is stable. Keep order within a topic for info ids on loading new
records. Use this order later for sorting the records.
2 years ago