mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: port tag-list to C++
Also adds a new test, which tests merging of two tag-lists. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
640ecb345b
commit
f18acf6fb9
25 changed files with 195 additions and 227 deletions
|
@ -311,18 +311,16 @@ void put_HTML_watertemp(struct membuffer *b, const struct dive *dive, const char
|
|||
static void put_HTML_tags(struct membuffer *b, const struct dive *dive, const char *pre, const char *post)
|
||||
{
|
||||
put_string(b, pre);
|
||||
struct tag_entry *tag = dive->tag_list;
|
||||
|
||||
if (!tag)
|
||||
if (dive->tags.empty())
|
||||
put_string(b, "[\"--\"");
|
||||
|
||||
const char *separator = "[";
|
||||
while (tag) {
|
||||
for (const divetag *tag: dive->tags) {
|
||||
put_format(b, "%s\"", separator);
|
||||
separator = ", ";
|
||||
put_HTML_quoted(b, tag->tag->name.c_str());
|
||||
put_HTML_quoted(b, tag->name.c_str());
|
||||
put_string(b, "\"");
|
||||
tag = tag->next;
|
||||
}
|
||||
put_string(b, "]");
|
||||
put_string(b, post);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue