diff options
Diffstat (limited to 'src/lib/content.cc')
| -rw-r--r-- | src/lib/content.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/content.cc b/src/lib/content.cc index b49ea4316..531dbc38f 100644 --- a/src/lib/content.cc +++ b/src/lib/content.cc @@ -22,6 +22,7 @@ #include <libcxml/cxml.h> #include "content.h" #include "util.h" +#include "content_factory.h" using std::string; using std::set; @@ -90,3 +91,18 @@ Content::set_start (Time s) signal_changed (ContentProperty::START); } + +shared_ptr<Content> +Content::clone () const +{ + shared_ptr<const Film> film = _film.lock (); + if (!film) { + return shared_ptr<Content> (); + } + + /* This is a bit naughty, but I can't think of a compelling reason not to do it ... */ + xmlpp::Document doc; + xmlpp::Node* node = doc.create_root_node ("Content"); + as_xml (node); + return content_factory (film, shared_ptr<cxml::Node> (new cxml::Node (node))); +} |
