Fix refusal to reference overlapping but different text content (#2599).
[dcpomatic.git] / src / lib / dcp_content.cc
index 928ba33818a65e6b6b8f141632b54f2d6121e521..770e5bfad0a7a3e503f2c0a951f43bf01d502c68 100644 (file)
@@ -787,8 +787,8 @@ DCPContent::can_reference_text (shared_ptr<const Film> film, TextType type, stri
        /// TRANSLATORS: this string will follow "Cannot reference this DCP: "
        return can_reference(
                film,
-               [](shared_ptr<const Content> c) {
-                       return !c->text.empty();
+               [type](shared_ptr<const Content> c) {
+                       return std::find_if(c->text.begin(), c->text.end(), [type](shared_ptr<const TextContent> t) { return t->type() == type; }) != c->text.end();
                },
                _("they overlap other text content; remove the other content."),
                why_not