diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-07-15 21:25:26 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-07-15 21:25:26 -0700 |
commit | 1dbb6071bd0826790e8afb5be1020f42e257681b (patch) | |
tree | b72ad6fa658f66f0dc886d85a0d25bea9df9efe3 /save-xml.c | |
parent | 542e04266d016c35e688e69d382204b7cefc3711 (diff) | |
download | subsurface-1dbb6071bd0826790e8afb5be1020f42e257681b.tar.gz |
Add helper function that checks if a dive site is in use
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'save-xml.c')
-rw-r--r-- | save-xml.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/save-xml.c b/save-xml.c index c8ce6fdf1..160b5fc84 100644 --- a/save-xml.c +++ b/save-xml.c @@ -520,17 +520,9 @@ void save_dives_buffer(struct membuffer *b, const bool select_only) i--; // since we just deleted that one continue; } - if (select_only) { - bool found = false; - for_each_dive(j, d) { - if (d->selected && d->dive_site_uuid == ds->uuid) { - found = true; - break; - } - } - if (!found) + if (select_only && !is_dive_site_used(ds->uuid, true)) continue; - } + put_format(b, "<site uuid='%8x'", ds->uuid); show_utf8(b, ds->name, " name='", "'", 1); if (ds->latitude.udeg || ds->longitude.udeg) { |